Code Monkey home page Code Monkey logo

torrench's Introduction

Torrench - Command-line torrent search tool

Torrench is a command-line torrent search tool that fetches torrents and displays results within console window. It does this by scrapping torrent-hosting websites (list below). Once torrent results are fetched, torrench can further fetch torrent details as well. Details include torrent Description, comments, as well as download link/file.

Current version - V1.0

Torrench initially began as a python learning project for me. I am sure there are ways to implement code I wrote in a better/efficient way. If you find any, please let me know.

I'll continue updating it, add new features and try making it better and more efficient.

Compatibility

It's compatible under Linux and Windows operating systems. As for MacOS, I don't own any mac hardware. If anyone wants to help porting it onto apple, feel free to do so.

Websites Supported

  1. linuxtracker.org - Download linux distros ISO torrents [default]
  2. The Pirate Bay (TPB) - REQUIRES CONFIGURATION. READ CAREFULLY BEFORE USING

Requirements and Installation

Linux

  1. Requires Python3
  2. Install required packages
## [Using pip]
## [pip comes pre-installed with python 3.4+]
## If not installed - install the **python3-pip** package
$ sudo apt-get install python3-pip
$ (sudo) python3 -m pip install -r requirements.txt
  1. Simple copy-paste the following in terminal for installation
$ git clone https://github.com/kryptxy/torrench.git ~/.torrench
## Make executable
$ chmod a+x $HOME/.torrench/data/torrench.py

## You may add torrench to $PATH 
## OR 
## symlink torrench in /usr/local/bin (requires sudo)

# Add torrench to PATH. Change the *rc file according to shell you use
$ mkdir $HOME/.torrench/bin && ln -s $HOME/.torrench/data/torrench.py $HOME/.torrench/bin/torrench
$ printf "#Torrench\nPATH=$HOME/.torrench/bin:$PATH" >> $HOME/.bashrc; source $HOME/.bashrc
## OR ##
# Symlink torrench in /usr/local/bin [Requires root]
$ sudo ln -s $HOME/.torrench/data/torrench.py /usr/local/bin/torrench
  1. That's it!

Windows

Windows does not require any additional packages. Everything required to run this software is provided in executable (Does not even require python pre-installed).

  • Download torrench.exe executable

  • That's it. Run using cmd/powershell [> torrench.exe <search>]

    • NOTE:
      • Windows powershell is unable to display magenta color. When I tried, the name field was appearing empty. So to distinguish trusted uploaders, I have added a cyan-colored (**) in front and at the back of TORRENT NAME and UPLOADER NAME.
      • In windows, the default location for storing html files is C:\Users\<user>\.torrench\temp

Should I use ThePirateBay?

By default, searching thepiratebay (TPB) from torrench is disabled. Some configuration is required to be done by user to enable TPB. But, before moving to configuration, note the following:

  • Using TPB in many countries is illegal. Using TPB can get you into in-intended torubles (e.g notices/block from ISP). Read Legal issues
  • Neither I, nor the tool will be held responsible for any action taken against user for using TPB from torrench.
  • Examples of illegal contents on TPB.

Configuration instructions (If you decided to use it anyways):

  1. Download config.ini file (Hosted on sync)
    • Windows - Copy the config file in C:\Users\<user>\.torrench\tpb\conf\ (create any missing directories)
    • Linux - Copy the config file to $HOME/.torrench/data/tpb/conf/ (Create any missing directories)
  2. Config file needs to be enabled
    • Open config.ini file
    • Set enable=1
    • Save and exit
  3. That's it. Use with (-t) flag

Features

  • Supports all *nix distros
  • Simple to use.
  • Display search results in organized, tabular form.
  • Supports filtering search using categories
  • [TPB_Specific] Surf torrents Ad-free
  • [TPB-Specific] Get complete torrent details (Description, comments, torrent download). Torrent details are available in dynamically-generated HTML pages.
  • [TPB-Specific] Display colored results on basis of uploader's status (Very useful when choosing torrent). (If you are familiar with thepiratebay, you must be knowing that it divides uploaders into 3 categories)
    • VIP Uploader [green-skull]
    • Trusted Uploader [magenta-skull]
    • General Uploader
  • [TPB-Specific] Fetch Torrents on basis of pages [1 page yields 30 results (max)].
  • [TPB-Specific] Fetch Comments on basis of pages [Useful when torrent has large number of comments, and not all comments are intended to be fetched].

Usage (with example)

## Input should to precise to get better/expected results

usage: torrench [-h] [-t] [-p LIMIT] [-c] [-v] [search]

Command-line torrent search tool.

positional arguments:
  search                Enter search string

optional arguments:
  -h, --help            show this help message and exit
  -t, --thepiratebay    Search ThePirateBay (TPB)
  -p LIMIT, --page-limit LIMIT
                        Number of pages to fetch results from (1 page = 30
                        results). [default: 1]
  -c, --clear-html      Clear all [TPB] torrent description HTML files and
                        exit.
  -v, --version         Display version and exit.
  
EXAMPLE: 
$ torrench "ubuntu 16.10" - Fetches torrents for ubuntu 16.10
$ torrench "arch linux" - Fetches torrents for Arch Linux

Samples

Linux

$ torrench "opensuse"

linux-1 linux-2

Windows

> torrench.exe "ubuntu"

windows-1

> torrench.exe "fedora workstation 26"

windows-1 windows-2

Illegal searches (Should not be practiced)

> torrench.exe -t "fast 8"

windows-1-illegal

> torrench.exe -t "suits s05e08"

windows-2-illegal

$ torrench -t "windows"

linux-illegal

Known Issues (and Workarounds)

  1. A torrent might take very long to fetch results. I have generally faced this issue when running torrench for the first time. I still got to figure this out. Till then, here is what I do:
    • Abort the ongoing search [Ctrl+C]
    • Search again. The second time generally works fine.

Note

  • Each and every detail you will see on the terminal/HTML page is fetched from the website. If some info is missing/unintended, it's probably how its available on website.

  • [TPB-specific] All torrent comments can be fetched.

    • Comments are divided into pages. 1 page can have MAX 25 comments. If (suppose) a torrent has <=50 comments (2 pages), no prompt occurs. If a torrent has more than 50 comments, you will get a prompt asking number of pages to fetch. Options:
      • (fetch all): Fetch all pages
      • (enter n): Enter number of pages to fetch
      • (d): "display anyway" - Do not fetch any extra pages. By default the latest comments (comments on last page are fetched).

    Fetching comments pages can be time-costly. For every comment page, entire new HTML page is fetched.

Disclaimer

This tool only fetches torrent and details from already existing torrent website(s). I do not take any responsibility for availability of any kind of torrent data, or/and hosting of any torrent website(s). Also, I am not responsible for closing of any of the torrent website(s). As long as the website(s) (proxies) are available, data will be fetched.

Bug Report

Found a bug? Please report and help improving this tool. You can Open Issue or contact me directly.

Feedback/Suggestions/Feature Requests

Feedbacks/Suggestions are much appreciated. They help in improving the tool, and keep me motivated.

Contact

E-mail : [email protected]

Licence

Copyright (C) 2017 Rijul Gulati <[email protected]>

Torrench is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Torrench is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Kernel Adiutor.  If not, see <http://www.gnu.org/licenses/>.

torrench's People

Contributors

ricky-wilson avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.