bittorrent

MonoTorrent - Magnet link to Torrent file

夙愿已清 提交于 2019-12-01 04:52:59
问题 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! 回答1: 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

Ruby BitTorrent Library [closed]

时光总嘲笑我的痴心妄想 提交于 2019-12-01 03:56:40
I am thinking of writing customized torrent client in ruby. I found the following libraries (which are pretty old as Matt pointed out bellow). However i would like to hear about any library that i might have missed and i would love to hear what the community have to say about the following libraries. As in pros and cons... RubyTorrent libtorrent-ruby Please note that i am hoping to modify some inner workings of the library to suit my needs. Hence a pure ruby library would be ideal. Note: I searched stackoverflow for this question (or anything similar). The only questions that came up were

Hash calculation in torrent clients

微笑、不失礼 提交于 2019-12-01 00:13:44
I was wondering if someone knows what a "hash" in a BitTorrent client is referring to, it is clearly not the hash code of the file, but something different. I think thats more a magnet link to a file, but how is this connected to the file itself? I just want to understand the construct behind the scene. File <--> Hash <---> hash in torrent client The hash in a torrent client or the hash you find in a magnet-URI is the SHA1-hash of the raw bencoded info-dictionary -part of a torrent -file. To understand how that works you need to know two things: How a torrent -file is built. How bencode ing is

How to convert torrent info hash for scrape?

▼魔方 西西 提交于 2019-11-30 23:10:01
I have a torrent hash from the magnet link. For example: fda164e7af470f83ea699a529845a9353cc26576 When I try to get information about leechers and peers I should request: http://tracker.publicbt.com/scrape?info_hash= ??? How should I convert info hash for this request? Is it url encoding or becoding? how? In PHP. It's a raw hexadecimal representation. Use pack() with H to convert it. Then URL encode it. Got this python snippet from a colleague, r = '' s = 'fda164e7af470f83ea699a529845a9353cc26576' for n in range(0, len(s), 2): r += '%%%s' % s[n:n+2].upper() print r Output: %FD%A1%64%E7%AF%47

Hash calculation in torrent clients

隐身守侯 提交于 2019-11-30 18:15:19
问题 I was wondering if someone knows what a "hash" in a BitTorrent client is referring to, it is clearly not the hash code of the file, but something different. I think thats more a magnet link to a file, but how is this connected to the file itself? I just want to understand the construct behind the scene. File <--> Hash <---> hash in torrent client 回答1: The hash in a torrent client or the hash you find in a magnet-URI is the SHA1-hash of the raw bencoded info-dictionary -part of a torrent -file

How to create torrent file from magnet link using java?

混江龙づ霸主 提交于 2019-11-30 16:45:05
So I wanted to work on a new Java project that converts magnet URIs into .torrent files, however I can't find a way to do that, basically I broke a magnet URI into pieces : The used URI : magnet:?xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36&dn=Leaves+of+Grass+by+Walt+Whitman.epub&tr=udp%3A%2F%2Ftracker.example4.com%3A80&tr=udp%3A%2F%2Ftracker.example5.com%3A80&tr=udp%3A%2F%2Ftracker.example3.com%3A6969&tr=udp%3A%2F%2Ftracker.example2.com%3A80&tr=udp%3A%2F%2Ftracker.example1.com%3A1337 The breaking down : magnet:? xt=urn:btih:d2474e86c95b19b8bcfdb92bc12c9d44667cfa36 dn=Leaves+of+Grass

Extract the SHA1 hash from a torrent file

混江龙づ霸主 提交于 2019-11-30 10:18:14
问题 I've had a look around for the answer to this, but I only seem to be able to find software that does it for you. Does anybody know how to go about doing this in python? 回答1: I wrote a piece of python code that verifies the hashes of downloaded files against what's in a .torrent file . Assuming you want to check a download for corruption you may find this useful. You need the bencode package to use this. Bencode is the serialization format used in .torrent files. It can marshal lists,

Implementing Bittorrent Protocol

陌路散爱 提交于 2019-11-30 10:04:35
问题 I am looking for a tutorial/blog post on how to implement bittorrent protocol step by step. How it works? How do you make requests to peers? and talk to trackers. I do not mind the programming language (java,ruby,perl,c#) 回答1: the complete description of bittorrent protocol: http://jonas.nitro.dk/bittorrent/bittorrent-rfc.html 回答2: There is the libtorrent library. Here's the API documentation and examples. 回答3: I'd suggest you look at the spec and sources of some OSS clients. You'll have to

Convert NSData bytes to NSString?

徘徊边缘 提交于 2019-11-30 06:12:51
问题 I'm trying to use the BEncoding ObjC class to decode a .torrent file. NSData *rawdata = [NSData dataWithContentsOfFile:@"/path/to/the.torrent"]; NSData *torrent = [BEncoding objectFromEncodedData:rawdata]; When I NSLog torrent I get the following: { announce = <68747470 3a2f2f74 6f727265 6e742e75 62756e74 752e636f 6d3a3639 36392f61 6e6e6f75 6e6365>; comment = <5562756e 74752043 44207265 6c656173 65732e75 62756e74 752e636f 6d>; "creation date" = 1225365524; info = { length = 732766208; name =

How can I generate a .torrent in Java?

不想你离开。 提交于 2019-11-30 00:56:46
I want to generate a .torrent file in Java, but I don't want a big API that does anything like scraping trackers, seeding, etc. This is just for a client that generates meta data. What lightweight solutions exist? I am only generating a .torrent of a single .zip file. Thanks! Alexandre Jasmin I have put together this self-contained piece of Java code to prepare a .torrent file with a single file. The .torrent file is created by calling createTorrent() passing the name of the .torrent file, the name of the shared file and the tracker URL. createTorrent() uses hashPieces() to hash the file