diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-16 21:32:08 +0200 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2023-04-16 21:32:08 +0200 |
commit | 31a6dbf6c586c45fe51957c2910cb1908d9e2c14 (patch) | |
tree | 5f0bcebb7e81304ba94337e0a760ad1268d7c960 /bin/extra | |
parent | e8fbc3a1652f74099e52ef94190cbcca064aa859 (diff) |
added 1xsearch
Diffstat (limited to 'bin/extra')
-rwxr-xr-x | bin/extra/1xsearch | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/extra/1xsearch b/bin/extra/1xsearch new file mode 100755 index 0000000..a248d38 --- /dev/null +++ b/bin/extra/1xsearch @@ -0,0 +1,20 @@ +#!/bin/sh + +# dependencies +which pup > /dev/null || + exit 1 + +test -z "${query:=$1}" && + query="$(cat /dev/stdin)" + +url="https://1337x.to" +query="$(echo "$query" | tr ' ' '+' )" +result="$(curl -s "$url/search/$query/1/" | + pup -p 'a attr{href}' | + grep "^/torrent" | + head -n 1)" +# result contains / as first char +curl -s "$url$result" | + pup -p 'a attr{href}' | + grep "^magnet:" | + head -n 1 |