One thing I’ve started to find a minor annoyance is the adverts that YouTube inject into my watching and listening experience on their site. Frustratingly, the adverts here are in Thai language, so not really relevant to me. Why YouTube (Google) would ignore my language settings in my browser and on my machine, in favour of serving Thai language adverts, I have no clue. It’s really very spammy on their part, especially since they love to condescend on others what is and isn’t spam.
So, a little research and some geek magic and I came across something really very useful. It’s called “youtube-dl”, and basically it’s a Linux (and Windows) tool to download YouTube videos so one can watch them locally. AND YES WITHOUT THOSE DAMN ADVERTS.
It’s a command line tool, so not for the technologically challenged. SO WARNING – If you see the command line as complicated or arcane, then this ISN’T a tool for you. I’m sure there’s an app out there for you which does a similar thing, without hurting your brain 🙂
I used youtube-dl on Linux, as I’m preferring Linux to Windows these days. To download a video with youtube-dl it’s as simple as :
root@tweedledee:~# youtube-dl www.youtube.com/watch?v=W8r-tXRLazs
(that’s the video of “Buggles – Video Killed The Radio Star”, now stored in an Apple compatible .mp4 file on my hard drive)
There are various install options, including pre-compiled packages for lazy people like me. The tool is open source, so can also be compiled and installed from source code – which will make the paranoid happy ! And various command line options and arguments, to cover a variety of scenarios. RTFM basically …
The tool is regularly being updated, and developed. From what I understand it’s written using the Python language which is popular with the Linux community.
My results – after tweaking a few options, I obtained 1080p video with high quality audio downloaded to a single file (.mp4). It’s also possible to split streams, so that audio is in one file and video in another, and keep them both. I used the “-k” option for this. One slight drawback is that I had to “tweak” the audio file to play properly on Windows. For which I used the awesome “ffmpeg” tool, which needs to be installed additional to youtube-dl.
To correct the audio files I used ffmpeg like this :
root@tweedledum:~# ffmpeg -i inputfilename.m4a -vn -acodec copy outputfilename.m4a
After making this change to the audio files, my iTunes was happy to play them, as was all of my other audio/video players. My iPad was happy to play .mp4 video files produced by youtube-dl (like the one that’s produced from the first youtube-dl command above).
Possibilities – There’s some very interesting possibilities, like downloading a whole entire YouTube playlist with one command. I could see this being very useful for someone organising a party, where they wanted a video jukebox without YouTube’s advert interruptions, or perhaps a tool for a “video DJ”, if there is such a person. Just a couple of my ideas, obviously the scope of what you use it for is only limited to your imagination …
youtube-dl 9/10 for – simplifying what should be (and now is) the trivial task of downloading music videos for local playback 🙂 And working pretty much flawlessly straight out of the box. Great job, great tool. Thankyou to the authors and contributors.
Resources & Sources
Unless otherwise stated everything here is (c) DonCharisma.org, all rights are reserved.
Comments are often welcomed, provided you can string a legible, relevant and polite sentence together. In other cases probably best shared with your therapist, or kept to yourself.