Skip to content
/ torgo Public
forked from tnychn/torrodle

⚡️ A magnet link scraper for streaming videos (movies, tv shows, anime, porn) along with subtitles.

License

Notifications You must be signed in to change notification settings

stl3/torgo

Repository files navigation

Torrodle

Watch anything instantly just with a single command

Torrodle is a command-line program which search and gather magnet links of movies, tv shows, animes and porns from providers. It then streams the video via HTTP (along with its subtitles) and play it with a user preferred video player (such as vlc and mpv).

If you don't know what BitTorrent is, you shouldn't be using Torrodle. There are some copyrighted content which might be illegal downloading them in your country.

Table of Contents

Features

  • Lightning fast ⚡️
  • Simple to use 🚸
  • Built-in torrent streaming client via HTTP (refined from go-peerflix)
  • Watch the video while it is being downloaded 🔰
  • Query multiple providers in a single search 🔎
  • Sorted results from 5 different providers at once 🚀
  • Along with subtitles fetching for the video 📄

Installation

Binary

For installing the command-line tool only

Download the latest stable release of the binary at releases.

Go Get

Make sure you have Go installed on your machine.

Command-line tool

$ go get github.com/a1phat0ny/torrodle/cmd/...

Library

$ go get github.com/a1phat0ny/torrodle

Build From Source

For installing the command-line tool only

$ git clone github.com/a1phat0ny/torrodle
$ cd torrodle
$ go build cmd/torrodle/main.go

Dependencies

Dependencies are listed in go.mod file.

  1. logrus -- better logging
  2. goquery -- HTML parsing
  3. torrent -- torrent streaming
  4. osdb -- subtitles fetching from OpenSubtitles
  5. go-humanize -- humanizing file size words
  6. color -- colorized output
  7. tablewriter -- table rendering
  8. survey -- pretty prompting

Usage

Recommended video player: MPV

Search for torrents

Enter torrodle in your terminal. That's all !

This command will launch a wizard that will help you search for torrents.

Stream from own magnet

Enter torrodle "magnet uri" in your terminal. Choose your preferred video player and enjoy !

NOTE: For auto executing of video players, only MPV and VLC are supported. For other video players, you can choose None in video player options prompt and open your video player with the stream url.

Configurations

Path to the config file: ~/.torrodle.json

{
   "DataDir": "",
   "ResultsLimit": 100,
   "TorrentPort": 9999,
   "HostPort": 8080,
   "Debug": false
}
  • DataDir (default: $TMPDIR/torrodle/) : Directory where the directories of download files (and subtitles) will be stored.
  • ResultsLimit (default: 100) : Maximum count of results will be fetched from provider(s).
  • TorrentPort (default: 9999) : Listen port for the torrent client.
  • HostPort (default: 8080) : Listen port for HTTP localhost video streaming (http://localhost:<port>).
  • Debug (default: false) : Detailed debug messages will be printed to output if true.

API

Constants

Categories

Type: string

  • CategoryAll
  • CategoryMovie
  • CategoryTV
  • CategoryAnime
  • CategoryPorn

Sorts

Type: string

  • SortByDefault
  • SortBySeeders
  • SortByLeechers
  • SortBySize

Providers

Type: models.ProviderInterface

  • SukebeiProvider (Sukebei)
  • ThePirateBayProvider (The Pirate Bay)
  • LimeTorrentsProvider (LimeTorrents)
  • Torrentz2Provider (Torrentz2)
  • RarbgProvider (RARBG)
  • LeetxProvider (1337x)
  • YifyProvider (YIFY)

AllProviders [...]models.ProviderInterface -- an array that holds all the above providers

Functions

func ListProviderResults(provider models.ProviderInterface, query string, count int, category string, sortBy string) []models.Source

ListProviderResults lists all results queried from this specific provider only. It sorts the results and returns at most {count} results.

Example
sources := torrodle.ListProviderResults(torrodle.LeetxProvider, "the great gatsby", 50, torrodle.CategoryMovie, torrodle.SortBySeeders)

func ListResults(providers []interface{}, query string, count int, category string, sortBy string) []models.Source

ListResults lists all results queried from all the specified providers. It sorts the results after collected all the sorted results from different providers. Returns at most {count} results.

Example

You can pass in a slice of strings which are the names of the providers.

sources := torrodle.ListResults([]string{"1337x", "RARBG"}, "the great gatsby", 50, torrodle.CategoryMovie, torrodle.SortBySeeders)

You can also directly import torrodle/models package and pass in a slice of the provider interfaces.

sources := torrodle.ListResults([]models.ProviderInterface{torrodle.LeetxProvider, torrodle.RarbgProvider}, "the great gatsby", 50, torrodle.CategoryMovie, torrodle.SortBySeeders)

Models

Source

// Source provides informational fields for a torrent source.
type Source struct {
    From     string // which provider this source is from
    Title    string // title name of this source
    URL      string // URL to the info page of this source
    Seeders  int    // amount of seeders
    Leechers int    // amount of leechers
    FileSize int64  // file size of this source in bytes
    Magnet   string // magnet uri of this source
}

Provider

// ProviderInterface is an interface that provides all the methods a `Provider` struct type has.
type ProviderInterface interface {
    String() string // stringer
    Search(string, int, CategoryURL) ([]Source, error) // search for torrents with a given (query, count, categoryURL) -> returns a slice of sources found
    GetName() string // GetName returns the name of this provider.
    GetSite() string // GetSite returns the URL (site domain) of this provider.
    GetCategories() Categories // GetCategories returns the categories of this provider.
}
// Provider is a struct type that exposes fields for the `ProviderInterface`.
type Provider struct {
    Name       string
    Site       string
    Categories Categories
}

Available Providers

1337x *

torrodle/providers/leetx

RARBG *

torrodle/providers/rarbg

The Pirate Bay *

torrodle/providers/thepiratebay

YIFY *

torrodle/providers/yify

Torrentz2

torrodle/providers/torrentz

LimeTorrents

torrodle/providers/limetorrents

Sukebei

torrodle/providers/sukebei

(* recommended provider)

More providers comming soon !

OpenSubtitles

The only provider for providing movies / tv series subtitles.

API client powered by oz/osdb.

Available languages:

  1. English eng
  2. Chinese (simplified) chi
  3. Chinese (traditional) zht
  4. Arabic ara
  5. Hindi hin
  6. Dutch dut
  7. French fre
  8. Russian rus
  9. Portuguese por

Credit

This project is inspired by @Fabio Spampinato's cliflix.

Torrent streaming technique refined from @Sioro Neoku's go-peerflix.


Made with ❤️︎ by a1phat0ny
under MIT license

About

⚡️ A magnet link scraper for streaming videos (movies, tv shows, anime, porn) along with subtitles.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%