murrty / youtube-dl-gui

Download/Convert videos from websites without needing to learn command line
GNU General Public License v3.0
427 stars 45 forks source link

chrome nativeMessaging #178

Closed qzmtch closed 1 year ago

qzmtch commented 1 year ago

hi, really like your graphical interface, I can ask two question? does your program support nativeMessaging? https://developer.chrome.com/docs/apps/nativeMessaging/ and if not, can you add code so that those who write extensions can write a browser extension and send links directly from there to the program? if you decide to add it, it's better to support sendNativeMessage, because you don't need a persistent connection, thanks https://developer.chrome.com/docs/extensions/reference/runtime/#method-sendNativeMessage

I really want not to write the shit code myself, but to use sending messages from the browser directly to the gui that you like 😊 and it would also be nice to show the download process after sending the link to the program as in idm

murrty commented 1 year ago

This sounds like another type of protocol handling.

There is work into using a protocol "ytdlgui" (currently still being worked on) which needs to be installed to the system. I don't remember if the current version has it since I'm using a different build, but if it does you should be able to install it through the Settings under the Downloads tab.

Currently, the way it works is one of these arguments need to be passed:

v for a video download a for an audio download c for a custom download (using the last used custom arguments)

followed by the URL to the media that will be downloaded, as an example

ytdlgui:v "https://youtube.com/watch?v=..."

Using "quotes" for the URL is highly preferred because protocol support can be funny in many many ways. I was going to add a YouTube userscript for convenience, but I am not really bothering to try anymore since I keep hitting snags every time I try.

qzmtch commented 1 year ago

i think protocols are worse than sending messages to native client for protocols, you still need to write browser extensions to add links to the page that you click on, and also write entries to the registry for them the same for sending messages to the native client, only when the browser starts it looks in the registry for a json that creates a process for the extension, and the extension has the ability to keep a permanent connection like ping pong or just send messages like void, the second is preferable in this case and a link with some additional information is simply sent from the extension, and already inside the application a message is received and commands are launched I'm not a programmer, but I think it's better, and since you already have protocols, then if they work well, then let them be, and if they can be rewritten to receive messages, then you can rewrite them

there is such an extension, it is no longer in the store https://www.upload.ee/files/15185701/Open_in_external_app.7z.html inside original crx and unpacked extension in the unpacked folder there is a folder Launcher it contains an executable file for launching other programs, json for adding to the registry and two bat files for writing and deleting json to the registry but the extension itself has a problem, it transmits links well, but it’s impossible to immediately register launch commands there, only if you call the bat file with commands on the computer it would not be bad if your gui could receive messages from extensions immediately without an additional exe and in the extensions it was possible to immediately make a choice of requests previously saved in the gui I repeat if the protocols seem better to you, then let them be, I'm not a programmer, but later I'll try to add this to the fork of your gui if I figure out how, while I mainly use the usual yt-dlp, and gui as an additional application, but I already want to make it the main one πŸ˜‰

qzmtch commented 1 year ago

install it through the Settings under the Downloads tab

there is a button, but after pressing the protocol is not written to the registry

murrty commented 1 year ago

I don't really think this is something I'm going to worry about implementing now. I feel like it's the same thing with some more work to be done.