• S&T Moderators: Skorpio | VerbalTruist

Internet Youtube to MP3

3DQSAR

Bluelighter
Joined
Oct 27, 2024
Messages
395
Is anyone aware of an online Youtube to MP3 convertor that ISN'T a con simply designed to push ads at the user.

I actually paid for Audible access to a series of books but without explanation or recompence, the original versions narrated by the Author (Spike Milligan) have been replaced by newer recordings made by someone attempting (and singularly failing) to imitate Spike.

Anyone who loves the works of Spike will appreciate what a loss this is.

Cheers.
 

works fine.

alasdair
Wtf. Thank you
Cat Love GIF
 
Yo use 4k video Downloader. It's free 10 downloads daily. You can upgrade to premium to have unlimited or you could get a crack for 4k premium. It's the best software in my opinion.
 
Skip the middle man and use ffmpeg yourself. It's what all of these sites are based on anyway. You can use yt-dlp to fetch the videos from youtube (and most other websites) then run them through ffmpeg like so:

Code:
ffmpeg -i video.mp4 -c:a libmp3lame -b:a 320k output.mp3

If you want a smaller filesize you can change 320k to something like 192k or 128k.

There are several GUI front ends and batch convertors for ffmpeg on most every OS. On windows I use one called FFBatch to bulk convert audio in some video files I host on my media server. ffmpeg can handle most every audio/video format out there. It's the core tool used by most everything that deals with audio/video be it a website or video editor.

I encourage you to learn it because it'll be around next year, 5 years from now and 20 years from now. Where these websites tend to come and go or eventually end up running ads filled with malware. ffmpeg is certainly much better for bulk converting stuff. It's easy to write shell/batch scripts around it or use one of the GUIs that make it easy for people that can't do basic scripting.

As far as getting the actual videos off youtube and other services the yt-dlp application is what you want and what most of these websites are using behind the scenes. It's pretty simple to learn how to use it (see: https://github.com/yt-dlp/yt-dlp) and it's packaged for just about every OS. You can pull down entire channels at one time although sometimes google will rate limit you. To get around that you can log-in to a google account and get a copy of the cookie which you drop in the yt-dlp config files. Everything you need to know how to do that stuff is on the github I linked above. Once you've got it set-up you can copy/paste the channel name (or video link) into terminal like this:

Code:
yt-dlp <link to video/channel>

and it will download the video or all the channel's videos for you automatically. Youtube serves different formats and tends to push their own stuff (e.g. vp9 and av1 videos) but with a simple change to the yt-dlp's config files or a run time flag you can force it to fetch avc1/h.264 video. Which is more widely supported. You can force it from the command line like this:

Code:
yt-dlp <link to video/channel> -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b"

Which will pull down a video in the .mp4 container, with h.264 video and the highest quality audio source (probably opus).

As an example. Say you wanted to download this video:



We'd download the actual video itself with yt-dlp:

Code:
yt-dlp https://www.youtube.com/watch?v=idZuTPaWY-g -f "bv*[vcodec^=avc]+ba[ext=m4a]/b[ext=mp4]/b"

We end up with a long file name (it's whatever the title of the video was). That's annoying to deal with on a US keyboard that can't input kanji on this particular video. So we can rename it like this using TAB key to auto complete and escape characters:

Code:
mv 【東方手描きMV】U\ r\ my\ Nightmare(Vo:あやぽんず*)【森羅万象公式】\ \[idZuTPaWY-g\].mp4 video.mp4

Then we convert the newly renamed video.mp4 to an mp3 like so:

Code:
ffmpeg -i video.mp4 -c:a libmp3lame -b:a 320k output.mp3

The above will unpack the contents of the mp4 file. Once unpacked it'll take whatever the audio is and convert it to mp3 using the LAME encoder. Then it will output a .mp3 file that you can use with any standard audio device that supports it (so everything). If you want another format look at the ffmpeg manual (it's huge) and adjust the command as needed. It can output anything you desire. It's worth checking the video file to see what kind of audio is in it (use an application called "mediainfo" for that purpose or ffmpeg itself). If it's opus or aac and your device supports that you're better off just taking it out of the container and repacking it into mp4/mkv without converting it. Since the conversion to mp3 is lossy and will degrade the audio some. But honestly for 99% of people they aren't going to notice at 320kbps mp3. Check the manual for ffmpeg if you're an audiophile and aren't happy with converting to another lossy codec.

One last important thing: Unless you want to keep a local archive of the audio/video there is no reason why you need to go through the above. You can use yt-dlp to fetch videos from youtube then pipe them into any video or audio player. For example, on my laptop I don't want to keep a lot of local video/audio files because they take up a lot of room on my smallish-SSD. Instead I stream content either from my home server over ssh or from platforms like youtube. For my own archives I mount the remote filesystem over the network and the laptop sees it as a local drive. For youtube and other similar services I use yt-dlp to pipe the video+audio into mpv or mpd. I also use newsboat (an RSS feed reader) to follow youtube channels. My news reader fetches updates every half hour and when something new is uploaded I can use a key bind to automatically open it in mpv. This way I can follow channels without having to log-in or use the browser. It's much faster than dealing with the website and works on devices where I might not be able to run a modern web browser.

If you don't want to go through all of the trouble of setting up a news reader that's fine to. You can make one little change to mpv's config file to make it use yt-dlp to fetch files from youtube. Like this:

Code:
## Add the following to mpv.conf:

# Youtube Support
# Note: The PATH to your yt-dlp may differ from the below. Change "/usr/local/bin/yt-dlp" to the correct PATH
script-opts=ytdl_hook-ytdl_path=/usr/local/bin/yt-dlp
# Note: Force youtube to fetch h.264/AVC video, the best audio it can and do not accept videos with a frame rate above 60fps or resolution above 1080p
ytdl-format=bestvideo[height<=?1080][vcodec~='^(avc|h264)'][fps<=?60]+bestaudio/best
# Increase the default buffer
# Default demuxer is 150/75 MB, note that this uses RAM so set a reasonable amount.
demuxer-max-bytes=150000000 # 150MB, Max pre-load for network streams (1 MiB = 1048576 Bytes).
demuxer-max-back-bytes=75000000 # 75MB, Max loaded video kept after playback.
# Allow seeking of videos even when it's set to "disabled" by default
force-seekable=yes
# Pretend to be a web browser. Might fix playback with some streaming sites,
# but also will break with shoutcast streams.
user-agent="Mozilla/5.0"

Now you can open any youtube video link in mpv like so:

Code:
mpv 'https://www.youtube.com/watch?v=idZuTPaWY-g'

Note that my shell requires the single quotes for this to work. Yours may not. If it does it'll output something like "no matches found". Also note that I'm on an oddball UNIX OS. The PATH in the above mpv.conf will probably be "/usr/bin/yt-dlp" on most Linux distros and "C:\\windows\yt-dlp\yt-dlp.exe" on most Windows OSs (unless you installed it somewhere else. On my one Windows machine it's at X:\\apps\yt-dlp\yt-dlp.exe).

I use this on all my computers and it works fine across all OSs I've used including Apple stuff as long as you take the time to set it up correctly. VLC also works fine if you aren't a fan of the terminal applications like mpv. I do highly suggest mpv though. There are GUI front ends for it if you really want one but I find it much better to just learn the key binds and run it from the keyboard. You can disable the video portion if you're really just after the audio. Or do what I do and run it on a dedicated workspace/tag in the background so it stays out of the way.

If anyone is interested I can share how to get an RSS feed with newsboat that automatically feeds new videos into mpv using yt-dlp to fetch them. I don't really feel like posting about it now because this is getting a big long. Every now and again google will attempt to break yt-dlp. But usually a fix is figured out in a couple of hours. Most of the pre-built packages for it are updated very quickly when this happens. Just keep this in mind because if you're on Windows you'll have to update it manually. Thankfully, you can do it with a simple command from the CLI instead of having to constantly grab a .exe installer. If it stops working for you randomly one day just assume it's Google being a dick again and check the above github repo to see if it has been fixed yet.
 
Last edited:

I use this thing ^^^ it requires installing an app though, but by doing so, I think you avoid all of the spyware and advertisement issues or whatever.

It'll ask you to buy the premium version occasionally, but other than that, there's no real issues and I think it's fully functional without it for doing a bunch of different format conversions, I find it pretty useful for converting YouTube links to wav forms or mp4s or whatever you need
 
No need to learn your way around ffmpeg, though on the whole it's not a bad idea to do so. Just fetch the file with yt-dlp as others have said. But you can strip out the video and save an audio-only version with nothing that's not already on your computer. Just open the video in QuickTime Player. Then goto "File -> Export As -> Audio Only..." Done, and done.
 
Top