12 ms·
Show HN: Download any song without knowing its name
- ahmacleod 11y agoThis is pretty cool. I usually had to add a little more context to get the correct result though. It would be nice to see the top ten results, maybe with a relevance score. It would also be great if I could pipe in the search and bypass confirmation, e.g: > echo hide your love away | instantmusic -f
- yask123 11y agoRecently this feature was added. https://github.com/yask123/Instant-Music-Downloader/blob/master/music_downloader.py https://github.com/yask123/Instant-Music-Downloader/blob/mas... You can install it from source if you wish to use it now. I haven't updated the package as yet.
- scott_karana 11y agoThis is super cool. :-) I think it'd be nice to have a SoundHound/Shazam-style audio fingerprint downloader too: then you can either repeat lyrics, or get a quick soundbyte!
- tedmiston 11y agoI've wanted to build a similar thing for a while, except letting me say some of the lyrics vs. typing them.
- kenbellows 11y agoOP + a voice recognition wrapper probably wouldn't be too hard, depending on what's available for voice recognition libs in Python; I haven't actually looked. Anyone know?
- nadams 11y agoI'm surprised to see this on HN. This should be called "Illegally download any song". I think the project is extremely cool and you have props from me - but I hate it when people try to skate the simple fact that stuff like this is illegal. ROMs and emulators have shown up on imgur many times as "free" - like as if the publishers have released the rights to the game(s).
- curiousjorge 11y agohow can downloading youtube videos be illegal? roms & emulators are perfectly legal. if it was illegal why would it still exist publicly? if something was illegal you bet your ass the USG will take it down.
- Namrog84 11y agoHow is that troll behavior?
- snx 11y agoThis is using youtube-dl, which downloads the youtube video and converts it to an audio file. Not illegal. At least in my country..
- zkhalique 11y agoHow do you know youtube-dl is not illegal? And where can I find it?
- silveira 11y agoI think the burden of proof falls under the one saying youtube-dl is illegal, doesn't? Also, because everything which is not forbidden is allowed, one would need to show that youtube-dl is illegal, and not that youtube-dl is not illegal.
- kenbellows 11y ago
- jhgg 11y agoIt looks like all this is doing is in essence just searching for the lyrics on youtube, finding the first result and then passing it to youtube-dl.
- cushychicken 11y agoNothing wrong with that, is there? Sure looks a lot more productive to the boss than searching for your next track on YouTube. :)
- curiousjorge 11y agodidn't work for me. I also expected a Tupac song. $ instantmusic Enter songname/ lyrics/ artist.. or whatever > used to be a thug Making a Query Request! Found: The Ambassador Christology Release Party I Used to be a Thug.mpg 11-22-99 Download song (y/n)? y Downloading... [generic] watch?v=YfE2-T1r-jw: Requesting header [redirect] Following redirect to https://www.youtube.com/watch?v=YfE2-T1r-jw https://www.youtube.com/watch?v=YfE2-T1r-jw [youtube] YfE2-T1r-jw: Downloading webpage [youtube] YfE2-T1r-jw: Downloading video info webpage [youtube] YfE2-T1r-jw: Extracting video information [youtube] YfE2-T1r-jw: Downloading DASH manifest [youtube] YfE2-T1r-jw: Downloading DASH manifest ERROR: unable to open for writing: [Errno 13] Permission denied: u'The Ambassador Christology Release Party I Used to be a Thug.mpg 11-22- 99-YfE2-T1r-jw.m4a.part
- zzleeper 11y agoBTW, on a fresh Win10 install (Py3.5) I had a bit of trouble b/c of the lack of extension. Had to add the .py prefix and it worked then :)
- yask123 11y agoI should add that in the Readme.
- exogen 11y agoI have a similar function in my bashrc, which also relies on youtube-dl (which is amazing, btw, it does a LOT more than YouTube – bandcamp, SoundCloud, etc). `play` will instantly play any song (great for parties), and `mp3` will download it: https://github.com/exogen/dotfiles/blob/730fb8e2b72b2fc3aa3d90b889874bb5195e1d07/.profile#L65 https://github.com/exogen/dotfiles/blob/730fb8e2b72b2fc3aa3d...
- mintplant 11y agoI think the best part of youtube-dl is its support for bulk downloads. Point it at a YouTube account or playlist, a podcast on SoundCloud, or even, if you can live with yourself, an album on Bandcamp, and it will snarf up every piece of media it can find.
- archimedespi 11y agoNice! Added to my dotfiles :)
- exogen 11y agoSome pro trips: by default it searches YouTube for the argument you give it, but if given a URL, youtube-dl will always use that instead. So `play <bandcamp URL>`, `mp3 <SoundCloud URL>` will work. If the first result for your search isn't the song you want, I usually append "hq", "hd", or "album version".
- mccracken 11y agoI get: youtube-dl: error: no such option: --youtube-skip-dash-manifest As an error, am I missing something?
- zatkin 11y agoYou should replace that YouTube video with an Asciinema: https://asciinema.org/ https://asciinema.org/
- tefo-mohapi 11y agoLove it. But expect hell from Google and record labels / music artists alike. All the best.
- 6stringmerc 11y agoYeah, I'm not a big industry player but I'm not exactly enamored with this kind of thing. One question would be does Youtube-dl still provide compensation to the artists/label/publisher/etc in the same format as a stream? If not, then it's genuinely circumventing the (admittedly limited) tracking and compensation structure YouTube has set up. That...probably won't work out very well in the long run.
- JoshTriplett 11y agoYes and no: it counts as a "view", but it doesn't show ads.
- developer1 11y agoRestated: no. Monetization depends on the ads. Using such a tool is equivalent to using an ad blocker. If you're comfortable using an ad blocker, you're not doing much different here.
- JoshTriplett 11y agoExactly. I never see ads on YouTube when using Firefox, only when using the Android YouTube app.
- shmerl 11y agoI once tried to identify a piece of instrumental music and tried AudioTag, but it couldn't find anything. It would be useful to have a huge global music database with some recognition algorithms for that. Is there anything like that around?
- mintplant 11y agohttps://www.shazam.com/ https://www.shazam.com/ http://www.soundhound.com/ http://www.soundhound.com/ http://www.midomi.com/ http://www.midomi.com/ http://echoprint.me/ http://echoprint.me/ http://the.echonest.com/ http://the.echonest.com/
- shmerl 11y agoThanks. I'm looking for something simple enough that doesn't require any accounts. Looks like Shazam and Soundhound have no Web services and require registration. Midomi has recording widget, but no sample upload (that's somewhat weird). Echoprint is open, I'll take a look at that. Echonest doesn't seem to have any service on their site (not sure how it's used).
- timboslice 11y agoCheck out musicbrainz
- shmerl 11y agoThanks. I thought it's more for meta information (I know VLC uses it to identify audio by meta tags). Looks like they support acoustic fingerprinting too: https://en.wikipedia.org/wiki/MusicBrainz#Fingerprinting https://en.wikipedia.org/wiki/MusicBrainz#Fingerprinting
- scott_karana 11y agoSoundhound doesn't (or didn't?) require registration if you're using the mobile app, if that's an option.
- 0x4a42 11y agoWow, what a nice hack! My testing env : Windows 8.1, MSYS2, Python 3. It's working flawlessly even with some obscur foreign/french lyrics/song/group. I'm impressed. :)
- cushychicken 11y agoA nice little tool. I'm a big fan of Youtube-dl as well. I've used it in similar chain-together command line tools to feed songs from Youtube into ffmpeg to slow them down to practice/learn songs. It can also swipe audio from NPR so I can stream to my Sonos system, which is nice, because they tend to make the Bonnaroo and Newport Folk content streaming-only on their portal.
- biturd 11y agoAfter a bunch of mess getting it installed on Mac OS X, I get it to find a song, which is a bit of trouble in and of itself, and am then stuck with this error: sh: youtube-dl: command not found
- tedmiston 11y agoAre you intending to use the author's program or youtube-dl directly? This was sufficient for me on OS X 10.10.5: pip install instantmusic brew install ffmpeg instantmusic > ...some lyrics... afplay foo.mp3
- halosghost 11y agoYep, this project depends on youtube-dl[1] (which is an awesome tool anyway, so if you don't have it already, you should consider grabbing it regardless). [1] https://github.com/rg3/youtube-dl https://github.com/rg3/youtube-dl
- deleted 11y ago[deleted]
- DanBC 11y agoYou may want to ask /r/tipofmytongue if they'll put it in their sidebar. A few people ask for music. They could have shazaamed it, but they don't.
- _Marak_ 11y agoBased on the comments here, it seems this tool is powered by youtube-dl. youtube-dl is a great tool ( supports multiple websites outside of youtube as well ) The problem is...if you use youtube-dl to rip songs from youtube you are going to be stuck with a not so great quality bitrate. Based on some quick research, it looks like the top quality audio bitrate you can get currently get from youtube is 126.886 kbps. That's going to really reduce the quality of any song you rip from the site. Most songs are digitally released at 320kbps these days. CD quality is 192kbsp.
- pla3rhat3r 11y agoThis has been an age old question since Mp3s were created. However, I'm going to disagree with you there on saying that CD quality = 192kb. I've heard 192kb files and they sound like complete garbage. If you're looking for true "CD quality" that would be LPCM 44100 Hz 16 bits stereo for a bitrate of 1411 kbps.
- dkonofalski 11y agoI've heard this before elsewhere and the response then was that the person was confusing kilobits with kilobytes. 1411kbps/8bits/byte = 176.375Kbps. The closest you can get to that is 192Kbps. There's a big difference there.
- adrianpike 11y agoMP3 bitrates are conventionally given in kilobits per second, not bytes.
- kaoD 11y ago> I've heard 192kb files and they sound like complete garbage. I'm curious, did you blind test yourself? I blind tested a friend of mine who kept saying so, and he did barely better than random.
- aianus 11y ago
- IMTDb 11y agoIt's a CLI version of a tool like Youtune (http://youtune-downloader.com http://youtune-downloader.com) and probably many others.
- mlamat 11y agoHow do you get it to automatically play the file?
- nbardy 11y agoHere is the important 2 lines of code. response = urlopen('https://www.youtube.com/results?search_query=' + search) command = 'youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 ' + video_link Amazing how useful of a tool you can make with such little code. There is really some great libraries available today.
- yask123 11y agoYea! , and I also wrote a small script to embed album arts for all mp3 files. The script queries with mp3 file name in google images, picks up the first image, downloads it and embeds in mp3 file automatically. http://iyask.me/fixalbumart/ http://iyask.me/fixalbumart/
- Jerry2 11y agoI also save audio from YT occasionally. I prefer to use this command however (to get the best quality audio): youtube-dl -f bestaudio[ext=m4a] <youtube ID> PS: you can replace m4a with mp3 but that will induce trasnscoding and loss of quality. YT's AAC tracks are usually the highest bitrate ones so it's best to leave it as is.
- JoshTriplett 11y agoyoutube-dl already defaults to downloading the best quality audio; you only need that line if you want to force a particular format.
- leni536 11y agoI thought youtube-dl defaults to "best"
- JoshTriplett 11y agoyoutube-dl defaults to "best"; youtube-dl --extract-audio defaults to "bestaudio".
- 11y ago
- lucb1e 11y agoPretty much the same as playbylyrics.com[1], something I made, except you run it yourself. I really like it! [1] (Note that the site is broken as of a few months.. it never caught on and I'm going to let the domain expire unless someone wants to have it (for free, just tell me what you're going to do with it).)
- unicornporn 11y agoCool! But I'm looking at the video and this thing seems it automatically transcodes the audio stream to MP3. Why not just put the highest quality AAC stream available in an M4A container?
- xerophyte12932 11y agoI am surprised it even supports non-english songs! Though I wonder which languages are supported other than urdu/hindi
- takee 11y agoIf a song is on youtube (or any other website that youtube-dl searches in), this will download it. Language is not a constraint here.
- deleted 11y ago[deleted]
- chdir 11y agoSlightly simplified & loops through all the links on the first page : import re, youtube_dl from bs4 import BeautifulSoup from urllib2 import urlopen from urllib import quote_plus ydl_opts = {} soup = BeautifulSoup(urlopen('https://www.youtube.com/results?search_query=' + quote_plus('linkin')).read()) links = soup.find_all('a', href=re.compile(r'watch\?v='), class_='yt-uix-tile-link') for i, link in enumerate(links): print i+1, '-', link.text choice = int(raw_input("Select song index : ")) with youtube_dl.YoutubeDL(ydl_opts) as ydl: ydl.download(['http://www.youtube.com/' + links[choice-1].get('href')])
- choicenotchance 11y agoITT: butthurt people who think they can do better, or have done better, but are sore because they didn't get the HN front page limelight for it.
- deleted 11y ago[deleted]
- navinsylvester 11y agoOn a similar note. To all those who love to store movies and watch. It's always a pain to decide what to view. I wrote a tool which helps the process - https://github.com/navinsylvester/cinephile https://github.com/navinsylvester/cinephile . Pip install is broken so try the git one.
- loueed 11y agoGoing to try make this into a alfred workshop if anyone is interested
- yask123 11y agoJust updated to v1.2 with many bug fixes and some additional features. Run `pip install instantmusic --upgrade` to try. https://github.com/yask123/Instant-Music-Downloader https://github.com/yask123/Instant-Music-Downloader