notflix icon indicating copy to clipboard operation
notflix copied to clipboard

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

Open KrzysiekKropka opened this issue 8 months ago • 0 comments

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.

KrzysiekKropka avatar Jun 18 '24 21:06 KrzysiekKropka