パソコンテレビ「GyaO(ギャオ)」総合スレ 41

このエントリーをはてなブックマークに追加
7名無しさん@お腹いっぱい。
// cnt2rtsp20060707.js
// 使い方の例
//  wscript.exe cnt2rtsp20060707.js cnt0123456
// GEの外部コマンド
//  表示名: なんでもいい
//  実行ファイル: wscript.exe
//  引数: cnt2rtsp20060707.js {ContentId}

//設定ここから
var curDir = "C:\\Program Files\\Windows Media Player";//実行ファイルのある場所
var exeFile = "wmplayer.exe";//実行ファイル名
var rateId = "bit0000002";//ビットレート 768kbps:bit0000002, 384kbps:bit0000001
//設定ここまで
if (WScript.Arguments.Count()<1){
WScript.Echo("コンテンツIDが指定されていない");
WScript.Quit();
}
var cntId = WScript.Arguments.Item(0);
var judgeCookieUrl = "http://www.gyao.jp/login/judge_cookie/?contentsId=" + cntId + "&rateId=" + rateId + "&login_from=shityou&chapterNo=&recommend=&contents_id=";
var re1 = /[^"]+asx\.php[^"]+/;
var re2 = /[^"]+gyaovod[^"]+/;
try {
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP");
xmlhttp.open("GET", judgeCookieUrl, false); xmlhttp.send();
xmlhttp.open("GET", xmlhttp.responseText.match(re1)[0], false); xmlhttp.send();
var videoUrl = xmlhttp.responseText.match(re2)[0];
var shell = WScript.CreateObject("WScript.Shell");
shell.CurrentDirectory = curDir;
shell.Run(exeFile + " " + videoUrl);
}catch (e){
WScript.Echo(e.message);
}