akiirui / mpv-handler

A protocol handler for mpv. Use mpv and yt-dlp to play video and music from the websites.
MIT License
262 stars 22 forks source link

feat: add option "subtitle" #36

Closed bpking1 closed 1 year ago

akiirui commented 1 year ago

Is this function for loading third-party subtitles? Is there any example?

bpking1 commented 1 year ago

yes, I want to use this function to load external subtitles for emby/jellyfin. Here is the source code https://github.com/bpking1/embyExternalUrl/blob/main/embyWebAddExternalUrl/embyLaunchPotplayer.js#L242 the emby/jellyfin video external subtitle URL is like "https://embyserver.com/Stream.ass"

akiirui commented 1 year ago

yes, I want to use this function to load external subtitles for emby/jellyfin. Here is the source code https://github.com/bpking1/embyExternalUrl/blob/main/embyWebAddExternalUrl/embyLaunchPotplayer.js#L242 the emby/jellyfin video external subtitle URL is like "https://embyserver.com/Stream.ass"

Ok. but I will edit some variable name to follow the option name of mpv: subtitle -> subfile. Then, you should edit your script.

Thanks.

akiirui commented 1 year ago

Oh, I found a bug. If the value of the parameters have more than one equals mark, mpv-handler will exit with error IncorrectProtocol

Example:

mpv://play/aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g_dj1HZ2tuMmY1ZS1JVQ==/?subfile=aHR0cDovL2V4YW1wbGUuY29tL3N1YnRpdGxlLmFzcw==

Maybe we should enforce URL-SAFE base64 with no padding?

akiirui commented 1 year ago

I will push my changes to your branch tonight, thanks

akiirui commented 1 year ago

Merged, thanks for your work.