Youtube download link from http://www.youtube-mp3.org/

41,487

I don't know what this suffix means but reading the client javascript file from youtube-mp3.org you can learn how to generate it.

var __AM=65521; // the largest prime less than 2^16...
function cc(a){
    var c = 1, b = 0, d, e;
    for(e = 0; e < a.length; e++){
        d = a.charCodeAt(e);
        c = (c+d)%__AM;
        b = (b+c)%__AM;
    }
    return b<<16|c;
}

The generated media URL is :

"http://www.youtube-mp3.org/get?ab=128&video_id="+video_id+"&h="+info.h+"&r="+timeNow+"."+cc(video_id+timeNow)

with

var timeNow = Date.now().toString();
Share:
41,487

Related videos on Youtube

okipol
Author by

okipol

Updated on June 01, 2020

Comments

  • okipol
    okipol almost 4 years

    I've been using the http://www.youtube-mp3.org/ to obtain download links for mp3 songs for a "internet radio" project (download file stream and output it). Lately the http://www.youtube-mp3.org/ seemed to changed it's workflow. Till now I was able to obtain the proper format of the url:

    http://www.youtube-mp3.org/get?ab=128&video_id=KMU0tzLwhbE&h=5671e7d33d4eccb5b89ea8f54d9911d4&r=1387110278658.1527580295

    Whereas r=timestamp I did the timestamp myself as epoch. This worked well without the .1527580295 suffix. Unfortunetly this seems to be needed as the link without the suffix redirects back to the conversion site.

    Up till now the algorithim was as mentioned:

    Youtube mp3 org linq acquiring explained

    http://www.youtube-mp3.org/api/itemInfo/?video_id=#{video_id}&ac=www&r=#{Time.now.to_i}

    Does any one know how to obtain the suffix part?

    //Hey, I'm not much of an web programming guy ... but this is something I have surely overlooked. Thanks!

    Added this to my small C# API.

      <!-- language: c# -->
        const int AM = 65521;
        int GetCCSufix(string a)
        {            
            int c = 1, b = 0, d, e;
            var chars = a.ToCharArray();
            for(e =0; e< chars.Length; e ++)
            {
                d = chars[e];
                c = (c + d) % AM;
                b = (b + c) % AM;
            }
            return b << 16 | c;
        }
    

    Works great ;)

    • Nasenbaer
      Nasenbaer about 10 years
      Hi. I could not get it work. Can you share where you got the documentation of new API call? What do you send to the GetCCSufix as parameter? My result is; r=1388806010725.1561527943? which is the VideoID & The Unix Time as parameter to the GetCCSufix method. But does only work some times on service. Most I will receive blank page.
    • Nasenbaer
      Nasenbaer about 10 years
      I mean, I use Java time, not Unix time. I think there is another issue on this service. Blank page error occurs on less watched videos only. But on website directly, it works always.
    • okipol
      okipol about 10 years
      Hey, Sorry for the great delay in anwsering -> New year leisure I guess. I'll answer it when I'll be back home.
    • okipol
      okipol about 10 years
      Can you give an example link to verify that the blank page occurs? They have to convert it first and probably then it's cached. But if it happens after that then it is odd.
    • Nasenbaer
      Nasenbaer about 10 years
      I think's its not allowed here. can you catch my by email to info on my goldengel.ch website?
    • DVassilev
      DVassilev over 8 years
      Any idea on how to deal with the new version of the API? @Nasenbaer
    • Nasenbaer
      Nasenbaer over 8 years
      No. It simple does not work at all. I created own service.
  • Xander
    Xander about 10 years
    This is awesome! I spent weeks on this! Thank you so much!
  • OmerFaruk
    OmerFaruk over 9 years
    My friend this url is deprecated. A new argument added at the end of the url. Please update your answer.
  • DVassilev
    DVassilev over 8 years
    @Raphaël Could you update your answer for the new version of the API?
  • Redoman
    Redoman almost 8 years
    Why not use youtubeinmp3.com/api - it has an official API. The only downside is that every few downloads they will redirect you to their website before starting the download... (but it's not the case if you do your homework good... ;)).
  • Redoman
    Redoman almost 8 years
    I just found youtubeinmp3.com has a daily download limit... :\