noctuid / mpv-peerflix-hook

Stream magnet links in mpv with peerflix
7 stars 0 forks source link

Syntax Error on ( #1

Closed smhmd closed 4 years ago

smhmd commented 4 years ago

Much like the script which this script is based on, parentheses, though permissible in ordinary peerflix and magnet links at large, trip the script. Here's a sample:

magnet:?xt=urn:btih:B764661DE937E0463C9B7CD39EE10F949E507F8D&tr=http%3A%2F%2Fbt4.t-ru.org%2Fann%3Fmagnet&dn=%D0%9C%D0%B0%D1%8F%D0%BA%20%2F%20The%20Lighthouse%20(%D0%A0%D0%BE%D0%B1%D0%B5%D1%80%D1%82%20%D0%AD%D0%B3%D0%B3%D0%B5%D1%80%D1%81%20%2F%20Robert%20Eggers)%20%5B2019%2C%20%D0%A1%D0%A8%D0%90%2C%20%D1%83%D0%B6%D0%B0%D1%81%D1%8B%2C%20%D1%84%D1%8D%D0%BD%D1%82%D0%B5%D0%B7%D0%B8%2C%20%D0%B4%D1%80%D0%B0%D0%BC%D0%B0%2C%20%D0%B4%D0%B5%D1%82%D0%B5%D0%BA%D1%82%D0%B8%D0%B2%2C%20WEB-DLRip%5D%20MVO%20(HDRezka%20Studio)

and here's the errorous output:

$ mpv 'magnet:?xt=...........' # peerflix 'magnet:?xt=...........' works fine, though.
sh: lsof: command not found
[peerflix_hook] Starting peerflix
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `peerflix --remove --quiet --port 8888 --on-listening 'touch /tmp/peerflix-8888.lock' magnet:?xt=urn:btih:B764661DE937E0463C9B7CD39EE10F949E507F8D&tr=http%3A%2F%2Fbt4.t-ru.org%2Fann%3Fmagnet&dn=%D0%9C%D0%B0%D1%8F%D0%BA%20%2F%20The%20Lighthouse%20(%D0%A0%D0%BE%D0%B1%D0%B5%D1%80%D1%82%20%D0%AD%D0%B3%D0%B3%D0%B5%D1%80%D1%81%20%2F%20Robert%20Eggers)%20%5B2019%2C%20%D0%A1%D0%A8%D0%90%2C%20%D1%83%D0%B6%D0%B0%D1%81%D1%8B%2C%20%D1%84%D1%8D%D0%BD%D1%82%D0%B5%D0%B7%D0%B8%2C%20%D0%B4%D1%80%D0%B0%D0%BC%D0%B0%2C%20%D0%B4%D0%B5%D1%82%D0%B5%D0%BA%D1%82%D0%B8%D0%B2%2C%20WEB-DLRip%5D%20MVO%20(HDRezka%20Studio) &'
[peerflix_hook] Waiting for server
[peerflix_hook] Server is up

Seems that the magnet is not properly sandboxed in quotes.

noctuid commented 4 years ago

Yeah, I'm surprised I didn't encounter any links where this was an issue.