如何使用 youtube-mp3.org api? [英] How to use youtube-mp3.org api?
问题描述
我正在寻找一个 youtube 到 mp3 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();
我认为它现在已弃用,但我认为这是新的 youtube-mp3.orgs API, http://www.youtube-mp3.org/get?video_id=KMU0tzLwhbE&ts_create=1465936462&r=MTEyLjE5OC4xMTguMTcy&h2=0cee970e770de6452d9d01ea95cd2133&s=60601,如何申请?
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
推荐答案
是 PHP.
直接打电话
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);
如果你想直接下载.
这篇关于如何使用 youtube-mp3.org api?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!