# [RARBG-CLI `rarbgcli`](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://github.com/FarisHijazi/rarbgcli)
âš âš âš âš âš
Sadly the official [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://rarbg.to) is down for good, but this script will continue to work on similar mirrors like [https://rargb.to/](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://rargb.to/)
âš âš âš âš âš
---
RARBG command line interface for scraping the [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/rarbg.to) torrent search engine.
Outputs a torrent information as JSON from a [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/rarbg.to) search.
![usage interactive](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/usage_interactive.gif)
---
You can even pipe `|` the magnet links to your favorite bittorrent client
![usage pipe](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/usage_pipe_to_client.gif)
## 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
```sh
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](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://stedolan.github.io/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:
```sh
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.~
![](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/solvingCAPTCHA.gif)
## Development
- make changes
- `./test.sh` # make sure tests pass
- `git commit ...`
- `./build.sh` # will push automatically
### To-do list
- [x] add interactive mode
- [x] add option to download the .torrent files
- [ ] add api options (for importing using python)
Raw data
{
"_id": null,
"home_page": "https://github.com/FarisHijazi/rarbgcli",
"name": "rarbgcli",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "rarbg torrent rarbgcli rarbgapi cli api scraper rarbg-cli rarbg-api rarbg-scraper",
"author": "Faris Hijazi",
"author_email": "theefaris@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e5/52/e8affbc1dd4316ece0eae78e3116cbce16ebf1bdb7c090b427481c2621cc/rarbgcli-0.0.24.tar.gz",
"platform": null,
"description": "# [RARBG-CLI `rarbgcli`](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://github.com/FarisHijazi/rarbgcli)\r\n\r\n\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\r\nSadly the official [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://rarbg.to) is down for good, but this script will continue to work on similar mirrors like [https://rargb.to/](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://rargb.to/)\r\n\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\u00e2\u0161\u00a0\r\n\r\n---\r\n\r\nRARBG command line interface for scraping the [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/rarbg.to) torrent search engine.\r\n\r\nOutputs a torrent information as JSON from a [rarbg.to](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/rarbg.to) search.\r\n\r\n![usage interactive](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/usage_interactive.gif)\r\n\r\n---\r\n\r\nYou can even pipe `|` the magnet links to your favorite bittorrent client\r\n\r\n![usage pipe](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/usage_pipe_to_client.gif)\r\n\r\n## Installation\r\n\r\nFrom PyPi (stable)\r\n\r\n pip install rarbgcli\r\n\r\nFrom source (latest)\r\n\r\n pip install git+https://github.com/FarisHijazi/rarbgcli\r\n\r\n## Usage\r\n\r\nBoth aliases are valid for the same command: `rarbg` or `rarbgcli`\r\n\r\n usage:\r\n [-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,}]\r\n [--block_size SIZE] [--no_cache] [--no_cookie]\r\n search\r\n\r\n positional arguments:\r\n search Search term\r\n\r\n optional arguments:\r\n -h, --help show this help message and exit\r\n --category {movies,xxx,music,tvshows,software,games,nonxxx,}, -c {movies,xxx,music,tvshows,software,games,nonxxx,}\r\n --limit LIMIT, -l LIMIT\r\n Limit number of torrent magnet links (default: inf)\r\n --domain DOMAIN Domain to search, you could put an alternative mirror domain here (default: rarbgunblocked.org)\r\n --order {data,filename,leechers,seeders,size,}, -r {data,filename,leechers,seeders,size,}\r\n Order results (before query) by this key. empty string means no sort (default: )\r\n --descending Order in descending order (only available for --order) (default: False)\r\n --interactive, -i Force interactive mode, show interctive menu of torrents (default: None)\r\n --download_torrents, -d\r\n Open torrent files in browser (which will download them) (default: None)\r\n --magnet, -m Output magnet links (default: False)\r\n --sort {title,date,size,seeders,leechers,}, -s {title,date,size,seeders,leechers,}\r\n Sort results (after scraping) by this key. empty string means no sort (default: )\r\n --block_size SIZE, -B SIZE\r\n Display torrent sizes in units of SIZE (default: auto)\r\n --no_cache, -nc Don't use cached results from previous searches (default: False)\r\n --no_cookie, -nk Don't use CAPTCHA cookie from previous runs (will need to resolve a new CAPTCHA) (default: False)\r\n\r\nExample\r\n\r\n```sh\r\nrarbgcli \"the stranger things 3\" --category movies --limit 10 --magnet\r\n```\r\n\r\n### Piping `|`\r\n\r\nThe program is pipe-friendly, so you could use this tool in conjunction with the [jq](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/https://stedolan.github.io/jq/) command to filter the JSON output, and then pipe it to your favorite torrent client.\r\n\r\nThe `--magnet` option is a convenience option instead of filtering it every time with `jq`, the bellow 2 lines are equivalent:\r\n\r\n```sh\r\nrarbgcli \"the stranger things 3\" --category movies --limit 10 | jq .[].magnet | xargs qbittorrent\r\nrarbgcli \"the stranger things 3\" --category movies --limit 10 --magnet | xargs qbittorrent\r\n```\r\n\r\n## CAPTCHA\r\n\r\nCAPTCHA should automatically be solved using Selenium Chrome driver and `tesseract`.\r\n\r\nIn the case that it doesn't, see the instructions at the bottom to manually solve the CAPTCHA and save the cookies.\r\n\r\n~To get around the captcha, the user will be prompted to solve it and enter the cookie in the terminal.~\r\n\r\n~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.~\r\n\r\n~This might be automated one day, because it is possible.~\r\n\r\n![](https://raw.githubusercontent.com/FarisHijazi/rarbgcli/master/assets/solvingCAPTCHA.gif)\r\n\r\n## Development\r\n\r\n- make changes\r\n- `./test.sh` # make sure tests pass\r\n- `git commit ...`\r\n- `./build.sh` # will push automatically\r\n\r\n### To-do list\r\n\r\n- [x] add interactive mode\r\n- [x] add option to download the .torrent files\r\n- [ ] add api options (for importing using python)\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Command line interface for rarbg.to",
"version": "0.0.24",
"project_urls": {
"Homepage": "https://github.com/FarisHijazi/rarbgcli"
},
"split_keywords": [
"rarbg",
"torrent",
"rarbgcli",
"rarbgapi",
"cli",
"api",
"scraper",
"rarbg-cli",
"rarbg-api",
"rarbg-scraper"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4561c581e5cbc62e2dc077663c68dc64650e3a2f277a81b4628b46a87f0a1fbe",
"md5": "5fd5eb659178721938faebed045083b4",
"sha256": "a04a97e78eaf4eef31b2a823a2d5d98ae149f5258b15404239a9e7615c03397a"
},
"downloads": -1,
"filename": "rarbgcli-0.0.24-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5fd5eb659178721938faebed045083b4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 13649,
"upload_time": "2023-09-04T02:48:59",
"upload_time_iso_8601": "2023-09-04T02:48:59.618966Z",
"url": "https://files.pythonhosted.org/packages/45/61/c581e5cbc62e2dc077663c68dc64650e3a2f277a81b4628b46a87f0a1fbe/rarbgcli-0.0.24-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e552e8affbc1dd4316ece0eae78e3116cbce16ebf1bdb7c090b427481c2621cc",
"md5": "72a57809a827b79cae831fdb921193ca",
"sha256": "cc76f9e2d3d2df866717808310613699c43488261a6969a637035d26a6b19f05"
},
"downloads": -1,
"filename": "rarbgcli-0.0.24.tar.gz",
"has_sig": false,
"md5_digest": "72a57809a827b79cae831fdb921193ca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 14466,
"upload_time": "2023-09-04T02:49:01",
"upload_time_iso_8601": "2023-09-04T02:49:01.850818Z",
"url": "https://files.pythonhosted.org/packages/e5/52/e8affbc1dd4316ece0eae78e3116cbce16ebf1bdb7c090b427481c2621cc/rarbgcli-0.0.24.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-04 02:49:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FarisHijazi",
"github_project": "rarbgcli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "rarbgcli"
}