bittorrent

Downloading a Torrent with libtorrent-python

孤街醉人 提交于 2019-12-03 04:25:07
问题 I have the following python code: import libtorrent as lt import time ses = lt.session() ses.listen_on(6881, 6891) params = { 'save_path': '/home/downloads/', 'storage_mode': lt.storage_mode_t(2), 'paused': False, 'auto_managed': True, 'duplicate_is_error': True} link = "magnet:?xt=urn:btih:4MR6HU7SIHXAXQQFXFJTNLTYSREDR5EI&tr=http://tracker.vodo.net:6970/announce" handle = lt.add_magnet_uri(ses, link, params) ses.start_dht() print 'downloading metadata...' while (not handle.has_metadata()):

wget-like bittorrent client or library? [closed]

不羁岁月 提交于 2019-12-03 03:34:01
Is there any bittorrent client or (Java|Python|Ruby|Perl) library that I can use like wget or curl? I would like to use simply as a step in a script, like you would use wget. EDIT : Sorry, I should have mentioned I'm using Ubuntu. ctorrent SYNOPSIS ctorrent [General Options] [Download Options] [Make Torrent Options] file.torrent CTorrent is a BitTorrent Client written in C that doesn’t require any graphical component, such as an X server. It’s built as a console program and it can be even used remotely in a machine that provides outside ssh access. You can load torrents in rtorrent from the

Sending scrape request for getting torrent's seeds and peers

强颜欢笑 提交于 2019-12-03 03:32:16
I have been trying to create a torrent site but I'm stuck with the following. How to send torrent scrape request to get its seeder and leechers? I have a PHP class function that provides me announce list. public function getTrackers() { // Load tracker list $trackerlist = array(); if ( $this->torrent->get_value('announce-list') ) { $trackers = $this->torrent->get_value('announce-list')->get_plain(); while ( list( $key, $value ) = each( $trackers ) ) { if ( is_array( $value->get_plain() ) ) { while ( list( $key, $value2 ) = each( $value ) ) { while ( list( $key, $value3 ) = each( $value2 ) ) {

Reading the fileset from a torrent

佐手、 提交于 2019-12-02 20:58:50
I want to (quickly) put a program/script together to read the fileset from a .torrent file. I want to then use that set to delete any files from a specific directory that do not belong to the torrent. Any recommendations on a handy library for reading this index from the .torrent file? Whilst I don't object to it, I don't want to be digging deep into the bittorrent spec and rolling a load of code from scratch for this simple purpose. I have no preference on language. Effbot has your question answered . Here is the complete code to read the list of files from .torrent file (Python 2.4+): import

Downloading a Torrent with libtorrent-python

大兔子大兔子 提交于 2019-12-02 17:39:23
I have the following python code: import libtorrent as lt import time ses = lt.session() ses.listen_on(6881, 6891) params = { 'save_path': '/home/downloads/', 'storage_mode': lt.storage_mode_t(2), 'paused': False, 'auto_managed': True, 'duplicate_is_error': True} link = "magnet:?xt=urn:btih:4MR6HU7SIHXAXQQFXFJTNLTYSREDR5EI&tr=http://tracker.vodo.net:6970/announce" handle = lt.add_magnet_uri(ses, link, params) ses.start_dht() print 'downloading metadata...' while (not handle.has_metadata()): time.sleep(1) print 'got metadata, starting torrent download...' while (handle.status().state != lt

Cherry pick peers using Rasterbar libtorrent in Python

我是研究僧i 提交于 2019-12-02 13:17:41
问题 Does anyone know if it's possible to cherry pick peers to connect with using libtorrent? That is, after the tracker returns a list of peer IPs and ports, only a selected few will be connected with based on some defined criteria. Thanks 回答1: you can remove peers from the set using set_ip_filter(). you can add peers to the set by using connect_peer(). That's about all the control you have. The priority of which peers from the set to connect to in which order is hard coded. 来源: https:/

Cherry pick peers using Rasterbar libtorrent in Python

大兔子大兔子 提交于 2019-12-02 02:51:07
Does anyone know if it's possible to cherry pick peers to connect with using libtorrent? That is, after the tracker returns a list of peer IPs and ports, only a selected few will be connected with based on some defined criteria. Thanks you can remove peers from the set using set_ip_filter() . you can add peers to the set by using connect_peer() . That's about all the control you have. The priority of which peers from the set to connect to in which order is hard coded. 来源: https://stackoverflow.com/questions/26886154/cherry-pick-peers-using-rasterbar-libtorrent-in-python

What are the most recent bittorrent DHT implementation recommendations?

爷,独闯天下 提交于 2019-12-01 13:25:53
I'm working on implementing yet another bittorrent client and at this time struggling with DHT. It is implemented accordingly to this specification http://www.bittorrent.org/beps/bep_0005.html but starting debugging it I noticed that other nodes' responses on the network vary. For example, find_node is supposed to return either target node info or 8 closest nodes. Most of the nodes reply with 34 closest nodes and usually only 1 - 3 nodes from those 34 successfully reply to the consequent ping request. Is there another document with better implementation recommendation? May be it is already

What are the most recent bittorrent DHT implementation recommendations?

一曲冷凌霜 提交于 2019-12-01 10:23:51
问题 I'm working on implementing yet another bittorrent client and at this time struggling with DHT. It is implemented accordingly to this specification http://www.bittorrent.org/beps/bep_0005.html but starting debugging it I noticed that other nodes' responses on the network vary. For example, find_node is supposed to return either target node info or 8 closest nodes. Most of the nodes reply with 34 closest nodes and usually only 1 - 3 nodes from those 34 successfully reply to the consequent ping

MonoTorrent - Magnet link to Torrent file

我的梦境 提交于 2019-12-01 07:41:48
Is there a way to generate .torrent file from a magnet link using the MonoTorrent .Net library? If so can someone explain with an example? I searched the site as well as googled but cant find a solution. if it is not possible are there any other windows commnd line utility that will get the job done? thanks and appreciate ur help in advance! yes, It could be done using the monotorrent library. you could take the hash value from the magnet link and use it to create a torrent manager that will create a torrent file before downloading. if this were the magnet link: magnet:?xt=urn:btih