2006-01-25 10:36:31 -05:00
|
|
|
/* Play videos at video.google.com with minimal niggling. Just follow the link
|
|
|
|
* from the front page or the search page, and the video will automatically
|
|
|
|
* be loaded. */
|
2006-01-27 22:23:17 -05:00
|
|
|
function load_google_video(cached, vs) {
|
2006-01-25 10:50:51 -05:00
|
|
|
if (!cached.uri.match(/^http:\/\/video.google.com\/videoplay/))
|
|
|
|
return true;
|
2006-01-25 10:36:31 -05:00
|
|
|
|
2006-03-12 14:11:26 -05:00
|
|
|
var re = /(?:videoUrl(?:\\u003d|=))(.*?)\&/;
|
2006-01-25 10:52:19 -05:00
|
|
|
var match = cached.content.match(re);
|
2006-03-12 14:11:26 -05:00
|
|
|
var url = unescape(match[1]);
|
2006-01-25 10:52:19 -05:00
|
|
|
var meta = '<meta http-equiv="refresh" content="1; url=' + url + '" />';
|
|
|
|
|
|
|
|
cached.content = cached.content.replace(/<head>/, "<head>" + meta);
|
2006-01-25 10:36:31 -05:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
elinks.preformat_html_hooks.push(load_google_video);
|