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

mpv: fix WebVTT subtitles #255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fishman
Copy link

@fishman fishman commented Apr 3, 2023

The subtitles are passed separated by ':' as a result it will consider
https and // to be different files and therefore failing to load.

The subtitles are passed separated by ':' as a result it will consider
https and // to be different files and therefore failing to load.
@justfoolingaround
Copy link
Owner

Good catch. However, can you please see an alternative (maybe a separator character changing argument for mpv)?

Else, I'd also have to include a proper URL parser so that : within the URL get auto changed into %3A. Not to mention even basic authorization may have issues, i.e. https://user:[email protected]/.../subtitles.vtt.

@fishman
Copy link
Author

fishman commented Apr 4, 2023

Why would you need a url parser? I have tried this and it works. Looking through the mpv man page, I'm not sure that the colon can be changed. The doc just says seperator is : for unix and ; for windows. I assume that that's a separator that comes from ffmpeg.

@justfoolingaround
Copy link
Owner

Why would you need a url parser?

There would be cases where there are : in the URL, i.e. http://cdn.xyz.com/0:/One Piece Red.vtt. Not an ignore-able case. Furthermore, the project is already aware of the Windows and UNIX differences. The part separators are conveniently put in a variable.

The changes I've considered right now would be to escape any ; on Windows and : on UNIX.

@fishman
Copy link
Author

fishman commented Apr 5, 2023

http://cdn.xyz.com/0:/One Piece Red.vtt - this case should work just fine. And semicolons are reserved and not normally allowed in URLs, so you don't really have to worry about the windows case. If it really doesn't work on windows, then making this fix unix only should be enough. python's popen parameters are below

mpv "https://tc-1.boocdn.net/_v6/b96c32be4a0bac39badfebe38db85f154a35bc042db22d64ef78f66cc4cb3ad107ad85b20a5948dbfa847c2e8006089446c20302bf9bf223cdeac49fdcc3f0b071c444d7295f077b5fe72dd973e71b7e3c64a6bdc9d09608c60478df18f5e10b8d81f1ff8c9f5969ca4fb88d63c56ba2b9f917b1daef3fe6628c25d12c5a0456/master.m3u8" --sub-files="https\://cc.zorores.com/64/c7/64c729be0eed4c52c25603fee3bc77a9/64c729be0eed4c52c25603fee3bc77a9.vtt."

@justfoolingaround
Copy link
Owner

Oof, this also does not account for other protocols other than https but I suppose that is fixable.

@fishman
Copy link
Author

fishman commented Jun 18, 2023

Of course it does, mpv doesn't care what protocol you use. mpv uses ":" as delimiter for options. It comes from ffmpeg. So it doesn't matter what protocol you use for the subs with mpv. The delimiter is ALWAYS ":".

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

Successfully merging this pull request may close these issues.

2 participants