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

VLC "invalid URL error" when attempting to play an HTTPS stream with square brackets #187

Closed
rightpad opened this issue May 27, 2018 · 9 comments

Comments

@rightpad
Copy link

Example url:
https://example.com/Movies/Sample Movie (2018) - [1080p].mkv

Playing this URL via "Open Network Stream" in VLC's GUI without syncplay is fine. But when attempting to open this URL via Syncplay, VLC complains the URL is invalid. mpv does not have this issue, I didn't test other players besides VLC and mpv. Renaming the file on the server (and thus the stream URL) by removing the square brackets fixes the problem.

I'm on Windows with Syncplay 1.5.3

@albertosottile
Copy link
Member

I tried to reproduce this on Windows 7 x86 with VLC 2.2.4 and Syncplay 1.5.3, with no luck. To be clear, I put the URL in the 'File' -> 'Open media stream URL' dialog of Syncplay. Perhaps someone else can try to reproduce this on other windows systems.

@rightpad
Copy link
Author

I am on Win10 x64 using VLC 3.0.2 x64. I just tested both adding the URL to the shared playlist and using the 'Open media stream URL' dialog. This is happening for the other users using my syncplay server with the similar system specs. Syncplay server is running on a Fedora 28 machine if that matters.

@albertosottile
Copy link
Member

Reproduced on Win10 x64 with VLC 3.0.0. Apparently, this restricts this bug to something that affects only VLC 3.x.

@albertosottile
Copy link
Member

albertosottile commented May 29, 2018

EDIT: to be honest, I get the same error (invalid URL) using VLC 3.0.0 and 3.0.2 alone, even without Syncplay. Can you check in the VLC debug logs what URL Syncplay is passing to the player in your system? Open Syncplay with VLC, then enable the logs by typing Ctrl + M in VLC and by choosing '2 (debug)' in the verbosity tab in the dialog that pops up. Then attempt to load the URL with [] from Syncplay and post the resulting log here. Thanks

@rightpad
Copy link
Author

Debug log:

lua debug: Path: https://example.com/Movies/Annihilation%20(2018)%20-%20[1080p%20Remux].mkv
main debug: processing request item: Annihilation (2018) - [1080p Remux].mkv, node: Playlist, skip: 0
main debug: rebuilding array of current - root Playlist
main debug: rebuild done - 1 items, index 0
main debug: starting playback of new item
main debug: resyncing on Annihilation (2018) - [1080p Remux].mkv
main debug: Annihilation (2018) - [1080p Remux].mkv is at 0
main debug: creating new input threa
main debug: Creating an input for 'Annihilation (2018) - [1080p Remux].mkv'
main debug: requesting art for new input thread
main debug: using timeshift granularity of 50 MiB
main debug: using timeshift path: C:\Users\peter\AppData\Local\Temp
main debug: `https://example.com/Movies/Annihilation%20(2018)%20-%20[1080p%20Remux].mkv' gives access `https' demux `any' path `example.com/Movies/Annihilation%20(2018)%20-%20[1080p%20Remux].mkv'
main debug: creating demux: access='https' demux='any' location='example.com/Movies/Annihilation%20(2018)%20-%20[1080p%20Remux].mkv' file='\\example.com\Movies\Annihilation (2018) - [1080p Remux].mkv'
main debug: looking for access_demux module matching "https": 15 candidates
main debug: no access_demux modules matched
main debug: creating access: https://example.com/Movies/Annihilation%20(2018)%20-%20[1080p%20Remux].mkv
main debug: looking for meta fetcher module matching "any": 1 candidates
main debug: (path: \\example.com\Movies\Annihilation (2018) - [1080p Remux].mkv)
main debug: looking for access module matching "https": 25 candidates
lua debug: Trying Lua scripts in C:\Users\peter\AppData\Roaming\vlc\lua\meta\fetcher
lua debug: Trying Lua scripts in c:\program files\videolan\vlc\lua\meta\fetcher
lua debug: Trying Lua playlist script c:\program files\videolan\vlc\lua\meta\fetcher\tvrage.luac
main debug: no access modules matched
lua debug: skipping script (unmatched scope) c:\program files\videolan\vlc\lua\meta\fetcher\tvrage.luac
main debug: dead input
main debug: no meta fetcher modules matched
main debug: looking for art finder module matching "any": 2 candidates
main debug: changing item without a request (current 0/1)
main debug: nothing to play
lua debug: Trying Lua scripts in C:\Users\peter\AppData\Roaming\vlc\lua\meta\art
lua debug: Trying Lua scripts in c:\program files\videolan\vlc\lua\meta\art
lua debug: Trying Lua playlist script c:\program files\videolan\vlc\lua\meta\art\00_musicbrainz.luac
lua debug: skipping script (unmatched scope) c:\program files\videolan\vlc\lua\meta\art\00_musicbrainz.luac
lua debug: Trying Lua playlist script c:\program files\videolan\vlc\lua\meta\art\01_googleimage.luac
lua debug: skipping script (unmatched scope) c:\program files\videolan\vlc\lua\meta\art\01_googleimage.luac
lua debug: Trying Lua playlist script c:\program files\videolan\vlc\lua\meta\art\02_frenchtv.luac
lua debug: skipping script (unmatched scope) c:\program files\videolan\vlc\lua\meta\art\02_frenchtv.luac
lua debug: Trying Lua playlist script c:\program files\videolan\vlc\lua\meta\art\03_lastfm.luac
lua debug: skipping script (unmatched scope) c:\program files\videolan\vlc\lua\meta\art\03_lastfm.luac
main debug: no art finder modules matched

@albertosottile
Copy link
Member

albertosottile commented May 30, 2018

I can't see the error in this log, maybe you need to scroll further down or you could reduce the log verbosity to 1 or 0 and then attempt again to find why VLC is complaining. For what it's worth, the URL seems correctly encoded in the first line. Thanks again.

@Et0h
Copy link
Contributor

Et0h commented May 30, 2018

Try http://syncplay.pl/syncplay_v1.5.3_vlcbracketfix.zip (portable build of Syncpluy) and let me know if it fixes the issue.

The change I made was to remove [] from line 148 of vlc.py.

- fileURL = urllib.quote(fileURL, safe="%/:=&?~#+!$,;'@()[]*")
+ fileURL = urllib.quote(fileURL, safe="%/:=&?~#+!$,;'@()*")

@albertosottile
Copy link
Member

albertosottile commented May 31, 2018

This solves the issue by encoding the square brackets, even though that should not be necessary. Tested this on Windows with both VLC 2.2.8 and 3.0.3 and it works. However, I am still unable to open a URL formatted as the one reported in this issue (https://example.com/Movies/Sample Movie (2018) - [1080p].mkv) from VLC 3.0.x, both attached to Syncplay and alone. This is probably related to this VLC bug: https://trac.videolan.org/vlc/ticket/20384

@Et0h
Copy link
Contributor

Et0h commented Jun 9, 2018

Okay, issue should be solved now - thanks bringing it to our attention. The fix will be in the next release, but in the meantime you can use http://syncplay.pl/syncplay_v1.5.3_vlcbracketfix.zip

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

4 participants