Skip to main content

RARBG-CLI rarbgcli

âš âš âš âš âš  Sadly the official rarbg.to is down for good, but this script will continue to work on similar mirrors like https://rargb.to/ âš âš âš âš âš 


RARBG command line interface for scraping the rarbg.to torrent search engine.

Outputs a torrent information as JSON from a rarbg.to search.

usage interactive


You can even pipe | the magnet links to your favorite bittorrent client

usage pipe

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] [--download_torrents] [--magnet] [--sort {title,date,size,seeders,leechers,}]
    [--block_size SIZE] [--no_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       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, -i     Force interactive mode, show interctive menu of torrents (default: None)
--download_torrents, -d
                        Open torrent files in browser (which will download them) (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: )
--block_size SIZE, -B SIZE
                        Display torrent sizes in units of SIZE (default: auto)
--no_cache, -nc       Don't 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 pass
  • git commit ...
  • ./build.sh # will push automatically

To-do list

  • add interactive mode
  • add option to download the .torrent files
  • add api options (for importing using python)

Metadata

Release files for rarbgcli 0.0.24

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rarbgcli 0.0.24
File Size Uploaded
rarbgcli-0.0.24.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rarbgcli 0.0.24
File Interpreter ABI Platform
rarbgcli-0.0.24-py3-none-any.whl Python 3 none any Details

Total release size: 28.1 kB

Release files / rarbgcli-0.0.24.tar.gz

Download URL rarbgcli-0.0.24.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cc76f9e2d3d2df866717808310613699c43488261a6969a637035d26a6b19f05
BLAKE2b-256 checksum
How to use checksums
e552e8affbc1dd4316ece0eae78e3116cbce16ebf1bdb7c090b427481c2621cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release files / rarbgcli-0.0.24-py3-none-any.whl

Download URL rarbgcli-0.0.24-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a04a97e78eaf4eef31b2a823a2d5d98ae149f5258b15404239a9e7615c03397a
BLAKE2b-256 checksum
How to use checksums
4561c581e5cbc62e2dc077663c68dc64650e3a2f277a81b4628b46a87f0a1fbe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.0.24 This release

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page