• Converting Youtube URLs to MP3
    24 replies, posted
I am trying to find a way to convert urls from youtube into the direct mp3 file. I want to use http.Fetch to return the mp3 link. Any help would be greatly appreciated as i am not sure how to do this.
I hope you have a good excuse to resort to this, because the sound quality is going to be pretty bad
I have tried to find a decent online database for mp3 files where it would be easy for users ingame to search and have the addon ingame show all that the database has returned. It is extremely hard to find a reliable site for this.
It's not directly from browser but try this [url]http://www.freemake.com/free_video_downloader/[/url] it can download the video straightup or convert to many formats including mp3 and it works great
I was hoping for something that would go like this [url]http://www.example.com/return.php?video=URLHERE[/url] and that would return the mp3 link Edit: Probably wouldnt work and as you said, i would lose a lot of quality. Are there any free mp3 databases out there that have a free and decent api?
Grooveshark has an API, which sound sort of like what you're after: [url]http://developers.grooveshark.com/tuts/tinysong[/url] [ [url]http://developers.grooveshark.com/[/url] ]
Will the grooveshark api return a link to an mp3?
[QUOTE=TheEncrypted;44840980]Will the grooveshark api return a link to an mp3?[/QUOTE] ofc it won't, that would be like grooveshark hosting a file server with copyrighted work on it. It's quite simple in theory but is not-so-easy to do. The concept is as follows: 1. Request comes in 2. server downloads flashvideo from youtube (takes time) 3. server extracts audio track from flash and converts it into the format you want (also takes time, but here should be tools for this) 4. server responds with the mp3 You are probably better off letting your clients upload the mp3 themselves.
[QUOTE=LennyPenny;44843926]ofc it won't, that would be like grooveshark hosting a file server with copyrighted work on it. It's quite simple in theory but is not-so-easy to do. The concept is as follows: 1. Request comes in 2. server downloads flashvideo from youtube (takes time) 3. server extracts audio track from flash and converts it into the format you want (also takes time, but here should be tools for this) 4. server responds with the mp3 You are probably better off letting your clients upload the mp3 themselves.[/QUOTE] You can do it with the [URL="https://github.com/sosedoff/grooveshark"]unofficial API[/URL] though.
I've got something (which is what I think you're after) setup on my RaspberryPi. Basically there's a package for linux called youtube-dl which uses python to grab the youtube video and download it as an M4A file which you can then use FFMPEG to convert to an MP3. For a 3 minute video on my RaspberryPi it takes about a minute for the whole process. Here's an example of the sound quality: YouTube Video: [url]https://www.youtube.com/watch?v=kK42LZqO0wA[/url] Converted File: [url]http://puu.sh/8RKKp.mp3[/url] I assume if you'd run it on something that's got beefier hardware than the Pi it'd be done in no time. [url=http://puu.sh/8RKOq.jpg](Even made a snazzy interface which automates it all with a bash script)[/url] EDIT: If you want I could help you get something similar setup on a VPS/Dedi.
[QUOTE=LennyPenny;44843926]ofc it won't, that would be like grooveshark hosting a file server with copyrighted work on it. It's quite simple in theory but is not-so-easy to do. The concept is as follows: 1. Request comes in 2. server downloads flashvideo from youtube (takes time) 3. server extracts audio track from flash and converts it into the format you want (also takes time, but here should be tools for this) 4. server responds with the mp3 You are probably better off letting your clients upload the mp3 themselves.[/QUOTE] Yeah i think that you are right, i would probably be better off letting clients link their own music and have that added to a database located on the server. [QUOTE]You can do it with the unofficial API though.[/QUOTE] How would that work? Would that link directly to the mp3? [QUOTE]Adzter[/QUOTE] That is a pretty neat idea, although i think it would take to long to do all of that if i wanted the music to be streamed near instantly
I noticed in the OP you said you're going to use http.Fetch, I assume this is for a garrysmod addon?
Yes it is.
I'm using [URL="http://youtubeinmp3.com/api/"]this[/URL] site for my addons. Use "Advanced API". And yes it is directly convert video from youtube to mp3 format. No waiting, but you can't convert long videos that have 20 minutes or more and sometimes it doesn't convert anything at all. I don't know why.
[QUOTE=sabadyCZ;44851678]I'm using [URL="http://youtubeinmp3.com/api/"]this[/URL] site for my addons. Use "Advanced API". And yes it is directly convert video from youtube to mp3 format. No waiting, but you can't convert long videos that have 20 minutes or more and sometimes it doesn't convert anything at all. I don't know why.[/QUOTE] This was the first thing i tried. I liked this because i could allow users to easily search youtube and it would return around 20 videos. The only problem with this is, it does not return a direct MP3 link. If it would or if i could get it working, it would be amazing.
Then what it returns? Write a full url what do you use.
It returns a link that redirects or something, which is strange. Using the example that is on the website "http://youtubeinmp3.com/fetch/?video=http://www.youtube.com/watch?v=i62Zjga8JOM", it doesn't return the direct link to the mp3. Not exactly sure what it is doing...
[QUOTE=TheEncrypted;44852665]It returns a link that redirects or something, which is strange. Using the example that is on the website "http://youtubeinmp3.com/fetch/?video=http://www.youtube.com/watch?v=i62Zjga8JOM", it doesn't return the direct link to the mp3. Not exactly sure what it is doing...[/QUOTE] [QUOTE]Advanced API Normal text With the advanced API you can parse the title, video length [I][B]and download link.[/B][/I] [U][U][URL="http://YoutubeInMP3.com/fetch/?api=advanced&video=http://www.youtube.com/watch?v=i62Zjga8JOM"]http://YoutubeInMP3.com/fetch/?[B]api=advanced[/B]&video=http://www.youtube.com/watch?v=i62Zjga8JOM[/URL][/U][/U] JSON Example You can also receive the data in JSON by setting the "format" parameter to "JSON". [U][URL="http://YoutubeInMP3.com/fetch/?api=advanced&format=JSON&video=http://www.youtube.com/watch?v=i62Zjga8JOM"]http://YoutubeInMP3.com/fetch/?api=advanced&[B]format=JSON[/B]&video=http://www.youtube.com/watch?v=i62Zjga8JOM [/URL][/U][/QUOTE]
When I click on the link, it starts to download mp3. Not for you? I'm using it for radios on gmod server and nobody have a problem with it.
Odd, wasnt working last time i tried it. I must have fucked something up. Thanks a lot man, i will see if i can get it going this time...
Use clipconverter.cc, it's fast and very easy to use
snip, answer already posted (youtube-dl)
I use website https://h2converter.com convert youtube videos to mp3!
I am using https://mixload.co api to convert youtube to mp3. You can also use direct link to download youtube to mp3 using this api https://cdn.mixload.co/get.php?id=[YouTubeID]&name=[Title] . This is very fast and reliable
Sorry, you need to Log In to post a reply to this thread.