Skip to content

Instantly share code, notes, and snippets.

@mgng
Created June 9, 2010 07:32
Show Gist options
  • Save mgng/431172 to your computer and use it in GitHub Desktop.
Save mgng/431172 to your computer and use it in GitHub Desktop.
ustream recorded flv 抽出
(function(){
function f(u){
var a=document.createElement('a'),p=document.createElement('p');
a.href=a.innerHTML=u;
a.target='blank';
p.appendChild(a);
return p;
}
function l(u){
var t=u.split('/'),f=t[9].split('_'),r=[],i=1,l=4;
f=[f[0],f[1],f[2]].join('_')+'.flv';
for(;i<=l;i++){
r.push(['http://ustream.vo.llnwd.net/pd'+i,t[4],t[5],t[6],t[7],t[8],f].join('/'));
}
return r;
}
if (Ustream.Vars.liveHttpUrl){
document.body.appendChild(f(Ustream.Vars.liveHttpUrl));
return;
}
if (Ustream.Vars.videoPictureUrl){
var ul=l(Ustream.Vars.videoPictureUrl);
for(var i=0,l=ul.length;i<l;i++){
document.body.appendChild(f(ul[i]));
}
return;
}
alert('not found.');
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment