How to use youtube-mp3.org api?

I was looking for an youtube to mp3 api and found this code:

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();

I think it's depricated now however this is the new youtube-mp3.orgs' API i think, http://www.youtube-mp3.org/get?video_id=KMU0tzLwhbE&ts_create=1465936462&r=MTEyLjE5OC4xMTguMTcy&h2=0cee970e770de6452d9d01ea95cd2133&s=60601, how can I apply it?

I also want to use this but I don;t know how to use and cannot understand the language.

https://github.com/victorsa/youtubetomp3

How can I call a function? a sample with explanation would be more acceptable

Upvotes: 0

Views: 1323

Answers (1)

KRONWALLED
KRONWALLED

Reputation: 1442

It is PHP.

Just call

YoutubeToMP3::get('http://www.youtube.com/watch?v=B2m_WnXjqnM', YoutubeToMP3::LINK);

if you want to get a link to the download or

YoutubeToMP3::get('http://www.youtube.com/watch?v=B2m_WnXjqnM', YoutubeToMP3::DOWNLOAD);

if you want to download it directly.

Upvotes: 1

Related Questions