forked from jonashaag/blip.tv-download
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
34 lines (34 loc) · 1016 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!doctype html>
<h1>blip.tv downloader</h1>
<p>Enter video URL and press [Return]</p>
<input id=url autofocus>
<pre id=log></pre>
<script>
function log(s) {
document.getElementById('log').appendChild(
document.createTextNode(s+"\n"));
}
document.getElementById('url').onkeyup = function(evt) {
if(evt.keyCode != 13 || !this.value) return;
var id = /\d+$/.exec(this.value);
if(!id) {
log("invalid video id");
return;
}
try {
var req = new XMLHttpRequest();
req.open('GET', 'http://blip.tv/rss/flash/'+id, false);
req.send(null);
var urls = req.responseXML.getElementsByTagName('content');
for(var i=0; i<urls.length; i++) {
var url = urls[i].attributes;
if(!url.url) continue;
log(url.width.childNodes[0].data + 'x' + url.height.childNodes[0].data
+ ', ' + url.type.childNodes[0].data + ', '
+ ' --> ' + url.url.childNodes[0].data);
}
} catch(e) {
log(e)
}
}
</script>