News for hackers. Stuff that matters.
Re:Show HN: YouTube-dl wrapper with added features to easily... by krick on Sunday January 19, 2020 @01:46PM (#22093088)
Cannot understand what exactly is that. I have used a simple alias called (unsurprisingly) yt-audio for years, which is youtube-dl with appropriate flags (-x, --audio-quality, --download-archive, -o, etc.), and this seems to be exactly that, only written in python for some reason.
Re:Show HN: YouTube-dl wrapper with added features to easily... by 3PS on Sunday January 19, 2020 @04:37PM (#22094285)
For the record, if you only use youtube-dl for the purposes of downloading audio (like me), then you can keep a config file in $HOME/.config/youtube-dl/config with default arguments so you don't have to look them up each time. For example, here's a sample from my config:

    # extract audio only
    -x
    # stick to mp3
    --audio-format mp3
    # get rid of the annoying URL stuff at the end
    -o "%(title)s.%(ext)s"
Re:Show HN: YouTube-dl wrapper with added features to easily... by rwnspace on Monday January 20, 2020 @09:38AM (#22099068)
A minor extension of the idea here and of the GP - I have aliased 'yt' and 'ytm' to target two different config files in the same folder path you gave.
Re:Show HN: YouTube-dl wrapper with added features to easily... by darau1 on Sunday January 19, 2020 @02:21PM (#22093331)
Can you share this? I've been meaning to do something very similar for the longest while and haven't got around to it.
Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Sunday January 19, 2020 @01:54PM (#22093140)
It adds a few more functionalities like setting up custom arguments, option to keep track of downloaded titles without archive file, and a few more. It just tries to make audio/playlist management easy. As mentioned, it is a youtube-dl wrapper. So under the hood it uses classic youtube-dl arguments.
Re:Show HN: YouTube-dl wrapper with added features to easily... by toomuchtodo on Sunday January 19, 2020 @03:24PM (#22093779)
Is there any reason these features couldn't be pushed upstream into youtube-dl proper?
Re:Show HN: YouTube-dl wrapper with added features to easily... by crystaldev on Sunday January 19, 2020 @02:07PM (#22093214)
Anyone else write a a lot of ripper scripts like youtube-dl but never share them for fear of starting an arms race with the content provider? It's easy to rip most .ts/XHR video streams with a bash loop.
Re:Show HN: YouTube-dl wrapper with added features to easily... by orf on Sunday January 19, 2020 @02:31PM (#22093412)
youtube-dl supports a _lot_ of providers/sites[1]. Perhaps it's easier to contribute a new downloader (it's pretty simple[2]), and judging by the number of updates required most sites don't care that much.

1. https://github.com/ytdl-org/youtube-dl/tree/master/youtube_d...

2. https://github.com/ytdl-org/youtube-dl/blob/master/youtube_d...

Re:Show HN: YouTube-dl wrapper with added features to easily... by rasz on Sunday January 19, 2020 @07:57PM (#22095336)
Yes :( I even removed mine from github after reading about people losing their gmail over unrelated google account problems.
Re:Show HN: YouTube-dl wrapper with added features to easily... by weq on Sunday January 19, 2020 @09:41PM (#22095834)
Im going to claim to be the first person to democratise the downloading of videos for later watching from websites. I created this for google video, because at the time they had lots of car videos i was interested in, but it had plugins for youtube and other content providers i used.

http://gvdownloader.sourceforge.net/

And yes, it was about a month after publishing that the arms race started with google. It was exciting at first, but then they started getting dirty, excluding me from search results and using whatever muscle they could to stop people finding the app.

(here is a link the hockeystick download graph, it got picked up by various other distribution networks in between) https://sourceforge.net/projects/gvdownloader/files/stats/ti...

I wrote it because bandwith was really expensive and slow back then. It was an experiment to solidify some programming concepts i was learning at the time, and also my first foray into browser plugin development.

Re:Show HN: YouTube-dl wrapper with added features to easily... by mikewhy on Sunday January 19, 2020 @08:38PM (#22095527)
Precisely why I never shared any of the backend code for ss-plex.
Re:Show HN: YouTube-dl wrapper with added features to easily... by whywhywhywhy on Sunday January 19, 2020 @01:13PM (#22092878)
YouTube-dl demolishes 100 pain points of using the modern web

This wrapper gets rid of the only pain point in using YouTube-dl which was having to google every time you wanted just the audio.

Great work

Re:Show HN: YouTube-dl wrapper with added features to easily... by jchw on Sunday January 19, 2020 @01:21PM (#22092914)
Off the top of my head, isnt that just the -x flag?
Re:Show HN: YouTube-dl wrapper with added features to easily... by rwmj on Sunday January 19, 2020 @01:30PM (#22092986)
I have a file under ~/bin called youtube-mp3 which has this one-liner:

    exec $HOME/d/youtube-dl/youtube-dl -t -x --audio-format=mp3 "$@"
(Edit: I'm sure this script does a lot more, but making ytdl download only the audio is fairly simple. Note the above command converts the file to mp3 which some people may not want to do because it's lossy.)
Re:Show HN: YouTube-dl wrapper with added features to easily... by krick on Sunday January 19, 2020 @01:50PM (#22093106)
What is -t?
Re:Show HN: YouTube-dl wrapper with added features to easily... by rwmj on Sunday January 19, 2020 @03:52PM (#22093981)
It (used to) cause youtube-dl to name downloaded videos after the title. Apparently it was needed in older versions of youtube-dl but is now ignored.
Re:Show HN: YouTube-dl wrapper with added features to easily... by DonCopal on Sunday January 19, 2020 @03:49PM (#22093966)
I also use --audio-quality 0 because it can be between 0 (best) and 9 (worst) and the default is 5.
Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Sunday January 19, 2020 @01:26PM (#22092955)
It's a bit more than that. Eg: One can configure their own CLI arguments to keep track of particular playlist(s).

$ yt-audio --your-arg1 --your-arg2

This will sync playlist/audios configured against these arguments.

Re:Show HN: YouTube-dl wrapper with added features to easily... by jchw on Sunday January 19, 2020 @01:40PM (#22093051)
Sorry, no doubt your app does more than -x. I just meant for extracting audio alone.
Re:Show HN: YouTube-dl wrapper with added features to easily... by alexis_fr on Sunday January 19, 2020 @01:45PM (#22093079)
I’m not near a computer but I was persuaded I have used youtube-dl -f mp3 https://... before.
Re:Show HN: YouTube-dl wrapper with added features to easily... by krick on Sunday January 19, 2020 @01:59PM (#22093168)
I don't think -f mp3 would ever work, -f is for choosing file format to download. So -f mp3 would work only if there is a source with codename mp3, which I don't think I've ever seen. You may be using -f bestaudio -x or something along the lines of it.
Re:Show HN: YouTube-dl wrapper with added features to easily... by jchw on Sunday January 19, 2020 @01:52PM (#22093124)
Well, if you use just -x alone, it will not attempt to get the format you ask for. So you will probably end up with a m4a (mp4 container with just AAC audio) or ogg (vorbis/i think opus?) depending on whether the best quality is encoded in h264, WebM/VP8 or WebM/VP9. Which may not be what you want.

OTOH, if you specify a format directly without -x, it may not extract the audio alone. For example if you wanted M4A, you'd specify -x on top of specifying the format explicitly.

edit: as krick points out though, it doesn’t seem videos generally have an mp3 format, at least on YouTube.

Re:Show HN: YouTube-dl wrapper with added features to easily... by latexr on Monday January 20, 2020 @12:16PM (#22100316)
Do you literally google it? Why not make an `alias` once, or `man youtube-dl`, or `youtube-dl --help | grep audio`?
Re:Show HN: YouTube-dl wrapper with added features to easily... by whywhywhywhy on Friday January 24, 2020 @06:33AM (#22137220)
its not a single command it's an actual ting you have to do manually.

you need to check what sources are available then manually input the number for just the audio stream of that specific video

Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Sunday January 19, 2020 @01:24PM (#22092935)
Thank you
Re:Show HN: YouTube-dl wrapper with added features to easily... by qwerty456127 on Monday January 20, 2020 @07:57AM (#22098453)
> MP3 works fine. M4a does not work.

Doesn't make much sense then. YouTube doesn't have MP3 so MP3 means unnecessary transcoding i.e. quality and time loss.

Why would anybody convert to MP3 today having AAC and OPUS originals? OPUS provides unprecedented quality at all bitrates (better than AAC and MP3), AAC also provides great quality&compression (better than MP3) and plays everywhere.

Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Monday January 20, 2020 @01:37PM (#22101047)
When using file's metadata method for tracking downloaded records, m4a file extension is not supported. Metadata method relies on 'purl' metadata tag. And m4a format has no purl tag, so it does not work.

One can use archive file method instead.

This limitation has nothing to do with yt-audio's capability of downloading m4a format. M4a limitation only applies to metadata method of tracking downloaded tracks.

Re:Show HN: YouTube-dl wrapper with added features to easily... by qwerty456127 on Wednesday January 22, 2020 @05:50PM (#22122927)
Why rely on tags if there is the ID appended to the file name and the file name is the title of the video? Youtube-dl names the files it downloads this way by default, just leave it as it is and you can identify the files easily.
Re:Show HN: YouTube-dl wrapper with added features to easily... by SisRob on Monday January 20, 2020 @10:05AM (#22099263)
Well, the audio quality is already reduced on upload - and much more than mp3 transcoding would.
Re:Show HN: YouTube-dl wrapper with added features to easily... by qwerty456127 on Monday January 20, 2020 @11:32AM (#22099941)
Among other options, YouTube offers 160 kbps OPUS (which, AFAIK, can be expected to be perceptually lossless and better than 320 kbps MP3). Would they waste bandwidth on streaming it this high if the actual quality they store is worse than that?

As far as I know every transcoding reduces it further. Even transcoding from 128 kbps AAC to 320 kbps MP3 will make the quality slightly worse.

Re:Show HN: YouTube-dl wrapper with added features to easily... by igetspam on Sunday January 19, 2020 @01:25PM (#22092945)
Typo in the readme: yt-audo

I'd make a PR but I'm not near a computer right now. This is great. I have a couple audio files I need to pull for my kid and this is gonna save me a couple steps. Thank you!

Re:Show HN: YouTube-dl wrapper with added features to easily... by asadlionpk on Sunday January 19, 2020 @01:39PM (#22093045)
done
Re:Show HN: YouTube-dl wrapper with added features to easily... by monkeydust on Sunday January 19, 2020 @03:44PM (#22093921)
Nice, I have script that does speech to text using google cloud and I wanted an easy way to get text out of youtube videos so this will help.
Re:Show HN: YouTube-dl wrapper with added features to easily... by genidma on Sunday January 19, 2020 @08:51PM (#22095594)
Can you please share the code? Thx!
Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Sunday January 19, 2020 @12:31PM (#22092608)
yt-audio has added features like custom CLI arguments (users can setup their own CLI arguments to manage playlists/audios), save each audio/playlist to a separate directory, added option to keep track of downloaded titles without archive file, and more ...
Re:Show HN: YouTube-dl wrapper with added features to easily... by cordite on Sunday January 19, 2020 @01:22PM (#22092921)
Will this get into brew?
Re:Show HN: YouTube-dl wrapper with added features to easily... by pseudoroot on Sunday January 19, 2020 @01:34PM (#22093004)
Haven't used brew before. I'll look into it when I'll get some free time.
Re:Show HN: YouTube-dl wrapper with added features to easily... by air7 on Sunday January 19, 2020 @02:15PM (#22093287)
OT but does ytdl violate YouTube's tos? I'd guess so as it skips the ads. Can it be used commercially, say?
Re:Show HN: YouTube-dl wrapper with added features to easily... by nadermx on Sunday January 19, 2020 @02:24PM (#22093351)
How does simply opening a website bind you to any contract?
Re:Show HN: YouTube-dl wrapper with added features to easily... by edgineer on Sunday January 19, 2020 @03:15PM (#22093717)
It isn't backed by the force of the US judicial system, but when YouTube says a person's Google account will be banned for commercial usage, I trust them.
Re:Show HN: YouTube-dl wrapper with added features to easily... by LeoPanthera on Sunday January 19, 2020 @04:58PM (#22094407)
YouTube (and youtube-dl) does not require you to be logged in.

And anyway I don't see how downloading a video is "commercial usage".

Re:Show HN: YouTube-dl wrapper with added features to easily... by whatsmyusername on Sunday January 19, 2020 @01:01PM (#22092793)
youtube-dl is the only thing that makes the modern web actually usable.

I ended up writing a bot that runs on a docker scheduled task and looks at trello. I can drop a youtube link on the board and it will grab the audio.

Great for when I hear a song somewhere that I want to add to my phone later.

Re:Show HN: YouTube-dl wrapper with added features to easily... by mmastrac on Sunday January 19, 2020 @01:54PM (#22093135)
How are you managing this integration? IFTTT?
Re:Show HN: YouTube-dl wrapper with added features to easily... by whatsmyusername on Sunday January 19, 2020 @02:04PM (#22093200)
It's just python running in a docker container in a scheduled task on ECS once an hour. I built it to test the pattern for work.

I use a trello integration library, shell out for youtube-dl, run a normalizer on anything it pulls, boto3 the files to s3 and then call SNS to text me it's done. I pick the files up later.

When youtube-dl updates (which it does, regularly) I just redeploy as it's tagged for latest in the requirements file. I could add this update step to the container or pull a copy from s3 that I maintain, but I'm not a big fan of pulling in code at runtime.

Trello is acting as an SQS queue, RabbitMQ queue, or redis set. If something fails the code will dump the error text into the card and retry indefinitely till I fix it.

This entire setup costs me < $1 a month. I think my route53 domains cost more.