2012/3/6 Ali Hussain Chachar <alihussain...@gmail.com> > Hi to All, > > Hope you all ill be ejoying great health. I haveread on a link, > http://wiki.rtorrent.org/MagnetUri, Magnet URI that can be loaded from a > watch directory via special bencoded files. > I want to test this feture of rtorrent. So can somebody please tell be > what is the special bencoded files format? > > Hello,
The format is the same as the one used with torrents everywhere: http://en.wikipedia.org/wiki/Bencode The last line of the Bash Script example echoes out a small snippet encoded in this format. It starts with 'd', which means "a dictionary starts here". The dictionary is composed of key-value pairs. The first pair in the dictionary has a 10-byte string key, 'magnet-uri'. Then follows the byte-length of the value key (grabbed in the line above), and the actual value, which is the whole magnet URI ("magnet:?xt=urn:btih:HASH&dn=NAME&tr=UDP_1/TRACKER_1&tr=UDP_2/TRACKER_2..."). Finally, the dictionary is closed with an 'e'. Decoded, this could be interpreted as a simple object structure, such as: { 'magnet-uri' : 'magnet:?xt=urn:btih:HASH&dn=NAME&tr=UDP_1/TRACKER_1&tr=UDP_2/TRACKER_2...' } Set rtorrent to watch a directory for added torrents, one of the examples on http://libtorrent.rakshasa.no/wiki/RTorrentCommonTasks should get you going. Create the file with the Bash Script from the link you have. Modify the 'cd ~/watch' -row to point to where rTorrent is watching. Make the script file executable as per the instructions (chmod-command). Finally set your browser to open URI:s starting with 'magnet:' using that script. (Click a magnet-link if no program is already assigned to that file type, or check your browser's settings if it already launches some other program.) The script will make sure the URI passed to it by the browser has the format of a magnet URI and create a file named 'meta-HASH.torrent' in the watch directory. If rTorrent is correctly configured, it'll soon pick up the .torrent file and add it. It'll notice the .torrent's contents has a 'magnet-uri' key and begin downloading the real .torrent (and then continue with downloading the actual data that .torrent is pointing to.) Hope that helps, \Henrik With Best Wishes, > -- > Ali Hussain > > _______________________________________________ > Libtorrent-devel mailing list > Libtorrent-devel@rakshasa.no > http://rakshasa.no/mailman/listinfo/libtorrent-devel > >
_______________________________________________ Libtorrent-devel mailing list Libtorrent-devel@rakshasa.no http://rakshasa.no/mailman/listinfo/libtorrent-devel