CLI utility to search and download torrents from major torrent sites

Overview

CLI Torrent Downloader

About

CLI Torrent Downloader provides convenient and quick way to search torrent
magnet links (and to run associated torrent client) via major torrent sites (ThePirateBay, LimeTorrents, Zooqle, 1337x, GloTorrents, KickAssTorrents, SolidTorrents by default) through command line.

Prerequisites

  • Python 3.8

Installation

$ virtualenv .venv38
$ . .venv/bin/activate
$ pip3 install -r requirements.txt

optional:

$ sudo ln -s tordl.sh /usr/local/bin

Config

Edit ~/.torrent_dl/config.json to customize your preferred torrent client and browser (default is qbittorent and firefox).

Usage

CLI Usage

Run search from command line:

$ tordl star wars IV

Show help:

$ tordl -h
Browse Mode Usage
  • KEY_DOWN, KEY_UP, PAGE_UP, PAGE_DOWN - Navigate
  • ENTER - Run torrent client
  • SPACE - Open torrent info URL in browser
  • ESC - exit
  • / - Search
  • a - Sort by source (torrent search engine)
  • s - Sort by seeds (default)
  • d - Sort by leechers
  • f - Sort by size
  • m - Load more search results (if possible)
  • p - Search engines selection
Search Mode Usage
  • KEY_UP - Move to previous in search history
  • KEY_DOWN - Move to next in search history
  • ENTER - Search
  • ESC - Exit search
Search Engine Selection Usage
  • KEY_UP, KEY_DOWN - Navigate
  • ENTER, SPACE - Check / Uncheck selected search engine
  • ESC - Save and exit engine selection
  • BUTTON_OK - Save and exit engine selection
  • BUTTON_SAVE - Persist selection in config and exit engine selection

Creating own search engine extensions

See ~/.torrent_dl/engines.py and ~/.torrent_dl/config.json#search_engines.

Comments
  • SSL: Certificate Verify Failed.

    SSL: Certificate Verify Failed.

    I have tried numerous times to fix this and don't understand how to do so. Any advice is welcome.

    ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'nyaa.si'. (_ssl.c:997)
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/home/alarm/software/cli-torrent-dl/tordl/core.py", line 105, in search
        response = await self._get_url(
      File "/home/alarm/software/cli-torrent-dl/tordl/core.py", line 124, in _get_url
        async with sess.get(
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 1117, in __aenter__
        self._resp = await self._coro
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/client.py", line 520, in _request
        conn = await self._connector.connect(
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 535, in connect
        proto = await self._create_connection(req, traces, timeout)
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 892, in _create_connection
        _, proto = await self._create_direct_connection(req, traces, timeout)
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
        raise last_exc
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
        transp, proto = await self._wrap_create_connection(
      File "/home/alarm/software/cli-torrent-dl/.venv/lib/python3.10/site-packages/aiohttp/connector.py", line 971, in _wrap_create_connection
        raise ClientConnectorCertificateError(req.connection_key, exc) from exc
    aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host nyaa.si:443 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'nyaa.si'. (_ssl.c:997)")]
    
    opened by abaj8494 3
  • Nothing happens when aria2c is set as torrent client

    Nothing happens when aria2c is set as torrent client

    I edited the config file as follows:

    "torrent_client_cmd": "aria2c ~/Downloads --follow-torrent=mem %s"

    When I hit enter on the relevant file within tordl, nothing happens.

    opened by carlak1701 3
  • pkg-resources==0.0.0 prevents installation

    pkg-resources==0.0.0 prevents installation

    I'm on linux and the line: pkg-resources==0.0.0 in requirements.txt

    prevents the installation from completing with the following error:

    ERROR: Could not find a version that satisfies the requirement pkg-resources==0.0.0 (from versions: none)
    ERROR: No matching distribution found for pkg-resources==0.0.0
    

    installation worked fine when that line is removed from requirements.txt

    opened by repkid 3
  • error in setup: can't find distutils

    error in setup: can't find distutils

    ~/cli-torrent-dl$ ./setup.sh 
    Delete and re-install virtualenv? [y/N]: y
    created virtual environment CPython3.8.14.final.0-64 in 91ms
      creator CPython3Posix(dest=/home/dnesterov/.config/torrentdl/.venv, clear=False, no_vcs_ignore=False, global=False)
      seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/dnesterov/.local/share/virtualenv)
        added seed packages: pip==22.0.2, setuptools==59.6.0, wheel==0.37.1
      activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
    Traceback (most recent call last):
      File "/home/dnesterov/.config/torrentdl/.venv/bin/pip3", line 5, in <module>
        from pip._internal.cli.main import main
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
        from pip._internal.cli.autocompletion import autocomplete
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
        from pip._internal.cli.main_parser import create_main_parser
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
        from pip._internal.cli import cmdoptions
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in <module>
        from pip._internal.cli.parser import ConfigOptionParser
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
        from pip._internal.configuration import Configuration, ConfigurationError
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/configuration.py", line 26, in <module>
        from pip._internal.utils.logging import getLogger
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/utils/logging.py", line 27, in <module>
        from pip._internal.utils.misc import ensure_dir
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/utils/misc.py", line 39, in <module>
        from pip._internal.locations import get_major_minor_version
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/locations/__init__.py", line 14, in <module>
        from . import _distutils, _sysconfig
      File "/home/dnesterov/.config/torrentdl/.venv/lib/python3.8/site-packages/pip/_internal/locations/_distutils.py", line 9, in <module>
        from distutils.cmd import Command as DistutilsCommand
    ModuleNotFoundError: No module named 'distutils.cmd'
    
    opened by kusosuha6vt 2
  • Feature (#22): Add support for copying magnets to clipboard and add basic python 3.10 support

    Feature (#22): Add support for copying magnets to clipboard and add basic python 3.10 support

    I totally forgot about this branch. I rebased it and added an issue for tracking.

    Also, re-add me on Telegram. I had to remake my accounts for weird and complicated reasons. The username is the same.

    opened by Mr-ROPer 2
  • Clipboard support

    Clipboard support

    Add support for copying magnets to clipboard instead of opening torrent client. We could also just add a hotkey for copying instead of overriding the opening functionality.

    opened by Mr-ROPer 2
  • Use XDG spec compliant configuration directory

    Use XDG spec compliant configuration directory

    As per the XDG spec, configuration files should land in ~/.config/or a subdirectory under it. This makes things cleaner instead of a random hidden directory in one's $HOME.

    Pyxdg offers a ready module (I have no idea how heavy it is on the dependency side) to handle this without worrying about the finer details.

    opened by lbeltrame 2
  • Open links in default browser

    Open links in default browser

    This was much easier than I was expecting.

    run_api now returns the result string, which allows others functions to make quick and easy API requests. app.py is now tasked with printing the JSON for -a.

    opened by ghost 1
  • Add BT4G support

    Add BT4G support

    Hey. Got BT4G working, along with a few little housekeeping things. Their servers are super slow, so we should maybe make this engine one of the optional ones I mentioned earlier.

    opened by ghost 1
  • Minor config/setup changes

    Minor config/setup changes

    Hey.

    Got a few changes here, so I'll just make a small list:

    • Remove setuptools from requirements. IIRC, it gets handled automatically.
    • Use the newer recommended syntax for description files.
    • distutils is deprecated, so switch to setuptools. This doesn't seem to break anything.
    • setup.py changes the version number from 1.06 to 1.6; that seems undesirable. This doesn't happen if you make it 1.0.6.
    • Load install requirements dynamically from requirements.txt. That way, you only have to keep track of one list.
    • Move venv to proper XDG config directory. This should work if someone sets $XDG_CONFIG_HOME.
    • Quote arguments in tordl.sh when passing them to python.

    I'm also working on a bunch of other things, such as support for copying magnet links to the clipboard instead of opening them in a client, as well as some other major engines. I'll do PRs when I have the engines ready, but I don't want to flood you with random PRs otherwise. So, please feel free to take whatever you like from my repo's branches anytime. I don't care about getting credit or anything like that. I just do this for fun, and because I think this a great tool.

    opened by ghost 1
  • minor bash fixes

    minor bash fixes

    rewrote tordl.sh to work with any install directory, and it works if you execute it from a symlink. also added a virtualenv setup script for the hell of it.

    the setup script installs the venv in ~/.torrent_dl, and that is where tordl.sh assumes it will be, but that's up to personal preference. it can easily be changed by modifying $VENV_DIR in both scripts.

    opened by ghost 1
Owner
x0r0x
x0r0x
A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool

Privateer A simple CLI based any Download Tool, that find files and let you stream or download thorugh WebTorrent CLI or Aria or any command tool How

Shreyash Chavan 2 Apr 4, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Stream your favorite shows straight from the command line.

A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Jonardon Hazarika 17 Dec 11, 2022
A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli.

ABOUT A command-line based, minimal torrent streaming client made using Python and Webtorrent-cli. Installation pip install -r requirements.txt It use

Janardon Hazarika 17 Dec 11, 2022
Set of scripts & tools for converting between numbers and major system encoded words.

major-system-converter Set of scripts & tools for converting between numbers and major system encoded words. Uses phonetics instead of letters to conv

null 4 Aug 9, 2022
Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo.

latex2svg Python wrapper and CLI utility to render LaTeX markup and equations as SVG using dvisvgm and svgo. Based on the original work by Tino Wagner

Matthias C. Hormann 4 Feb 18, 2022
CLI Utility to encode and recursively recreate directories with ffmpeg.

FFenmass CLI Utility to encode and recursively recreate directories with ffmpeg. Report Bug · Request Feature Table of Contents Getting Started Prereq

George Av. 8 May 6, 2022
Python CLI utility and library for manipulating SQLite databases

sqlite-utils Python CLI utility and library for manipulating SQLite databases. Some feature highlights Pipe JSON (or CSV or TSV) directly into a new S

Simon Willison 1.1k Jan 4, 2023
AlienFX is a CLI and GUI utility to control the lighting effects of your Alienware computer.

AlienFX is a Linux utility to control the lighting effects of your Alienware computer. At present there is a CLI version (alienfx) and a gtk GUI versi

Stephen Harris 218 Dec 26, 2022
CLI utility for updating the EVE Online static data export in a postgres database

EVE SDE Postgres updater CLI utility for updating the EVE Online static data export postgres database. This has been tested with the Fuzzwork postgres

Markus Juopperi 1 Oct 29, 2021
This is a CLI utility that allows you to view RedFlagDeals.com on the command line.

RFD Description Motivation Installation Usage View Hot Deals View and Sort Hot Deals Search Advanced View Posts Shell Completion bash zsh Description

Dave G 8 Nov 29, 2022
A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API.

grafana-dashboard-manager A simple cli utility for importing or exporting dashboard json definitions using the Grafana HTTP API. This may be useful fo

Beam Connectivity 31 Jan 6, 2023
Sink is a CLI tool that allows users to synchronize their local folders to their Google Drives. It is similar to the Git CLI and allows fast and reliable syncs with the drive.

Sink is a CLI synchronisation tool that enables a user to synchronise local system files and folders with their Google Drives. It follows a git C

Yash Thakre 16 May 29, 2022
ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal

ddgr is a cmdline utility to search DuckDuckGo (html version) from the terminal. While googler is extremely popular among cmdline users, in many forums the need of a similar utility for privacy-aware DuckDuckGo came up. DuckDuckGo Bangs are super-cool too! So here's ddgr for you!

Piña Colada 2.5k Dec 25, 2022
[WIP]An ani-cli like cli tool for movies and webseries

mov-cli A cli to browse and watch movies. Installation This project is a work in progress. However, you can try it out python git clone https://github

null 166 Dec 30, 2022
pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery.

pypinfo: View PyPI download statistics with ease. pypinfo is a simple CLI to access PyPI download statistics via Google's BigQuery. Installation pypin

Ofek Lev 351 Dec 26, 2022
flora-dev-cli (fd-cli) is command line interface software to interact with flora blockchain.

Install git clone https://github.com/Flora-Network/fd-cli.git cd fd-cli python3 -m venv venv source venv/bin/activate pip install -e . --extra-index-u

null 14 Sep 11, 2022
AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

AWS Interactive CLI - Allows you to execute a complex AWS commands by chaining one or more other AWS CLI dependency

Rafael Torres 2 Dec 10, 2021
Python-Stock-Info-CLI: Get stock info through CLI by passing stock ticker.

Python-Stock-Info-CLI Get stock info through CLI by passing stock ticker. Installation Use the following command to install the required modules at on

Ayush Soni 1 Nov 5, 2021