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

Add a custom protocol handler #26266

Open
Tank-Missile opened this issue Aug 6, 2020 · 1 comment
Open

Add a custom protocol handler #26266

Tank-Missile opened this issue Aug 6, 2020 · 1 comment
Labels

Comments

@Tank-Missile
Copy link

@Tank-Missile Tank-Missile commented Aug 6, 2020

Checklist

  • I'm reporting a feature request
  • I've verified that I'm running youtube-dl version 2020.07.28
  • I've searched the bugtracker for similar feature requests including closed ones

Description

Windows, Linux, and Mac support the creation of custom protocol handlers to launch applications from within other applications, namely web browsers. For instance, Steam uses a protocol handler that websites can use to allow users to run Steam commands. This third party tool allows calling youtube-dl from the protocol URI ytdl://, but it only supports Windows. For Linux, adding a protocol handler is very trivial thanks to the XDG standard. You would simply create a .desktop file that xdg-open would use. This would be useful for browser extensions that could utilize this protocol to make video downloads simpler. As for Mac, I'm not quite sure how it would be done.

[Desktop Entry]
Exec=youtube-dl %u
MimeType=x-scheme-handler/ytdl;
Name=youtube-dl
NoDisplay=true
Type=Application
@Tank-Missile Tank-Missile added the request label Aug 6, 2020
@Tank-Missile Tank-Missile changed the title Add a custom protocol handler for Windows and Linux Add a custom protocol handler Aug 7, 2020
@Tank-Missile
Copy link
Author

@Tank-Missile Tank-Missile commented Aug 7, 2020

For KDE Plasma users, just a fair warning that kde-open5 (a wrapper around xdg-open I guess) has a bug that eats the second colon. For instance, if you pass ytdl://https://<youtube-url>, it would actually pass as ytdl://https//<youtube-url>. To avoid this issue, simply pass it as ytdl:https://<youtube-url> (no slashes after the protocol). Now we can hopefully avoid future bug reports of the protocol not working. More details here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.