Command line interface for rarbg.to
Project description
RARBG-CLI rarbgcli
RARBG command line interface for scraping the rarbg.to torrent search engine.
Outputs a torrent information as JSON from a rarbg.to search.
You can even pipe |
the magnet links to your favorite bittorrent client
Installation
From PyPi (stable)
pip install rarbgcli
From source (latest)
pip install git+https://github.com/FarisHijazi/rarbgcli
Usage
Both aliases are valid for the same command: rarbg
or rarbgcli
usage:
[-h] [--category {movies,xxx,music,tvshows,software,games,nonxxx,}] [--limit LIMIT] [--domain DOMAIN]
[--order {data,filename,leechers,seeders,size,}] [--descending]
[--interactive {true,false}] [--magnet] [--sort {title,date,size,seeders,leechers,}] [--cache] [--no_cookie]
search
positional arguments:
search Search term
optional arguments:
-h, --help show this help message and exit
--category {movies,xxx,music,tvshows,software,games,nonxxx,}, -c {movies,xxx,music,tvshows,software,games,nonxxx,}
--limit LIMIT, -l LIMIT
Limit number of torrent magnet links (default: inf)
--domain DOMAIN, -d DOMAIN
Domain to search, you could put an alternative mirror domain here (default:
rarbgunblocked.org)
--order {data,filename,leechers,seeders,size,}, -r {data,filename,leechers,seeders,size,}
Order results (before query) by this key. empty string means no sort (default: )
--descending Order in descending order (only available for --order) (default: False)
--interactive {true,false}, -i {true,false}
Interactive mode, show menu of torrents (default: None)
--magnet, -m Output magnet links (default: False)
--sort {title,date,size,seeders,leechers,}, -s {title,date,size,seeders,leechers,}
Sort results (after scraping) by this key. empty string means no sort (default:
)
--cache Use cached results from previous searches (default: False)
--no_cookie, -nk Don't use CAPTCHA cookie from previous runs (will need to resolve a new CAPTCHA)
(default: False)
Example
rarbgcli "the stranger things 3" --category movies --limit 10 --magnet
Piping |
The program is pipe-friendly, so you could use this tool in conjunction with the jq command to filter the JSON output, and then pipe it to your favorite torrent client.
The --magnet
option is a convenience option instead of filtering it every time with jq
, the bellow 2 lines are equivalent:
rarbgcli "the stranger things 3" --category movies --limit 10 | jq .[].magnet | xargs qbittorrent
rarbgcli "the stranger things 3" --category movies --limit 10 --magnet | xargs qbittorrent
CAPTCHA
CAPTCHA should automatically be solved using Selenium Chrome driver and tesseract
.
In the case that it doesn't, see the instructions at the bottom to manually solve the CAPTCHA and save the cookies.
To get around the captcha, the user will be prompted to solve it and enter the cookie in the terminal.
I tried many ways to automate this process (using selenium and tesseract), but it just ends up being overkill, hard to maintain across platforms, and I still didn't get it to work.
This might be automated one day, because it is possible.
Development
- make changes
./test.sh
# make sure tests passgit commit ...
./build.sh
# will push automatically
To-do list
- add interactive mode
- add github workflow
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rarbgcli-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8e60384cbbc1f286e0b740a93846251d5c3e7042b1a352a6e65b577b0f8aa93 |
|
MD5 | 3c198892b23350c6553a80f0cfd0dcac |
|
BLAKE2b-256 | dfad6e90a1ebf154e67226093a9b0c89a7e9efa573a1c6114ba64b39a3328920 |