Skip to content

Latest commit

 

History

History
173 lines (144 loc) · 5.26 KB

README.md

File metadata and controls

173 lines (144 loc) · 5.26 KB

ny-cli

A tool which search magnet links and stream it with @meteor314/stream from nyaa.si

How does this work?

This is a shell script. It scape Nyaa and get the magnet link. After this it use peerlix to stream the video from magnet link. For scraping script use simple gnu utils like sed, awk, paste, cut.

Requirements

You need NPM. You can follow this tutorial if you don't have node alreday installed.

  • node - Installation of Node.js on Linux.
  • If you are using Windows or Mac OS, you can directly download from nodejs.org/ here.
  • stream - A tool to stream torrent.
npm install @meteor314/stream -g 

You also need to install mpv. You can install it on Arch

sudo pacman -S mpv

or in debian

sudo apt-get install mpv

Installation

Linux

cURL

cURL ny-cli to your $PATH and give execute permissions.

cd /tmp
sudo curl -sL "https://raw.githubusercontent.com/meteor314/ny-cli/master/ny-cli" -o /usr/local/bin/ny-cli
sudo chmod +x /usr/local/bin/ny-cli && sudo npm install @meteor314/stream -g

Mac OS

git clone "https://github.com/meteor314/ny-cli.git" && cd ./ny-cli
cp ./ny-cli "$(brew --prefix)"/bin 
cd .. && rm -rf ./ny-cli

Android

Install termux and Install mpv-android And you can paste this command on termianal,Before continue, make sure that termux is up to date with this command. Termux installation via play store does not work, because the software no longer receives updates in this platform.

DON'T FORGOT TO GIVE TERMUX FILE MANAGE ACCESS.

pkg upgrade && pkg update

And just copy and paste theses commands:

pkg i nodejs 
npm i @meteor314/stream -g 
pkg i fzf 
pkg i git
git clone https://github.com/meteor314/ny-cli && cd ny-cli
cp ny-cli $PREFIX/bin/ny-cli
echo 'am start --user 0 -a android.intent.action.VIEW -d "$2" -n is.xyz.mpv/.MPVActivity' > $PREFIX/bin/mpv
chmod +x $PREFIX/bin/mpv

Windows

You need scoop to install on your. you can find a complete documentation here. The easiest way to install it is to open powershell (as a simple user) paste this.

Set-ExecutionPolicy RemoteSigned -scope CurrentUser
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
scoop bucket add extras
git clone https://github.com/meteor314/ny-cli.git 
cd ny-cli
scoop install ny-cli
npm install @meteor314/stream -g

How to use ?

Juste write

ny-cli 
# ny-cli -h (for options)
  • To update, just do
ny-cli --update
  • To uninstall, simply remove ny-cli from your $PATH, for example
 sudo rm -rf /usr/local/bin/ny-cli

Issue

If it's not working for the first time, please restart terminal or maybe your system.

Sometime you can get this type of error :

stream: unable to open image 'magnet:?xt=urn:btih:fba17d3e02fe94df607b823afe822bd30efd203f': No such file or directory @ error/blob.c/OpenBlob/3533.
stream: no decode delegate for this image format `' @ error/constitute.c/ReadImage/738.
stream: unable to open image '--path': No such file or directory @ error/blob.c/OpenBlob/3533.
stream: unable to open image '--path': No such file or directory @ error/blob.c/OpenBlob/3533.
stream: no decode delegate for this image format `' @ error/constitute.c/ReadImage/738.
stream: no decode delegate for this image format `' @ error/constitute.c/ReadImage/738.
stream: unrecognized option `-a' @ error/stream.c/StreamImageCommand/306.

This error usually comes after an update. Just reinstall stream with this command in the terminal:

  npm i @meteor314/stream -g

TO DO / WISH LIST

  • [✓] Compatibilty with windows.
  • [✓] Download torrent in a specific folder (with ny-cli -d)
  • [] Send notification after download ( notify-send(?) ) for W10, Mac & Linux.
  • [] Compatibility with mac os.
  • [] Fix bugs with git bash in W10
  • [✓] Make a history of all torrent in ./.cache/history.ini
  • [] Detect files formats, for example, if it is a zip file or .exe just download it, don't try to open with mpv
  • [] add vlc player.
  • [✓] Create a custom node webserver based on webtorrent for a better compatibility.

License

This project is licensed under Apache.

Please read Disclaimer.md before any usage. Happy torrent :)

Just keep in mind that : "Video playing time may vary depending on torrent availability, or may not play if torrent is old and there are no seeders."

If you encounter a bug, don't hesitate to open an issue, and any help will be welcome ^_^