libtorrent | libTorrent BitTorrent library

 by   rakshasa C++ Version: v0.13.8 License: GPL-2.0

kandi X-RAY | libtorrent Summary

kandi X-RAY | libtorrent Summary

libtorrent is a C++ library. libtorrent has no bugs, it has a Strong Copyleft License and it has medium support. However libtorrent has 5 vulnerabilities. You can download it from GitHub.

Copyright (C) 2005-2014, Jari Sundell. GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is originally from the Mozilla NSS and is under a triple license; MPL, LGPL and GPL. An exception to non-NSS code has been added for linking to OpenSSL as requested by Debian, though the author considers that library to be part of the Operative System and thus linking is allowed according to the GPL. Use whatever fits your purpose, the code required to compile with Mozilla's NSS implementation of SHA1 has been retained and can be compiled if the user wishes to avoid using OpenSSL. Skomakerveien 33 3185 Skoppum, NORWAY. Send bug reports, suggestions and patches to sundell.software@gmail.com or to the mailinglist.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              libtorrent has a medium active ecosystem.
              It has 853 star(s) with 208 fork(s). There are 57 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 42 open issues and 100 have been closed. On average issues are closed in 164 days. There are 15 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of libtorrent is v0.13.8

            kandi-Quality Quality

              libtorrent has no bugs reported.

            kandi-Security Security

              libtorrent has 5 vulnerability issues reported (0 critical, 3 high, 2 medium, 0 low).

            kandi-License License

              libtorrent is licensed under the GPL-2.0 License. This license is Strong Copyleft.
              Strong Copyleft licenses enforce sharing, and you can use them when creating open source projects.

            kandi-Reuse Reuse

              libtorrent releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libtorrent
            Get all kandi verified functions for this library.

            libtorrent Key Features

            No Key Features are available at this moment for libtorrent.

            libtorrent Examples and Code Snippets

            No Code Snippets are available at this moment for libtorrent.

            Community Discussions

            QUESTION

            Libtorrent Block Upload Alert
            Asked 2021-Jun-06 at 13:56

            I need to embed billing into the libtorrent. So I need to know when node B successfully uploads a block to node A. But according to libtorrent docs, alert block-uploaded-alert is posted when a block intended to be sent to a peer is placed in the send buffer. So in fact the block is not yet uploaded when this alert is posted. Is there a way to know whether the upload was successful?

            P.S. Can I limit the number of blocks which are uploaded to the same peer at the same time?

            ...

            ANSWER

            Answered 2021-Jun-06 at 13:56

            I'm dealing with a similar issue. From what i've discovered there's no implementation for this use case in libtorrent yet. The answer from arvid (the creator of Libtorrent) in this question: Get alerts for upload activity with libtorrent (rasterbar) may give us a hint about how to achieve this.

            Since i'm looking forward to implement this, i'm open to discuss about it and probably make a PR on libtorrent repo to achieve it: https://github.com/arvidn/libtorrent/issues/6247.

            Source https://stackoverflow.com/questions/66759797

            QUESTION

            Is there a way to pull the complete download path of the python libtorrent module?
            Asked 2021-Apr-05 at 19:32

            I have tried using

            ...

            ANSWER

            Answered 2021-Apr-05 at 19:32

            Assuming you mean "get" when you say "pull" and "call" (i.e. you have a torrent_handle and you want to know what its save path is); you can ask for the torrent_status by calling handle.status() and the torrent status object has a save_path member.

            It's documented here and here.

            Source https://stackoverflow.com/questions/66955536

            QUESTION

            libtorrent module not found
            Asked 2021-Feb-26 at 09:21

            I use this code to download from torrent to drive using google colab

            ...

            ANSWER

            Answered 2021-Feb-25 at 12:59

            Kindly follow the below given YouTube link. This would be helpful to you.

            https://youtu.be/kFG2YHVGZLs

            In short, just add the following two lines before "!apt install python3-libtorrent"

            !python -m pip install --upgrade pip setuptools wheel

            !python -m pip install lbry-libtorrent

            Source https://stackoverflow.com/questions/66364850

            QUESTION

            Libtorrent Get File by Merkle hash
            Asked 2021-Feb-18 at 19:14

            How can I request file knowing its Merkle hash via libtorrent? I'll be glad to see a piece of code or maybe just description of the logic. Do I need to download .torrent file based on the Merkle hash

            ...

            ANSWER

            Answered 2021-Feb-18 at 19:14

            First of all, there are two BEPs definining merkle-tree based torrents. BEP30 and BEP52. Neither enables sharing a file based on its merkle hash alone as they require some additional data to build a minimal viable torrent such as the piece size or the file size. To support multiple files, file names and other things some additional metadata is needed which ultimately gets encapsulated in the infohash. So torrent clients generally deal in infohashes, not file hashes.

            You can bypass some of these requirements by choosing a fixed filename and fixed piece size and then generate a canonical metadata representation for your file. In libtorrent that could be done through the create_torrent() API by creating a v2-only torrent (BEP52 without backwards compatibility).

            Source https://stackoverflow.com/questions/66259469

            QUESTION

            Cross compiling libtorrent for raspberry pi 3 model B
            Asked 2020-May-07 at 14:37

            I've been trying to cross compile jlibtorrent for the raspberry pi which uses boost build for compiling. I am using the officially provided cross compiler with the following config.jam:

            ...

            ANSWER

            Answered 2020-May-07 at 09:58

            that call (std::map::find()) was added in C++14 (see docs). I see you pass in -std=c++14 on the command line as well. Are you sure your GCC supports C++14? It seems a bit old for that.

            The current stable branch of libtorrent only requires C++11 support, if that is the branch you're building, there may be something wrong with the compiler support detection here. If you are building from libtorrent master, it requires proper C++14 support. So in that case you may want to use the stable release.

            Source https://stackoverflow.com/questions/61646834

            QUESTION

            Python/Libtorrent: Retrieve metadata from a magnet link without downloading files
            Asked 2020-Apr-12 at 23:20

            I'm trying to just get the torrent name or a list of files in the torrent without actually downloading them.

            This is my current code, it is functional but slow, as it downloads the torrent contents.

            ...

            ANSWER

            Answered 2020-Apr-12 at 23:20

            I ended up solving my problem by utilizing the 'file_priorities' property in params. This still downloads the files until the metadata is retrieved, however, so I just saved them to a temporary directory.

            Source https://stackoverflow.com/questions/45657024

            QUESTION

            Can you make basic mainline dht queries like find_node and ping with the libtorrent library
            Asked 2019-Oct-10 at 18:00

            In my project I want to monitor the bittorrent mainline network. To do so, I must use basic simple queries like find_node, announce_peer etc. What I would like to do is I would first connect to the bootstrap node and then populate my routing table with get_nodes and so on.

            Some of the researchers that did similar things before used the libtorrent library, but I can't seem to find how to do it. Does the libtorrent library support this? I am using the java binding library for this(com.frostwire.jlibtorrent).

            I was unable to find a lot of examples of usage of this library and I have been reading through the javadoc and can't figure out how to do it.

            Is there a better way I should try to do this? I have been stuck for quite some time now, any help is appreciated.

            Thanks, M

            ...

            ANSWER

            Answered 2019-Oct-10 at 18:00

            The official documentation only lists some high-level DHT APIs. The lower-level implementation is marked as TORRENT_EXTRA_EXPORT which I believe means it's only meant for testing. The ping method specifically is private.

            Since you're using java you could use mldht (I'm the author), which exposes lower-level functionality too.

            Source https://stackoverflow.com/questions/58318078

            QUESTION

            How to seed with python libtorrent DHT?
            Asked 2019-Sep-13 at 19:57

            I have Ubuntu server with libtorrent, python-libtorrent and local pc Win10 with uTorrent.

            On Server I want create 1.torrent and start seeding it on server

            On PC I want load 1.torrent to uTorrent and download it using DHT

            I made script: creation 1.torrent file, add it to DHT.

            ...

            ANSWER

            Answered 2019-Sep-13 at 19:57

            you're setting seed_mode to True. Which will make libtorrent assume you have all the files for the torrent, hence the state being "seeding".

            Once you get a peer, and it requests a block, libtorrent will actually go and open the file, and it will actually verify the piece hash as well (to avoid uploading corrupt data). However, if the file isn't there, the torrent will transition into checking mode, where it can no longer trust that it is seeding. It will check all the files.

            The first step in checking the files is checking resume data (which you transition into). However, this is typically very quick and is followed by transitioning into checking-files state.

            This doesn't seem to happen for some reason. To trouble shoot that you should pop_alerts() and print them to a log, and possibly enable more alerts, like torrent_log alerts.

            However, it appears the first problem you have is that you don't have the files you're trying to seed. It's very hard to diagnose this without the alert log though.

            Source https://stackoverflow.com/questions/57895821

            QUESTION

            libtorrent disable dht and lsd in the session
            Asked 2019-Jul-31 at 22:05

            We are creating libtorrent session like this:

            ...

            ANSWER

            Answered 2019-Jul-31 at 22:05

            the session_settings type and set_settings() function on session are deprecated (and have been for quite a while). The reference documentation online (https://libtorrent.org) is for the most recent stable release, so you won't find them documented there.

            Instead, use settings_pack and apply_settings() on the session. Or even better, pass in your settings pack to the session constructor.

            In the C++ interface, settings_pack is a class with a fairly simple interface, but in the python binding it's just a plain dictionary.

            To set up a settings pack in python, you do this:

            Source https://stackoverflow.com/questions/57266874

            QUESTION

            CMake nested libraries
            Asked 2019-Jul-26 at 14:20

            I have a Project in c++ where my executable depends on my core library and that library depends on another external library, libtorrent if it is of any relevance.

            The problem is I can not figure out how to setup my CMakeLists.txt, I have been searching for days now, without avail.

            The main idea is that the core library and the executable are on seperate git repositories, so the library is not a sub git module of the executable.

            Preferably I would be able to use ExternalProject_Add to add the core library to the executable but when I do this, the executable complains that it does not know anything about libtorrent which again the core library uses. Adding the headers of libtorrent to the executable wasn't enough, I would also need to link the executable to libtorrent. But why would I compile the core library then anyway, since I just have to add all dependencies of the core library to the executable again.

            If someone can point me in the right direction of how to setup a project that uses a core library that has other dependencies and an executable that uses the core library.

            ...

            ANSWER

            Answered 2019-Jul-26 at 14:20

            Usually, this is represented with targets and links between them.

            Your setup could look like this:

            Source https://stackoverflow.com/questions/57186187

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install libtorrent

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/rakshasa/libtorrent.git

          • CLI

            gh repo clone rakshasa/libtorrent

          • sshUrl

            git@github.com:rakshasa/libtorrent.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link