rtorrent unable to download torrents from private trackers

Created on 22 Jan 2017  Â·  13Comments  Â·  Source: rakshasa/rtorrent

Hey,
I have an ASUS AC51U with the latest version of padavan firmware.
Yesterday, I installed rtorrent 0.9.6 and rutorrent 3.7 from entware-ng using the rtorrent easy install script.

Torrents from public torrent sites work. However, in case of private torrent websites (Tried 3) I get a tracker error.
The logs are empty.

Also, rtorrent is ignoring the rtorrent.rc file so I am unable to get detailed logs or change any settings.

Any help would be appreciated.

All 13 comments

Private tracker have to embed some auth token inside a URL for you to be able to download it outside your active browser session that has the auth cookie. If the URL has no token, you can't do cookie authentication.

The torrent files contain the url with the auth token inside. The tracker
urls are specific for the user and i can see them as such in rtorrent.

On Sun 22 Jan, 2017, 10:30 PM Yuval Adam, notifications@github.com wrote:

Private tracker have to embed some auth token inside a URL for you to be
able to download it outside your active browser session that has the auth
cookie. If the URL has no token, you can't do cookie authentication.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rakshasa/rtorrent/issues/553#issuecomment-274343152,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYGuU1yeV9yYZjcPyCqWxkfhm-EhWiwWks5rU4sggaJpZM4LqSbl
.

Can you download them with plain curl/wget?

Nope. The link to the torrent file only works when I'm signed in the
browser.

On Sun 22 Jan, 2017, 10:46 PM Yuval Adam, notifications@github.com wrote:

Can you download them with plain curl/wget?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rakshasa/rtorrent/issues/553#issuecomment-274344141,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYGuUy6Q6-7blKqlkPFe7tsmm4D8h3gIks5rU47igaJpZM4LqSbl
.

I rest my case, your URLs only work with cookie authentication.

Also, i download the torrent file and then load it into rtorrent.

On Sun 22 Jan, 2017, 10:48 PM Arnav Kalra, arnavkalra007@gmail.com wrote:

Nope. The link to the torrent file only works when I'm signed in the
browser.

On Sun 22 Jan, 2017, 10:46 PM Yuval Adam, notifications@github.com
wrote:

Can you download them with plain curl/wget?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rakshasa/rtorrent/issues/553#issuecomment-274344141,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYGuUy6Q6-7blKqlkPFe7tsmm4D8h3gIks5rU47igaJpZM4LqSbl
.

Is there anything I can do about it?

I rest my case, your URLs only work with cookie authentication.

I think what @yuvadm means is that try to manually fire up the announce URL in a browser (that you aren't logged in with). But it's not so easy since different parameters has to be appended to this URL. But, you can try out easily with the scrape URL: all you have to do is to replace announce with scrape in the URL.

If it works in the web browser then try to fire this up on your router using wget:

  • wget http://foo.com/scrape/?passkey=7324682376487643
  • check the content of the saved file: it should be similar that you have seen in the web browser

This test will ensure that you can communicate with your tracker using your router.

And make this test with simple http URL first, then if it's good try it with https if you have any.

Thanks for the clarification.
The trackers I use have compulsarily enabled https and ssl.
The links are of the form
https://ssl.foo.co/3637836hejuchdjsi737288/announce
I have tried opening these links (both the announce and scrape versions)
using the browser I'm logged in with, another browser and wget.
In all cases i get a page not found error.

On Mon 23 Jan, 2017, 4:11 PM chros73, notifications@github.com wrote:

I rest my case, your URLs only work with cookie authentication.

I think what @yuvadm https://github.com/yuvadm means is that try to
manually fire up the announce URL in a browser (that you aren't logged in
with). But it's not so easy since different parameters has to be appended
to this URL. But, you can try out easily with the scrape URL: all you have
to do is to replace announce with scrape in the URL.

If it works in the web browser then try to fire this up on your router
using wget:

This test will ensure that you can communicate with your tracker using
your router.

And make this test with simple http URL first, then if it's good try it
with https if you have any.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rakshasa/rtorrent/issues/553#issuecomment-274454126,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYGuU5A_GCwKHGKXC4LXjy6nNfwTz1hdks5rVIP0gaJpZM4LqSbl
.

First of all: does that particular torrent file works with other torrent clients at all? (e.g. uTorrent 2.x, etc)

I have tried opening these links (both the announce and scrape versions) using the browser I'm logged in with, another browser and wget.

I just tried it, and you actually have to use the base64 encoded info hash of the torrent as a parameter in the scrape URL as well (!) for certain sites:

  • get the tracker URL of torrent from Tracker list screen of rtorrent and replace announce with scrape:

    • e.g. https://tracker.foo.com:4830/dfsgfd345sfer4353/announce

    • to: https://tracker.foo.com:4830/dfsgfd345sfer4353/scrape

  • get the info hash of torrent from Info screen of rtorrent and covert to base64 encoded string (see the end of this comment for a simple php script):

    • e.g. 9EBF2A9F0F6B84C86B71920A017E2ABDD603B5A6

    • converted: %9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6

  • compose the whole URL that you can try out with browsers or with wget:

    • https://tracker.foo.com:4830/dfsgfd345sfer4353/scrape?info_hash=%9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6

Note:

  • not all trackers implemented / enabled the scraping functionality
  • you can compose the announce URL as well in similar way, but some trackers check the user-agent string of the client (so it won't work from a browser), you have to fake it with e.g. wget (port: your rtorrent listening port, peer id: Local id on Info screen of rtorrent):

    • wget --header="Host: foo.com" --user-agent="User-Agent: rtorrent/0.9.6/0.13.6" https://tracker.foo.com:4830/dfsgfd345sfer4353/announce?info_hash=%9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6&peer_id=-lt0D60-%1DX%5DqtnU%5DSF%27t&key=53c154533&compact=1&port=51710&uploaded=0&downloaded=0&left=0&event=started

PHP script hi2scrape.php to convert info hash strings to be able to use them in URLs:

#!/usr/bin/php
<?php
# convert hash_info of a torrent for scraping in URL

if ($argc != 2) {
    echo "Usage: ".$argv[0]." hash_info_string";
    exit;
}

$info_hash = $argv[1];

$shainfohash = pack("H*", $info_hash);
$encinfohash = urlencode($shainfohash);

echo "$encinfohash\n";

?>

Yes, the torrent files work with uTorrent 2.x, qbittorrent and deluge.
rtorrent is also on the list of allowed clients so it should work.

Thankfully, all the torrents started working after reinstallation of
rtorrent.

Thanks for your help.

On Tue 24 Jan, 2017, 12:40 AM chros73, notifications@github.com wrote:

First of all: does that particular torrent file works with other torrent
clients at all? (e.g. uTorrent 2.x, etc)

I have tried opening these links (both the announce and scrape versions)
using the browser I'm logged in with, another browser and wget.

I just tried it, and you actually have to use the base64 encoded info hash
of the torrent as a parameter in the scrape URL as well (!) for certain
sites:

  • get the tracker URL of torrent from Tracker list screen of rtorrent
    and replace announce with scrape:
  • get the info hash of torrent from Info screen of rtorrent and covert
    to base64 encoded string (see the end of this comment for a simple php
    script):

    • e.g. 9EBF2A9F0F6B84C86B71920A017E2ABDD603B5A6

    • converted: %9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6

  • compose the whole URL that you can try out with browsers or with wget:
    -
    https://tracker.foo.com:4830/dfsgfd345sfer4353/scrape?info_hash=%9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6

Note:

  • not all trackers implemented / enabled the scraping functionality
  • you can compose the announce URL as well in similar way, but some
    trackers check the user-agent string of the client (so it won't work from a
    browser), you have to fake it with e.g. wget (port: your rtorrent listening
    port, peer id: Local id on Info screen of rtorrent):

    • wget --header="Host: foo.com" --user-agent="User-Agent:

      rtorrent/0.9.6/0.13.6"

      https://tracker.foo.com:4830/dfsgfd345sfer4353/announce?info_hash=%9E%BF%2A%9F%0Fk%84%C8kq%92%0A%01%7E%2A%BD%D6%03%B5%A6&peer_id=-lt0D60-%1DX%5DqtnU%5DSF%27t&key=53c154533&compact=1&port=51710&uploaded=0&downloaded=0&left=0&event=started

PHP script hi2scrape.php to convert info hash strings to be able to use
them in URLs:

!/usr/bin/php

URLif ($argc != 2) { echo "Usage: ".$argv[0]." hash_info_string";
exit;}$info_hash = $argv[1];$shainfohash = pack("H*",
$info_hash);$encinfohash = urlencode($shainfohash);echo
"$encinfohashn";?>

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rakshasa/rtorrent/issues/553#issuecomment-274586171,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AYGuU74QP2IR4rYOA9LNu2HFQ05BWUTxks5rVPskgaJpZM4LqSbl
.

Thankfully, all the torrents started working after reinstallation of rtorrent.

Then it's time to close this thing.

Installing ca-certificates seems to have helped.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

KingYes picture KingYes  Â·  3Comments

troykelly picture troykelly  Â·  6Comments

vinz243 picture vinz243  Â·  4Comments

legrostdg picture legrostdg  Â·  5Comments

rezad1393 picture rezad1393  Â·  6Comments