Home Command line utilities Search Torrents From Command Line In Linux

Search Torrents From Command Line In Linux

By sk
Published: Last Updated on 5.3K views

Even though, there are plenitude of GUI torrent applications on the Internet, some users still prefers to use command line torrent tools. If you're one of them, I have got a good news for you. Meet We-get, a command line torrent search tool written using Python programming language. It helps you to search torrent files without leaving your Terminal. We-get is a cross-platform tool, so It will work GNU/Linux, MS Windows, and Mac OS X. In this brief tutorial, let us see how to install and use We-get tool to search torrents from command line in Linux and Unix-like systems.

Install we-get in Linux

We-get needs Python 3.5 or higher to work. Ubuntu 16.04 LTS and higher versions ships with Python 3 and Python 2 pre-installed. So, you don't have to install Python if you use Ubuntu 16.04 or higher version. You need to install PIP, Python package manager, in-order to install We-get.

To do so, run:

$ sudo apt-get install python3-pip

On RPM based systems such as RHEL, CentOS, you need to install Python 3.x version as shown below.

$ yum install https://centos7.iuscommunity.org/ius-release.rpm
$ yum install python35u

Once Python 3.5 installed, run the following command to PIP:

$ yum install python35u-pip

Also, make sure you have installed GIT on your system. Git is available in the default repositories of most Linux distributions, so we can install it using the default package manager as shown below.

On DEB based systems:

$ sudo apt-get install git

On RPM based systems:

$ sudo yum install git

On Arch Linux and its derivatives:

$ sudo pacman -S git

Once Pip and Git installed, run the following command to install ‘we-get’.

$ sudo pip install git+https://github.com/rachmadaniHaryono/we-get

DownloadFree eBook: “The Best Web Programming Languages to Learn”

Search Torrents From Command Line In Linux

We-get currently supports the following four websites.

  • 1337x
  • thepiratebay
  • eztv
  • yts
  • more yet to come

Let us see some practical examples.

Disclaimer: Searching/Downloading torrent files is illegal in some regions/countries. Please use this information at your own risk. We (OSTechNix or the Author) are not responsible for any kind of illegal usage of torrents.

To search for a torrent, run:

$ we-get --search "Arch Linux" --target the_pirate_bay

Sample output:

# Fetching data from 'the_pirate_bay' ...
the_pirate_bay Arch.Linux.Environment.Setup.How-to [2/0]
the_pirate_bay Raspberry.Pi.Arch.Linux.ARM [1/0]
the_pirate_bay Arch.Linux.2016-07-01.ISO [1/1]
the_pirate_bay Arch.Linux.Netinstall.Image.Dual.Architecture [0/0]
the_pirate_bay Arch.Linux.Live.ISO [0/1]
the_pirate_bay arch.linux [0/1]
the_pirate_bay Arch.Linux.Netinstall.Image.32-bit [0/0]
we-get >

You can view the list of available torrents for the above search term (i.e Arch Linux). To do so, just type list in the we-get prompt. Also, to view the details of a particular torrent, type show <torrent_name> like below.

we-get > show Arch.Linux.Environment.Setup.How-to
Arch.Linux.Environment.Setup.How-to {
 "leeches": "0",
 "link": "magnet:?xt=urn:btih:3b2a9431310ad4de48b55bf3b219d43820a021b1&dn=Arch+Linux+Environment+Setup+How-to&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Fzer0day.ch%3A1337&tr=udp%3A%2F%2Fopen.demonii.com%3A1337&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Fexodus.desync.com%3A6969",
 "seeds": "2",
 "target": "the_pirate_bay"
}

To exit from the We-get shell, type exit.

Here is the complete list of supported options for We-get.

$ we-get -h
Usage: we-get [options]...

Options:
 -s --search [text] Search for a torrent.
 -l --list List top torrents from modules.
 -t --target [target] Select module to use or 'all'.
 -L --links Output results as links.
 -J --json Output results in JSON format.
 -G --get-list List targets (supported web-sites).
 -f --filter [str] Match text or regular expression in the torrent name.
 -n --results [n] Number of results to retrieve.
 -S --sort-type [type] Sort torrents by name/seeds (default: seeds).

Video options:
 -q --quality [q] Try to match quality for the torrent (720p,1080p, ...).
 -g --genre [g] Try to select video genre for the torrent (action, comedy, etc..).

General options:
 -h --help Help message.
 -v --version Show version.

Copyright (c) 2016-2017 Levi Sabah <0xl3vi@gmail.com>.
Full documentation at: <http://github.com/levisabah/we-get>

Resource:

You May Also Like

2 comments

Unonymous March 15, 2019 - 2:01 pm

This repo doesn’t exist anymore

Reply
sk March 15, 2019 - 2:13 pm

Thanks for the heads up. I just updated the correct Github repo.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More