Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add a custom protocol handler #26266
Comments
|
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. |
Checklist
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.