Easiest way to download YouTube videos and convert them to any format including .mp3 in 2022

Methods of downloading YouTube videos have changed over the years. Here are two of my preferred methods for doing so in 2022.

tl;dr: easy:

Use a Youtube-Mp3 converter site, if you know how to Google then you’ve probably found one of these already.

tl;dr: is asked to fix printers:

Get the latest ‘youtube-dl’ fork like yt-dlp. Use ffmpeg to convert.


Easy

Yeah there’s really nothing else you need here

The Other Method

  1. Get yt-dlp. Put it in a folder somewhere in C:\ like ‘youtubedownload’. Rename the .exe file to yt.exe.
  2. Get ffmpeg. Put it in the same folder. You could rename this .exe file if you want as well, the names will be the commands used in the future.
  3. Press the WINDOWS key, and type ‘path’.
    (INCOMING WALL OF PICTURES)
  4. Choose ‘Enviroment Variables’
    enviroment variables pointer
  5. Then,
    edit path detailed pointer
  6. You can then add a new entry for the ‘path’ environment variable. The system uses this to allow the executing directory to be in any directory listed in the path. Meaning, when you run a command in CMD, the system will always check any directories in the ‘path’.
    add new path entry
  7. Click OK on all open windows after adding the directory the exes are in to the ‘path’.

Example Usage

We will be using this song from YouTube: Moving Romance – Yoann Garel. It’s also available on Soundcloud here.

Right click on your Desktop > ‘Open Command Window Here’. If you don’t have this option in the context menu, you can download these registry edits to add it.

Next type the name of the yt-dlp .exe followed by a space and the url. So if you renamed it ‘yt’ like stated previously, it would look like so:
yt https://www.youtube.com/watch?v=dIMdcJWOEFM
Hitting enter will start downloading that video to the desktop directory you just launched the CMD window in. (Hint! If you want to use a Soundcloud URL like we have below, that will work too! Isn’t technology great?)
yt-dl download example

If you want to convert the resulting video to a proper audio file like .mp3, you have two options. You can use the quick solution right from yt-dl:

yt -x --audio-format mp3 [video_url]

Or to download a playlist:

youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s"

You can ignore missing (“unavailable in your country”, or removed) videos with an -i flag. If your playlist isn’t working and the URL contains v=<ID>, remove it so just the ?list= item is in the query string.


Or, since ffmpeg is useful for other tasks (and you should have it anyway), you can use it directly. A simple syntax of an ffmpeg command that would convert to an mp3 would look like ffmpeg -i [input file name] [output file name].[output file extension]. But wait, we don’t want to type that long, ugly file name in that yt-dlp just spit out onto our desktop… luckily we have a trick for that.

Run ‘dir /x‘ in the open CMD window.dir /x example yt
This is an extremely helpful windows command that will show ‘short’ filenames for files, making working with longer file names a breeze. Windows is telling us in the screenshot above that we can refer to the video we just downloaded as ‘moving~3.web’. Now assuming no renaming of the ffmpeg .exe took place in the setup step, our command simply becomes:

ffmpeg -i moving~3.web output.mp3
ffmpeg -i output.mp3 example

And you’re done! You now have ‘output.mp3’ on your desktop saved as the song we were just playing on YouTube. I’ve combined this process with scripted metadata adding/titling for an offline library. And, with the right yt-dlp commands it can even become an efficient way to export entire playlists of music.


It helps me if you share this post

Published 2022-03-06 02:23:43

Nothing is permanent… especially on the Internet

Link rot is a problem that affects everyone using the internet on a daily basis. This is when a link becomes dead and no longer links to where it’s supposed to because of site changes. Either the owner stopped maintaining and paying for the domain/hosting, the structure changed, or it was deleted or inaccessible for another reason. Nothing is permanent online (unless it’s your ad data 😉), regardless of what your parents may have said.

Research from Harvard Law School shows about a quarter of all articles on the New York Times suffer from link rot, meaning resources linked on the page are no longer accessible. Additionally, links are not immutable. I personally have links such as ‘https://l.gmr.dev/tiktok‘ that link to my TikTok blog post and that can be changed so I can always keep it up to date. This can be a disadvantage if the site goes offline or the link is mismanaged however.

The problem can be combated by using web archivers, and linking to primary, trusted sources as much as possible. Additionally, it’s helpful to copy + paste the information that’s relevant from the site you’re sharing/linking in case it dies somehow later on.

Factcheck.org, which launched in 2004 now has almost 6,000 dead links. Roughly one third of all the links on Pagella Politica, the Italian fact-checking website I edited before joining Poynter, are currently broken. At the same time, trying to manually keep tabs on the state of a site’s links is too time-consuming to be feasible.

cjr.org

The advent of ‘online-only’ services have marked a period full of slow, buggy, overly designed applications, such as Creative Cloud or Epic Games, that run at all times on your computer to feed you advertisements or update notifications. Engines like Unity have transitioned more and more of their editor services and features to online services. Or, they’ve deprecated more traditional methods that would eliminate the need to connect to “Unity Teams” and/or login to their accounts & manage organizations.

When Flash was purged from the internet a few years ago, one of the largest issues Flash archivers faced were games that required connections to servers. Because those servers are no longer around, a game’s functionality can be crippled or even completely broken without a solution. This can easily happen to any server in the future. A program’s functioning that exists on something that may not be there in the future… well, it makes relying on that utility poor planning at best. Many modern day software applications ship without any sort of offline mode or planned use case 20-30 years from now, so that will be interesting to see.

Photos, old posts, and media people thought would be around forever are constantly being deleted. Make any playlist on YouTube with a sizeable number of videos and soon enough a fair number of them will be unavailable. My music library exists entirely on my own servers streamed to me because I can’t trust that Spotify or an alternative will be around in 20 years with the same music I listen to or want to stream now.

Jailbreaking iOS is an increasingly difficult task, and I switched to Android away from Apple’s walled garden a few years ago, but even now most companies are locking it down more and more in the name of security and the common user experience. Samsung removes the ability to unlock the bootloader in most US variants of their new models, so rooting Android is out of the question for me as well.

A bit rambly, but I don’t think there’s much to do about this other than being personally careful about what technologies I enable and what I work on. I’m simply commenting on the current direction of the Internet as a whole because I want the best for it. I’ve become more and more aware of how fragile the current state of everything online is, and began saving and archiving everything preemptively.

Voting with your money and just being aware is probably the best move, and I’ve personally been more and more selective about digital media or programs I’m choosing to spend time, data, energy and finances on.


It helps me if you share this post

Published 2022-02-15 04:01:27