Bugswriter / notflix

Notflix is a shell script to search and stream torrent.
GNU General Public License v3.0
1.9k stars 176 forks source link

uses the pirate bay instead #85

Open ricky-aufvaa opened 2 years ago

ricky-aufvaa commented 2 years ago

This uses less lines of code(less than 4 hahah) and also uses the pirate bay.

ricky-aufvaa commented 2 years ago

Take this as an example which uses lesser lines and does not require to download url.html which is not required and can be replaced with a variable.

#!/bin/bash
QUERY=$(printf '%s' "$*" | sed 's/ /\%20/g')
MAGNET=$(curl -s "https://thepiratebay.party/search/$QUERY/1/99/0" -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0' | grep -Eo "magnet\:\?[a-zA-Z0-9]{2}=[a-zA-Z0-9]{3}:[a-zA-Z0-9]{4}:[a-zA-Z0-9?%-' '=.+;-]*"| head -n 1)
peerflix -l -k $MAGNET

Thank you! This is very useful. I understand that my script is very redundant. Since it's the first script I've written.