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

Change the grep to allow for 6-digit (or less!) torrent links. #102

Closed KrzysiekKropka closed 4 months ago

KrzysiekKropka commented 4 months ago

Right now the grep command for pulling torrent links from 1337x only allows for torrents that have 7-digit links. It should be:

#!/bin/sh

query=$(printf '%s' "$*" | tr ' ' '+' )
movie=$(curl -s https://1337x.to/search/$query/1/ | grep -Eo "torrent\/[0-9]+\/[a-zA-Z0-9?%-]*/" | head -n 1)
magnet=$(curl -s https://1337x.to/$movie | grep -Po "magnet:\?xt=urn:btih:[a-zA-Z0-9]*" | head -n 1)
peerflix -l -k $magnet

That way older links will be recognized.