Multi-threaded CLI torrent scraper for displaying searched for magnet links; tailored for use with plex & ssh.

Overview

magnetfinder

Multi-threaded CLI torrent aggregator; scrapes torrent results from multiple websites and delivers them into a table in your terminal!

Supported Websites:

  • nyaa
  • piratebay
  • YTS

Supported torrent client for autodownloads:

  • deluge-console
  • transmission-cli

Usage

Running magnetfinder without any arguments will launch interactive mode, prompting for similar information set by flags.

Flags/Arguments

-q, --query <query> search query to use
-n, --nyaa scrape nyaa for torrents
-p, --piratebay scrape piratebay for torrents
-y, --yts get torrents from YIFY/YTS
-a, --all scrape all available websites together
-d, --download autodownload the torrent(s) selected
--depth <depth> specifies how many pages to search through for each website, default is 1
--dir <directory> directory to download torrent if autodownload was toggled
--sort <seeds/size> allows you to specifiy if the torrent table is sorted by seeders or size
--proxy <proxy url> allows you to set a proxy to use when making web requests to torrent websites & api
--show <num> truncate list of torrents displayed by the number argument given
--no-interactive displays all torrents with magnet directly without interacting (--show is useful here)

Configuration

Settings.toml (for setting default behavior, such as download directories & autodownload) is located in an OS specific directory:
~/.config/magnetfinder/ on Linux
/AppData/Roaming/magnetfinder on Windows
/Library/Application Support/magnetfinder/ on macOS

Installation

First install rust if you haven't already: https://www.rust-lang.org/tools/install

From Cargo/Crate: cargo install magnetfinder

From Source:

  • git clone https://github.com/bleusakura/magnetfinder.git then cargo build --release
  • After building, the binary will be located in ./target/release/, which can then be moved elsewhere.

You can also decide to skip compiling and download a binary from the releases section

Comments
  • Proxy support

    Proxy support

    Hi! I think it would be nice to support proxies, since torrent trackers are blocked in some countries. I haven't look at your code, but Cargo.toml indicates that you use reqwest, which does support proxies. I would start from socks, since it allows one to use tor. Do you need help with that?

    opened by teenjuna 4
  • request to disable downloads directory

    request to disable downloads directory

    > magnetfinder -aq 'big buck bunny'
    Error getting downloads directory, falling back to home directory
    

    I want to use this programatically to grab magnet links for specfic matches

    opened by balupton 3
  • Feature request: Allow other download options

    Feature request: Allow other download options

    It would be great to download magnets for download at a later time, particularly for those using unsupported clients - like transmission etc. I will try to take a crack at this...

    opened by alphastrata 2
  • no result error should be stderr

    no result error should be stderr

    no idea if this is correct, first line of rust code I've written

    the reason we want this is so that doing magnet="$(magnetfinder --no-interactive --show 5 -aq 'asdlkasldkaslkdaslkdasd')" has magnet='' instead of the error message

    opened by balupton 1
  • unable to use programatically

    unable to use programatically

    The following bash code does not provide the prompt, causing it to just hang

    m="$(magnetfinder -aq 'big buck bunny')"
    

    Everything besides the magnet result should be outputted to /dev/tty or /dev/stderr instead of stdout. Perhaps https://docs.rs/ttyecho/0.1.2/ttyecho/ will help.

    That said, providing #8 will work around this.

    opened by balupton 1
  • request for no interactive mode

    request for no interactive mode

    would be good to have an option like --no-interactive to have the results only be the name, then a tab character, then the magnet link, e.g.

    > magnetfinder -aq 'big buck bunny'
    big-buck-bunny-NTSC.iso	magnet:?xt=urn:btih:FC84B941DC640BE59C90D7AB58819D50EDCFF906&dn=big-buck-bunny-NTSC.iso
    Big Buck Bunny 480p (x264, he-aac)	magnet:?xt=urn:btih:05D51D7153228E08D94F850E5D2CE0A9E764752E&dn=Big+Buck+Bunny+480p+%28x264%2C+he-aac%29
    

    would also be good for a paramater to specify how many results/rows should be returned

    opened by balupton 1
  • if no results are returned, it enters an invalid state

    if no results are returned, it enters an invalid state

    > magnetfinder -aq 'asdklasdklasdklasdksadlkasdlksaldkasldkasldkasdasdkasldkasld'
    Error getting downloads directory, falling back to home directory
    ╭───┬──────┬──────┬───────╮
    │ # ┆ Name ┆ Size ┆ Seeds │
    ╞═══╪══════╪══════╪═══════╡
    ╰───┴──────┴──────┴───────╯
    Type 'n' to display 20 more torrents, or select torrent(s) by #:
    

    It should not be interactive if no results are returned.

    opened by balupton 1
  • Settings.toml changes to improve usability

    Settings.toml changes to improve usability

    I suggest adding the following to Settings.toml such at a query like

    magnetfinder --all --depth 10 --show 100 -q "arch linux iso" can be reduced to magnetfinder "arch linux iso"

    • piratebay = "true"
    • nyaa = "true"
    • yts = "true"
    • depth = 10
    • show = 100
    • proxy = "some_proxy_value"

    I figure I can do all this with aliases, but it would be nice to have it as part of the config.

    opened by carneeki 0
  • Library version

    Library version

    I was checking out crates that relate to searching torrents and apparently magnetfinder is leagues ahead of everything else. I especially like that it's available as a binary since this allows for easy interoperability from programs in other languages, and I do think this is much better than having only library bindings, however I believe it would be a lot better to have the option of using it as a library when programming in Rust, especially considering how much easier it would be to deal with all the types and validations and stuff.

    As it stands, the Readme doesn't even mention the possibility of using this as a Library, and from what little code I skimmed through it seems there were no plans to have this work as anything other than a CLI program, but what I've seen also indicates that, although there a few prints here and there, there are actually not that many places in the code that depend on user interaction, and this suggests that it may not be that hard to isolate such interactions from the code that actually deals with the provides, making it more straightforward to use this as a library in other Rust projects.

    Though, obviously, there's a need to decide on how useful such changes would be and whether it'd be worth doing such changes, but that's not for me to decide so I just came to point it out.

    opened by frnco 1
  • Make installation easier by providing prebuilt binaries+ installation script

    Make installation easier by providing prebuilt binaries+ installation script

    The binaries can be automatically built and published via a GitHub action whenever a new git tag is pushed to this repository. I also think it might be convenient to have a install.sh script that downloads the latest binary and places it in /usr/local/bin.

    These files could be used as a reference if needed:

    • https://github.com/ducaale/xh/blob/master/.github/workflows/release.yaml
    • https://github.com/ducaale/xh/blob/master/install.sh
    opened by ducaale 1
Owner
null
😎 A CLI tool for fetching data and displaying it nicely

?? A CLI tool for fetching data and displaying it nicely. (The neofetch for remote data fetching)

Milo 6 Aug 24, 2022
CLI tool for displaying table

tv Format json into table display $ cat test.json [ { "name": "test", "age": 10, "lang": "ja" }, { "name": "uzimaru", "age":

uzimaru0000 318 Nov 17, 2022
A ln scraper to read light novels and watch anime in your terminal (Written in rust)

Readme Table of content Why use kami Dependencies Install Linux/mac Windows Honorable mentions Why use kami Well its a fast and easy way to watch anim

mrfluffy 26 Nov 24, 2022
Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim.

cat.nvim Failed experiment in downloading random cat image, turning it into ascii and displaying it in Neovim. Failed as I realized far too late, that

James Vero 4 Aug 5, 2022
A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault

vaultssh A small CLI wrapper for authenticating with SSH keys from Hashicorp Vault vaultssh is a small CLI wrapper for automatically fetching and usin

Joshua Gilman 48 Nov 2, 2022
Akamai Krypton CLI and SSH Agent (v2)

Akamai "Krypton" FIDO2 SSH Agent and CLI The akr command line utility is Akamai's "Krypton" SSH Agent, the successor to kr which works exclusively wit

Akamai 52 Nov 18, 2022
fixred is a command line utility to fix outdated links in files with redirect URLs.

fixred fixred is a command line utility to fix outdated links in files with redirect URLs. Installation fixred is installed via cargo package manager.

Linda_pp 35 Aug 6, 2022
Store your transfer.sh links, so you can remember them later and know when they will expire, but now written in Rust.

Transfer.sh helper Rusted The idea of the script is to store your transfer.sh links and simplify its usage, so you can remember them later and know wh

Reinaldo Rozato Junior 9 Nov 14, 2022
A Rust synchronisation primitive for "Multiplexed Concurrent Single-Threaded Read" access

exit-left verb; 1. To exit or disappear in a quiet, non-dramatic fashion, making way for more interesting events. 2. (imperative) Leave the scene, and

Jonathan de Jong 0 Dec 5, 2021
CarLI is a framework for creating single-command and multi-command CLI applications in Rust

CarLI is a framework for creating single-command and multi-command CLI applications in Rust. The framework provides error and IO types better suited for the command line environment, especially in cases where unit testing is needed.

Kevin Herrera 3 Jan 21, 2022
🦴🖥️ // An ssh manager

?? ??️ ssh-man ssh-man is an SSH manager. I often forget the credentials and IPs to servers I frequently SSH into so Im making ssh-man to help me reme

mellowmarshe 4 Dec 9, 2021
1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel

massh 1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel. The binary crates are CLI and GUI "frontends" for the li

null 2 Oct 16, 2022
FastSSH is a TUI that allows you to quickly connect to your services by navigating through your SSH config.

Connect quickly to your services ?? FastSSH is a TUI that allows you to quickly connect to your services by navigating through your SSH config. Instal

Julien 82 Nov 15, 2022
This PAM module provides ssh-agent based authentication

PAM-RSSH This PAM module provides ssh-agent based authentication. The primary design goal is to avoid typing password when you sudo on remote servers.

Yuxiang Zhang 18 Nov 18, 2022
A Rust-based shell script to create a folder structure to use for a single class every semester. Mostly an excuse to use Rust.

A Rust Course Folder Shell Script PROJECT IN PROGRESS (Spring 2022) When completed, script will create a folder structure of the following schema: [ro

Sebastián Romero Cruz 1 Apr 10, 2022
Requestty - An easy-to-use collection of interactive cli prompts inspired by Inquirer.js.

Requestty requestty (request-tty) is an easy-to-use collection of interactive cli prompts inspired by Inquirer.js. Easy-to-use - The builder API and m

null 152 Nov 17, 2022
Multi-Architecture Code Emission Library

macel Multi-Architecture Code Emission Library (macel) is a library which implements a low-level intermediate representation meant to expose on machin

merry 11 Oct 27, 2021
Show unused code from multi-crate Rust projects

Warnalyzer Remove unused code from multi-crate Rust projects. The dead_code lint family of rustc is limited to one crate only and thus can't tell whet

null 75 Nov 18, 2022
Concurrent and multi-stage data ingestion and data processing with Rust+Tokio

TokioSky Build concurrent and multi-stage data ingestion and data processing pipelines with Rust+Tokio. TokioSky allows developers to consume data eff

DanyalMh 27 Nov 20, 2022