Closed basxto closed 6 years ago
And pushed a fix for this too on the develop branch. It works with your example...do you have other ones to test it with?
and unescaping them
The unescaping part is missing, it would be sufficient to strip any \
, but I think that should only be done with an --unescape
flag.
mpv --no-video --loop https://www.youtube.com/watch\?v\=sTal8O7uMxg
Playing: https://www.youtube.com/watch?v=sTal8O7uMxg
(+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
A: 00:00:09 / 01:11:17 (0%) Cache: 10s+828KB
Exiting... (Quit)
becomes
...
mpv --no-video --loop <URL> [1]
Playing: <URL> [2]
(+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
...
[1] < https://www.youtube.com/watch\?v\=sTal8O7uMxg >
[2] < https://www.youtube.com/watch?v=sTal8O7uMxg
I would have expected
...
mpv --no-video --loop <URL> [1]
Playing: <URL> [1]
(+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
...
[1] < https://www.youtube.com/watch?v=sTal8O7uMxg
Why do you think a \ should only be removed from a URL when an --unescaped flag is passed? The whole idea is to open the URL in browser and \ isn't a legal URL character, so shouldn't they just be stripped out regardless?
https:\\github.com\firecat53\urlscan\
works, even with xdg-open 'https:\\github.com\firecat53\urlscan\'
Firefox and Chromium tend to translate it into https://github.com/firecat53/urlscan/
.
I don’t think it’s a legal url, but it appears that some people can’t distinguish slash and backslash.
Added 'u' to toggle unescaped URLs. Does that work as you envisioned?
This is an feature request Detection of escaped URLs and unescaping them would be neat. Right now lines like
mpv --no-video --loop https://www.youtube.com/watch\?v\=sTal8O7uMxg
get detected ashttps://www.youtube.com/watch