jimrollenhagen / pywhatauto

IRC bot to auto-download torrents and more.
95 stars 27 forks source link

Unable to login if CF DDos protection enabled #11

Open dewey opened 10 years ago

dewey commented 10 years ago

If the CF DDoS protection is enabled on BTN the bot is unable to login and snatch the torrents.

"pywhatauto needs to login to snatch the torrents. It doesn't handle the CF browser check very well and should be considered essentially non-functional at the moment."

"You can work around it by using authkeys - like autodl|irssi does. But that is something the developer(s) of pywhatauto have to implement. There's nothing I can think off to make pywhat working properly as long as the DDoS protection is activated."

jimrollenhagen commented 10 years ago

@dewey preset cookies works for this, but if you can provide what I need to send to login.php, happy to fix.

dewey commented 10 years ago

I'm using the Cookie method right now but it looks like the CF cookies are expiring after each week and you'll have to add new ones (according to the BTN thread).

I asked a BTN Staffer and he just replied, maybe that's something you could use to work around that issue.

Via PM from a BTN TV Technician:

If you look at the torrent download links, you'll see something like this: torrents.php?action=download&id=&authkey=&torrent_pass=

$1 is the numerical torrent ID that is pulled from the channel. $2 and $3 are random, alphanumerical strings that are fixed for each users and are needed to download files without being logged in. Those strings usually don't change, meaning if the program has fields to input them and sends them in the get request, you won't have to log in.

theVDude commented 10 years ago

I'm going to look into this a bit. Authkey and Torrentpass are available from any download link, as well as the RSS feed. They're not hard to find, I wonder how hard they'll be to implement though.

dewey commented 10 years ago

FWIW just adding the following to your custom.conf will fix the issue. This is also how autodl-irssi does it. You can retrieve these two values by looking at the [DL] link on a random torrent.

[broadcasthenet]
downloadURL: https://broadcasthe.net/torrents.php?action=download&authkey=yourauthkey&torrent_pass=yourtorrentpasskey&id=
theVDude commented 10 years ago

Ah, perfect. I hadn't thought of reordering it so the ID was last. You're a hero!