News for hackers. Stuff that matters.
Re:Show HN: YouTube-DL GUI Powered by Electron by TeMPOraL on Tuesday July 02, 2019 @03:38AM (#20333009)
Yup. Me too! Did someone make something like this?

The alternative I'm considering is a script for my WM that essentially does "CTRL+L, delay 500ms, CTRL+C, append to a rolling 'to yt-download' list file".

Re:Show HN: YouTube-DL GUI Powered by Electron by Crinus on Tuesday July 02, 2019 @06:04AM (#20333652)
I did something like this a couple of months ago. I wrote a simple firefox extension which adds a button near the url bar which calls youtube-dl to download the current URL on a predefined folder. It needs an intermediate "helper" which is registered via the Windows registry (just make a key for it). All the helper does though is just call youtube-dl.

It sounds complicated but i had never written any firefox addon at all before trying it and it took me less than an hour to write the entire thing just by following the docs. The biggest change was switching from regular firefox to developer edition so i can disable signature checking for addons (the regular firefox doesn't allow that), but so far all that meant is that the red icon globe is now blue and i get more frequent updates.

None of that is available publicly though since it is very configuration-specific - and really all it does is to call 'youtube-dl' - but it is easy to replicate. Also learning to make some "personal" addons might be helpful in the future, similar to how you customize Emacs or Vim.

Re:Show HN: YouTube-DL GUI Powered by Electron by karatchov on Tuesday July 02, 2019 @07:57AM (#20334140)
On firefox/chrome/opera for windows, you can do this easily with "open with" addon +/- owclauncher
Re:Show HN: YouTube-DL GUI Powered by Electron by rakoo on Tuesday July 02, 2019 @03:57AM (#20333090)
I'm always weary about having timers in a script, because it often turns out to not be the correct amount. What about something like:

- bookmark url in a specific "YouTube-dl" folder

- watch tht folder from a daemon

- when the folder changes, do the stuff automatically

I'm sure there's a way to read bookmarks from outside the browser ?

Re:Show HN: YouTube-DL GUI Powered by Electron by TeMPOraL on Tuesday July 02, 2019 @04:41AM (#20333318)
I don't like timers either, but that seems to me the most direct way of exfiltrating the URL of the tab I'm currently looking at. Unfortunately, browsers aren't exactly interoperable.

Bookmarks don't seem that easy to exfil either. Firefox for instance (just checked) stores bookmarks, along with browsing and download history, in an sqlite database, that it keeps locked, so sqlite3 won't read from it. Maybe there's a way to force-read that database, but I haven't figured it out yet.

Here's an alternative idea I might actually go for: a systemd service[0] on my NAS in my home LAN that accepts links over the net and feeds them to youtube-dl. It could maintain a database of links already downloaded to avoid unnecessary redownloads. Then I could use an extension to simply send requests to an URL in my LAN.

My perfect UI would actually have this integrated with the Like button on YouTube. Click Like, it schedules a download. This is because there's plenty of videos that I wanted to get back to after few years, only to discover them gone (account banned, video removed, copyright bullshit, etc.).

--

[0] - Or something. There must be something in systemd that can be used to listen on a port, feed requests from it to a script, and reply with the output?

Re:Show HN: YouTube-DL GUI Powered by Electron by rakoo on Tuesday July 02, 2019 @06:10AM (#20333681)
If you're going to go with Youtube's Like, you should be able to use the API (https://developers.google.com/youtube/v3/docs/videos/list, "my liked videos") and get the results you want there. The advantage of using Youtube's Like is that you can use any player from anywhere to do it.
Re:Show HN: YouTube-DL GUI Powered by Electron by alxlaz on Tuesday July 02, 2019 @05:15AM (#20333434)
This wasn't for youtube-dl, but a long time ago I used to have a somewhat similar system using a simple named pipe. Write the URL to that file, one URL per line; a simple ksh (back then :-) ) script read it on the other end and did its magic. The cool thing about it being that all you had to do was echo $url >> ~/.dl/queue.txt .
Re:Show HN: YouTube-DL GUI Powered by Electron by karatchov on Tuesday July 02, 2019 @08:01AM (#20334170)
There is much direct and easier way to pass a link or the current page's URL to an external program using "open with" browser addon + owclauncher (https ://github.com/mbooga/owclauncher)