
Show HN: YouTube-DL GUI Powered by Electron - mayeaux
https://github.com/mayeaux/videodownloader
======
TeMPOraL
Suggestion to author: allow pasting and downloading more than one link at a
time, and selecting audio/video + desired formats.

Suggestion to everyone else: learn the CLI. Then you can do things like me
last night. My wife collected a list of classical music videos she wants to
play to our kid, and all I did was:

    
    
      youtube-dl -x --audio-format "mp3" --audio-quality 0 -o "%(title)s.%(ext)s" -a music.txt
    

to get the whole list turned into neat and nicely-named MP3s (like "Mozart -
Eine Kleine Nachtmusik, K 525 Allegro.mp3"). Followed by:

    
    
      mp3splt -r *.mp3
    

to trim the silence from both ends.

I do batch downloads like these rarely, roughly once a year (though I expect
it to happen more frequently in the near future). Because of that, I had both
of the above commands stored in my snippets.org file. It's something I
strongly recommend: store off-used CLI calls in your notes/personal wiki. It
beats reinventing the commands a year down the line, or even trying to
remember what tools did you use for that off job.

To preempt comments saying CLI is too hard for regular people: no, it isn't;
they can learn[0], especially if you make them interested by e.g. showing them
how to do batch jobs. But for the sake of the resistant, maybe the author of
this GUI will upgrade it with option for batch downloads and format selection.

\--

[0] - [https://digitalsuperpowers.com/](https://digitalsuperpowers.com/) is a
nice book I read and can recommend. No affiliation, just curiosity, because
the author is a regular HNer.

~~~
Double_a_92
I wish the installation was easier. It is reasonable to explain someone to
write "youtube-dl -x <link>" to download music from youtube...

But having them installing ffmpeg and python, manually copying some exe to a
safe place, and adding that as a enviroment variable really cuts the interest
off.

~~~
r3bl
That's because you're using Windows, which is really, _really_ not designed
with scripts in mind.

Point to Ubuntu in the Microsoft Store. Python is preinstalled. You may need
to install Python's package manager (I'm not sure does it come preinstalled)
with "sudo apt install python3-pip". Install it from Python's package manager
with "pip3 install youtube-dl".

You could technically skip Python's package manager by just doing "sudo apt
install youtube-dl", but updates are slow there, and you really don't want
slow updates with this tool ("pip3 install --upgrade youtube-dl"). I'd argue
that three commands are way easier to explain than installing two binaries and
clicking around far too many times, especially because youtube-dl needs to be
updated on a regular basis in order to work properly.

~~~
Mindwipe
Did you honestly write this down thinking it was remotely any easier?

~~~
r3bl
Then the alternative? Absolutely. The alternative requires finding the latest
version of Python, installing it, modifying the environment path, finding the
binary for youtube-dl, installing it, and only then figuring out how it works.

"Execute these commands only once and then just type youtube-dl
[https://example.com](https://example.com). If something breaks, run this
command to upgrade the script and retry." If the target audience is someone
who you think will feel comfortable doing youtube-dl in a terminal, you may as
well point them to the total of three other commands to set things up.

~~~
TeMPOraL
AFAIR youtube-dl had an .exe build, I remember setting it up for my mom; it
boiled down to unzipping an archive and telling here to drag URLs onto this
icon. And the FFMpeg part; that was a PITA, and something she wouldn't have
guessed on her own.

~~~
r3bl
> Windows exe requires Microsoft Visual C++ 2010 Redistributable Package (x86)
> and does not require Python that is already embedded into the binary.

Yeah, that makes sense. Things have changed since last time I went through
that pain.

------
bspammer
I know this is quite selfish but the more accessible youtube-dl is, the more
likely Google is to see it as a business threat, and the more likely they are
to add some sort of content DRM. Just something to think about

~~~
Udo
I agree, ideally youtube-dl would remain obscure, but YT has been on to it for
a long time. It's somewhat of an arms race right now. I have to update
youtube-dl every few weeks or it will simply stop working.

I would not be entirely suprised if Youtube one day just requires actual
browser DRM to work at all. That would likely break every single smart TV out
there, which is probably the only reason why they haven't yet done it.
However, as they progress further on their path away from amateur content
towards corporate-only content, I'd say there is a decent chance they'll pull
that switch eventually. And die shortly after, of course.

~~~
TeMPOraL
Which also sounds like a good reason to make copies of everything interesting
on YouTube _now_ , while we still can.

~~~
realusername
That's exactly what I do, I make a copy of every video I watch.

~~~
mayeaux
Frankly I wouldn't mind making a browser extension that does exactly that, and
then if you go back to a video you've already downloaded before it plays it
from disk as opposed to from the network. Something I've thought about.

------
Quequau
For me I think the best UI for YT-DL would be in the context menu in Firefox.

This is where I am most often when I see stuff I want to use it on and while I
always already have a terminal window open, it would be nice not to have to
switch windows.

I already have a few different configs and aliases for getting stuff in the
forms I really want. All I need is an even easier way to pass the URL in and
trigger the download.

Being able to right click and get there would please slack me to no end.

~~~
JerwuQu
Most solutions I've seen to this require some kind of external daemon to be
running that takes care of launching ytdl for you (since most web browsers
don't allow extensions to run arbitrary commands.)

Firefox _does_ have support for running this daemon-like-thing for you using
Native messaging[0] though.

youtube-dl-firefox-addon[1] seems to employ this, so perhaps give that one a
try?

[0] [https://developer.mozilla.org/en-US/docs/Mozilla/Add-
ons/Web...](https://developer.mozilla.org/en-US/docs/Mozilla/Add-
ons/WebExtensions/Native_messaging)

[1] [https://github.com/akhilkedia/youtube-dl-firefox-
addon](https://github.com/akhilkedia/youtube-dl-firefox-addon)

~~~
karatchov
Just my 2 cents:

I've been using a combination of firefox/chrome with youtube-dl/mpv+youtube-dl
for a while

This comes very handy for playing high quality youtube videos on low end
machines or downloading audio+/-video directly from youtube.

On the pre-webextension era of firefox/chrome , "open with" addon was the
perfect fit.

Now, a special native messaging app needs to be installed to launch
mpv/youtube-dl

"Open with" addon solved this by a python script (that obviously required
installing python, and few other steps)

I decided to create a new tool to make this step easier and faster on windows:
owclauncher[1]

Basically a lightweight native messaging host for "open with" addon: it is not
running on the background, and only started (and immediatly terminated) by the
browser when passing a command to any other program

You can check and compile the source code or the .bat windows
installer/uninstaller

[1]
[https://github.com/mbooga/owclauncher](https://github.com/mbooga/owclauncher)

------
favorited
Side note: as a daily user, youtube-dl is such a fantastic piece of software.
It's one of those tools which, once you have it, you wonder how you lived
before.

~~~
mayeaux
Agreed! But sometimes going to the CLI everytime is annoying which is in part
why I wanted to build a GUI for it :)

~~~
kabwj
Interesting, since I always have at least one terminal open, but opening an
Electron app takes 5-10 seconds.

------
mwilcox
This seems harder to use than the command line tool

------
heinrichhartman
I predict, that once youtube-dl becomes easy-enough to use for the masses, YT
will shut it down in one way or the other.

The user-facing business model of YT is quite simple:

> You get to see great variety of videos, but have to watch ads every now and
> then.

So from their perspective, youtube-dl allows you to steal the content w/o
giving anything back to either YT or the creator.

To make this fair/sustainable youtube-dl user would either (A) have to
tolerate advertisements in the downloaded video, or (B) pay a fee for each
downloaded video.

I'd prefer for youtube-dl to stays small enough, that we can continue to
freeload a little longer ; )

~~~
theandrewbailey
What if you're downloading videos from someone who has been demonetized?

~~~
heinrichhartman
This is not just about the content creators. Operating YT as a platform is far
from cheap. I bet YT is most concerned about their own bottom-line.

------
dmos62
I use youtube-dl regularly, through mpv. What I'd really like, is a minimal
youtube search, in-terminal or a minimal gui. Then I wouldn't need a browser
to use youtube at all; I dislike having to rev up a 1000mb browser just to
find a video and copy its address.

Actually, now that I think about it, I can't remember if I've tried a text
browser, might be bearable, though images of videos are sometimes helpful.

~~~
severine
> _What I 'd really like, is a minimal youtube search, in-terminal or a
> minimal gui_

It exists! It's called SMTube but don't let the name confuse you, as it works
with a lot of media players, including mpv:

[https://www.smtube.org/en/index](https://www.smtube.org/en/index)

------
joshstrange
I used a modified version of this [0] (modified [1]) running on my home NAS
and an iOS Shortcut to easily be able to "share" any webpage that has a video
on it to a Siri shortcut that makes an API call back to that docker service.
It will automatically download it for me and drop it wherever I have
specified. I can then process those files later. It's a great way for me to
grab a video I want while I'm on my phone. It can even handle queuing of
videos so I can share multiple in a row if I want. I've found it quite useful.

It's no replacement for the CLI but it's better than copying the url, opening
my ssh client, connecting back, navigating to the right spot, running youtube-
dl, waiting for it to finish (this is the worst part), then closing my ssh
app, and moving on with my life.

[0] [https://github.com/hyeonsangjeon/youtube-dl-
nas](https://github.com/hyeonsangjeon/youtube-dl-nas)

[1] [https://github.com/joshstrange/youtube-dl-nas/tree/https-
fix](https://github.com/joshstrange/youtube-dl-nas/tree/https-fix)

------
Lievelingsduif
Why not just use Youtube-dlg?

Does everything it needs to and doesn't require you to use electron.

~~~
mayeaux
I tried to install it but I couldn't install WxPython3 via SourceForge so I
couldn't get the deps to work. Plus the maintainer of that app doesn't care
much for supporting OS X and Linux (basically tells people to just go use
Windows) so I wanted to use Electron where I can package an app for all
platforms.

~~~
geokon
I'm a bit ignorant of the details b/c I haven't touched web stuff before. But
on a high level, how does a Javascript/Electron app wrap-around/bundle-with
youtube-dl - which (looking at github) is a python app?

Or does youtube-dl need to be already be pre-installed on the system?

~~~
mayeaux
Electron is a small Chromium browser that can interact with Node.JS, youtube-
dl is packaged with this app as a node package manager dependency. The
youtube-dl binary is downloaded and then called via a child process, let me
know if that clears things up for you.

~~~
geokon
So you need to have the python runtime installed for this to work? Or is that
downloaded as well?

I was just thinking I could for instance make a similar JavaFX crossplatform
GUI on the JVM, but I'd have no idea how to call the youtube-dl python code.
So I'm just curious how Electron solves that problem :)

~~~
mayeaux
No you just need the prereqs to run node, the binary comes compiled already

~~~
geokon
Oh okay with precompuled binaries then that's not so crossplatform. Thanks for
clarifying :)

------
jokoon
I often had to update YouTube dl in the last months.

I hope YouTube is not coming up with a solution.

------
VvR-Ox
Looks really interesting, thank you for sharing!

How does it compare to jDownloader (jdownloader.org)?

It can analyze the clipboard - when I paste a YT link it asks me if I only
want the video or the whole playlist.

I can choose from formats and I can choose to only download audio if I'm not
interested in the video or want to save some space.

It has a reconnect feature for the router to reset to get a new IP and much
more really cool things.

------
mellosouls
Suggestion to author: as this is presumably intended to be a user-friendly
front-end, consider providing installers.

I just tried installing on windows following the README and gave up after
fixing npm proxy issues and encountering multiple other errors afterwards. I
could fix it, but I don't have the time to investigate.

Anybody who can fix it, likely won't need a front end like this.

~~~
Xunxi
Try [https://github.com/MrS0m30n3/youtube-dl-
gui/blob/master/READ...](https://github.com/MrS0m30n3/youtube-dl-
gui/blob/master/README.md)

~~~
mellosouls
Thanks, I already have that; my suggestion was for the repository in the OP.

------
aiddun
I've had a good experience with youtube-dl-interactive. It's a CLI tool that
allows you to choose the quality/format from a menu without having to first
list and choose from every possible quality permutation.

------
paulcarroty
Extended search with previews will be great and playback in external player
will be great features to add.

But anyway, Youtube brakes API too often and maintaining any of YT apps is
very painful.

~~~
mayeaux
I'm going to add functionality that makes it such that the latest version of
youtube-dl is always installed, so as long as youtube-dl works the app should
work too.

------
bravura
Could I paste a bunch of URLs and it would create a _queue_?

~~~
cm2187
If you have a bunch of urls, paste them in NimbleText, a fantastic utility to
combine a list with a pattern, and create a bunch of command lines (syntax is
trivial: "youtube-dl $0")

Use chocolatey to install youtube-dl CLI as a self-contained executable.

------
exabrial
wuff... first rule of youtube-dl is you don't talk about youtube-dl!!!

But nice work. I just hope it doesn't bring the ire of Google

------
josteink
Skimming the code I see main.js hasn’t got a single semicolon.

If you want to invite others to contribute, you may consider adopting a more
widely employed js code-style.

This seems to be written in a very personal, opinionated and unconventional
way.

~~~
lukey_q
Writing personal projects in a personal way seems just fine to me :) Looking
at that file it's very obvious what's happening after just a cursory glance.
I'd much prefer code that's very easy to understand without semicolons than
the opposite.

