Skip to content

Instantly share code, notes, and snippets.

@Matthew238
Last active June 6, 2016 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Matthew238/1d3f4400bbb826102c907fca490cdb9c to your computer and use it in GitHub Desktop.
Save Matthew238/1d3f4400bbb826102c907fca490cdb9c to your computer and use it in GitHub Desktop.
高専ロボコン情報取得ツール(IE専用)
<!-- -*- encoding: utf-8 -*- -->
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
</style>
<script type="text/javascript" charset="UTF-8">
//<![CDATA[
var _vod_data={};
// 次の8個のハッシュには1行だけでもよいし、全部でもよい。
// {}の代わりに、b****_iframe.js の同じ番号の_vod_data[]に
// 代入されているものを代入すればよい。
_vod_data["1"] = {};
_vod_data["2"] = {};
_vod_data["3"] = {};
_vod_data["4"] = {};
_vod_data["5"] = {};
_vod_data["6"] = {};
_vod_data["7"] = {};
_vod_data["8"] = {};
// 次のハッシュには{}の代わりに、z******_iframe.js の同じ番号の_vod_data[]に
// 代入されているものを代入すればよい。
_vod_data["99"] = {};
var counter = 0;
var interval = 1000 * 100; //240 ; // 単位ミリ秒
function download( url, title ) {
var cmd = new ActiveXObject( "WScript.Shell" );
var dir = "c:\\Users\\user\\Videos\\"; // 任意
// VLC実行ファイルへのPATHとオプション
var vlc = "\"c:\\Program Files\\VideoLAN\\VLC\\vlc.exe\" -I dummy " + url +
" --sout=#transcode{vcodec=h264}:standard{mux=mp4,dst=\"" + dir +
title + ".mp4\",access=file} vlc://quit";
cmd.run( vlc, 0 );
console.log( '%s', vlc );
}
function downloads() {
var _current_vod_data;
counter = 0;
_current_vod_data = _vod_data[ "8" ];
_current_vod_data.clip.forEach( function( val, index ) {
var url;
var it_array;
if ( val.vod_flag == 1 ) {
it_array = val.box[ 0 ].clip_id.split( "_" );
// 次のアスタリスクで伏せてあるところを自分でみつけること
url = 'https://***-vh.akamaihd.net/i/*******-live/20**live/n' +
val.event_id + '_0_,1,2,_' + it_array[ 3 ] + '.mp4.csmil/master.m3u8';
console.log( '%s : %s : %s : %s',
val.event_id,
val.box[ 0 ].clip_id,
val.box[ 0 ].title,
url
);
var time = setTimeout( function() {
download( url, val.box[0].title );
}, interval * index );
}
});
}
//]]>
</script>
</head>
<body>
<div>
<input type="button" onclick="downloads()" value="マルチダウンロード" />
</div>
<div id="download"></div>
<div id="result"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment