vikstrous / pirate-get

A command line interface for The Pirate Bay
GNU Affero General Public License v3.0
337 stars 53 forks source link

Request: Add a DHT search-site in addition as backup, thanks. #122

Open mhertz opened 6 years ago

mhertz commented 6 years ago

I love this app, thanks alot - I've tried all the CLI's I could find i.e. this, torrench and mariner, but yours is the best imho because of it's efficiency and streamlines, or how to put it, awesome job and thanks again!

Anyway, for most things, then TPB is enough, but in rare occasions when needing some old or unpopular stuff, then TPB sometimes doesn't cut it, and so instead of adding a bunch of other trackers/sites like torrench and mariner, which most times will not help either, then there's a last resort which sometimes can help: Using a DHT based searching site instead! I've tried several tests where TPB and others have nothing, but the DHT sites have 10 results or more! So, if this tool supported TPB and then as a backup, a DHT-based site, then this tool would imho be the ultimate CLI torrent searcher!

Torrench once supported skytorrents, but not anymore, as the site has changed URL + owners and isn't using DHT anymore, so "useless".

Instead of working from scratch, then maybe it could help if looking at another implementation, so here's a link to the python torrent searcher used in qbittorrent, optimized for use without qbittorrent, nova6(also in pypy, so 'pip install nova6'):

https://github.com/Depau/nova6

And to use with above, the btdb.py engine module for supporting https://btdb.to:

https://github.com/qbittorrent/search-plugins/blob/master/nova3/engines/btdb.py

Other good DHT sites are: https://cnbtkitty.xyz/, https://btdig.com/ and https://www.digbt.org - I don't know which is easiest to parse - Here's also a link from the python searcher of qbittorrent about how to add a new site: https://github.com/qbittorrent/search-plugins/wiki/How-to-write-a-search-plugin

I understand of course if too much work, or not interested, and was just a thought/hope ;)

Thanks in advance regardless!

vikstrous commented 6 years ago

This is very cool. I didn't know that there are existing implementations of torrent site scrapers. It looks like if this tool supported that common API, any of those engines could be used. It would be a massive change to do this, but it seems like the right way to support more than one source.

I'm very busy these days, and this is a big change, so it's unlikely that I'll do it any time soon, so don't get your hopes up, but I agree with this direction. If anyone wants to volunteer to make the change, I'm willing to review it.

mhertz commented 6 years ago

Thanks for reply! :) Yes, maybe it would be an idea to incorporate nova6 which lets you use any engine-plugin that qBittorrent supports, though they only support one DHT searching site btdb.py, but that's also a good one :) I was "simply" asking for adding one extra scraper, as I believe all the DHT searching-sites uses the same open-source DHT-crawling backend dhtcrawler2, so any site would do probably, and then they just let you search there database slightly different e.g. some give more results but with some inaccurate additions included and others give fewer results but more accurate. However, adding nova6 support gets you a bunch of other sites supported too for free, so nice indeed I agree. When using nova6, then you just select an engine or select all and then you get a machine-parsable output of magnet-link and description etc with a pipe character as delimiter to parse from your end.

On the other side, this app is so nicely streamlined and nice 'n small and to the point, so maybe adding such big changes isn't optimal I dunno, as TPB almost always works and is enough - btw, I love how you minimize keys used to do something, with letting index-number by default open in client and then dx for description and fx for files, or the option for auto-selecting first result - simply genious - when testing the others I always thought why they didn't used your idea instead to minimize keys used :) Also, the small compact list and selectable results(instead of only pages) rocks.

I fully understand, and lets hope someone volunters then later on :) Thanks again!

olavfosse commented 5 years ago

Volunteer here.

I`m working on a pirate-get inspired program that i call pirate. It differs from pirate-get in that it is built with front/backend structure in mind. The frontend passes a set of arguments to a backend and the backend returns a list of torrents with information regarding the torrents such as seeders, leechers, magnet link etc. Then the information is presented to the user by the frontend. By default it presents it the same way as pirate-get, in a list of torrents that each have a link number you can choose. You also have the option of printing the data is a machine readable format to stdout for scripting. This makes it very easy to add a support for many different trackers without having to redo the entire user interface for each tracker.

Atm it is in a very early stage. So far i have only added support for one DHT site called bitlordsearch and that works great. I`m planning to atleast add support for tpb and rarbg. Ideally my users will contribute backends to their favorite trackers as time passes. I would not recommend trying it quite yet since i have not packaged. I will return when i have made some progress on the project.