Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script is not working right now #88

Open
albtronics opened this issue Mar 8, 2022 · 4 comments
Open

Script is not working right now #88

albtronics opened this issue Mar 8, 2022 · 4 comments

Comments

@albtronics
Copy link

Usage: /usr/bin/node /usr/local/bin/peerflix magnet-link-or-torrent [options]
Bug

@GhoulBoii
Copy link

1337x.wtf is no longer accessible. If you go to the site from a web browser, it gives a nginx page and curling the site won't give your search results. Right now, I am using ricky-aufvaa's script that he sent in one of the pull requests which uses The Pirate Bay rather than 1337x.

The script (Credits to #85)

#!/bin/sh

name=$(printf '%s' "$*" | sed 's/ /\%20/g')
curl -s -o url.html https://thepiratebay.party/search/$name/1/99/200
magnet=$(cat url.html|grep -E 'magnet\:\?'|sed 's/href\=/ /g'|awk '{print $2}'|sed 's/"/ /g'| head -n 1|sed 's/ //g')
peerflix -l -k $magnet

@pitsi
Copy link

pitsi commented Feb 16, 2024

I was about to open a new issue but I came accross yours, so I comment here.
All 6 of the site's official domains are now under cloudflare protection, which means that curl now scrapes the "verify you are human" page that shows up before entering each domain. This makes the search fail, so the movie parameter is wrong, which makes the magnet parameter fail too, so peerflix at the end has no magnet link to use and pops up that error.

@pitsi
Copy link

pitsi commented Feb 18, 2024

Behold the lamest patch ever! Changing 1337x to its copycat, 1377x, makes the script work again because the second one has no cloudflare protection. Full script

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

Proof that it works, by using the -x parameter to run it and an echo at the end instead of peeflix, just to prove that the magnet link is what peerflix actually gets

$ bash -x notflix deadpool
++ printf %s deadpool
++ tr ' ' +
+ query=deadpool
++ curl -s https://www.1377x.to/search/deadpool/1/
++ grep -Eo 'torrent\/[0-9]{7}\/[a-zA-Z0-9?%-]*/'
++ head -n 1
+ movie=torrent/3162062/Deadpool-2-2018-WEBRip-720p-YTS-YIFY/
++ curl -s https://www.1377x.to/torrent/3162062/Deadpool-2-2018-WEBRip-720p-YTS-YIFY/
++ grep -Po 'magnet:\?xt=urn:btih:[a-zA-Z0-9]*'
++ head -n 1
+ magnet='magnet:?xt=urn:btih:00102086B401F8CE049BE55410FF9C69D87BB740'
+ echo 'magnet:?xt=urn:btih:00102086B401F8CE049BE55410FF9C69D87BB740'
magnet:?xt=urn:btih:00102086B401F8CE049BE55410FF9C69D87BB740

@pitsi
Copy link

pitsi commented Mar 26, 2024

The main domain of 1337x no longer pops that cloudflade verification/protection, so the script works with it again and the above patch is redundant. Proof

$ bash -x notflix deadpool
++ printf %s deadpool
++ tr ' ' +
+ query=deadpool
++ curl -s https://www.1337x.to/search/deadpool/1/
++ grep -Eo 'torrent\/[0-9]{7}\/[a-zA-Z0-9?%-]*/'
++ head -n 1
+ movie=torrent/3163584/Deadpool-2-2018-BluRay-1080p-YTS-YIFY/
++ curl -s https://www.1337x.to/torrent/3163584/Deadpool-2-2018-BluRay-1080p-YTS-YIFY/
++ grep -Po 'magnet:\?xt=urn:btih:[a-zA-Z0-9]*'
++ head -n 1
+ magnet='magnet:?xt=urn:btih:E774B886539A3F7EBF1FFE7CD01A107F73298248'
+ echo 'magnet:?xt=urn:btih:E774B886539A3F7EBF1FFE7CD01A107F73298248'
magnet:?xt=urn:btih:E774B886539A3F7EBF1FFE7CD01A107F73298248

The other 5 official domains of 1337x still have that cloudflare verification/protection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants