]*?id\s*=\s*("|')?player\1[^>]*>([\s\S]*?)<\/div\s*>/im ) ) {
text = RegExp.$2;
}
if ( text.match( /s1\.addParam\(\s*('|")flashvars\1\s*,\s*('|")(.*?)\2\s*\)\s*;/ ) ) {
var fvs = RegExp.$3;
}
if ( !fvs ) return null;
if ( ("&"+fvs).match( /&proxy\.link=([^&]+)/ ) ) {
var src = decodeURIComponent( RegExp.$1 );
}
if ( !src ) return null;
if ( src.match( /^free4unow\*(.*)/ ) ) {
src = RegExp.$1;
if ( src.match( /^[0-9a-f]+$/ ) ) {
src = new clsAES_free4unow().decrypt( src );
}
}
if ( !src ) return null;
var objS = { "src": src };
if ( !setType( objS ) ) return null;
var msg = "";
switch ( objS.type ) {
case "xvideos":
case "hardsextube":
case "xhamster":
case "flashxtv":
case "playvid":
case "redtube":
if ( !objS.script ) break;
var objInc = new clsIncludeSiteScript();
if ( !objInc.isOK ) break;
var objScript = objInc.includeSiteScript( objS.script );
if ( !objScript ) {
msg = "script=" + objS.script + "\nスクリプトの読み込みに失敗。";
break;
}
if ( !objScript.isSiteUrl( objS.src ) ) {
msg = "script=" + objS.script + "\nURL不適合。";
break;
}
rtn = objScript.getVideoDetail( objS.src );
if ( !rtn ) {
msg = "script=" + objS.script + "\n動画URL取得失敗。";
break;
}
objInc.replaceTitle( rtn, title );
return rtn;
break;
case "picasa":
if ( typeof objS.func != "function" ) break;
var objRtn = objS.func( {"url":objS.src, "base":"http://free4unow.com/player/" }, craving );
if ( objRtn ) {
objRtn.videoTitle0 = title;
return objRtn;
}
msg = "動画URL取得失敗。";
break;
case "direct":
return { "videoUrl0": objS.src, "videoTitle0": title };
break;
case "unknown":
msg = "未対応。";
break;
default:
}
if ( _JAVFULL.showMsg ) showMsg( objS.src, msg );
return null;
}
/* decrypt */
function clsAES_free4unow() {
var keySize = 192;
var blockSize = 128;
var mode = "ECB";
var key = "6d736f346b6774696935756d677734337a386a66";
var keySizeInByte = keySize / 8;
var objAES = new clsAES( keySize, blockSize );
var arrKey = objAES.hexToByteArray( key );
var diff = keySizeInByte - arrKey.length;
if ( diff < 0 ) arrKey = arrKey.slice( 0, keySizeInByte );
else if ( diff > 0 ) for ( var i = 0; i < diff; i++ ) arrKey.push( 0 );
function decrypt_gk( strHex ) {
var arrTxt = objAES.hexToByteArray( strHex );
try {
var arrRet = objAES.rijndaelDecrypt( arrTxt, arrKey, mode );
} catch( e ) {
arrRet = undefined;
}
if ( !arrRet || !( arrRet instanceof Array ) ) return "";
else return objAES.byteArrayToString( arrRet );
}
this.decrypt = decrypt_gk;
}
function clsAES( intKeySize, intBlockSize ) {
//Fritz Schneider 氏の rijndael.js を使っています。
//Google Closure Compilerを用いて最適化してあります。
/* rijndael.js ここから */
/* rijndael.js Rijndael Reference Implementation
Copyright (c) 2001 Fritz Schneider
This software is provided as-is, without express or implied warranty.
Permission to use, copy, modify, distribute or sell this software, with or
without fee, for any purpose and by any individual or organization, is hereby
granted, provided that the above copyright notice and this paragraph appear
in all copies. Distribution as a part of an application or binary must
include the above copyright notice in the documentation and/or other materials
provided with the application or distribution.
As the above disclaimer notes, you are free to use this code however you
want. However, I would request that you send me an email
(fritz /at/ cs /dot/ ucsd /dot/ edu) to say hi if you find this code useful
or instructional. Seeing that people are using the code acts as
encouragement for me to continue development. If you *really* want to thank
me you can buy the book I wrote with Thomas Powell, _JavaScript:
_The_Complete_Reference_ :)
This code is an UNOPTIMIZED REFERENCE implementation of Rijndael.
If there is sufficient interest I can write an optimized (word-based,
table-driven) version, although you might want to consider using a
compiled language if speed is critical to your application. As it stands,
one run of the monte carlo test (10,000 encryptions) can take up to
several minutes, depending upon your processor. You shouldn't expect more
than a few kilobytes per second in throughput.
Also note that there is very little error checking in these functions.
Doing proper error checking is always a good idea, but the ideal
implementation (using the instanceof operator and exceptions) requires
IE5+/NS6+, and I've chosen to implement this code so that it is compatible
with IE4/NS4.
And finally, because JavaScript doesn't have an explicit byte/char data
type (although JavaScript 2.0 most likely will), when I refer to "byte"
in this code I generally mean "32 bit integer with value in the interval
[0,255]" which I treat as a byte.
See http://www-cse.ucsd.edu/~fritz/rijndael.html for more documentation
of the (very simple) API provided by this code.
Fritz Schneider
fritz at cs.ucsd.edu
*/
var keySizeInBits=128,blockSizeInBits=128,roundsArray=[,,,,[,,,,10,,12,,14],,[,,,,12,,12,,14],,[,,,,14,,14,,14]],shiftOffsets=[,,,,[,1,2,3],,[,1,2,3],,[,1,3,4]],Rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],SBox=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,
178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,
75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],SBoxInverse=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,
80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,
160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125];function cyclicShiftLeft(a,c){var b=a.slice(0,c);return a=a.slice(c).concat(b)}var Nk=keySizeInBits/32,Nb=blockSizeInBits/32,Nr=roundsArray[Nk][Nb];function xtime(a){a<<=1;return a&256?a^283:a}function mult_GF256(a,c){var b,d=0;for(b=1;256>b;b*=2,c=xtime(c))a&b&&(d^=c);return d}
function byteSub(a,c){var b;b="encrypt"==c?SBox:SBoxInverse;for(var d=0;4>d;d++)for(var e=0;e
b;b++)a[b]="encrypt"==c?cyclicShiftLeft(a[b],shiftOffsets[Nb][b]):cyclicShiftLeft(a[b],Nb-shiftOffsets[Nb][b])}
function mixColumn(a,c){for(var b=[],d=0;de;e++)b[e]="encrypt"==c?mult_GF256(a[e][d],2)^mult_GF256(a[(e+1)%4][d],3)^a[(e+2)%4][d]^a[(e+3)%4][d]:mult_GF256(a[e][d],14)^mult_GF256(a[(e+1)%4][d],11)^mult_GF256(a[(e+2)%4][d],13)^mult_GF256(a[(e+3)%4][d],9);for(e=0;4>e;e++)a[e][d]=b[e]}}function addRoundKey(a,c){for(var b=0;b>8&255,a[2][b]^=c[b]>>16&255,a[3][b]^=c[b]>>24&255}
function keyExpansion(a){var c=[];Nk=keySizeInBits/32;Nb=blockSizeInBits/32;Nr=roundsArray[Nk][Nb];for(var b=0;b>8&255]|SBox[a>>16&255]<<8|SBox[a>>24&255]<<16|SBox[a&255]<<24)^Rcon[Math.floor(b/Nk)-1]:6>24&255]<<24|SBox[a>>16&255]<<16|SBox[a>>8&255]<<8|SBox[a&255]),c[b]=c[b-Nk]^a;return c}
function Round(a,c){byteSub(a,"encrypt");shiftRow(a,"encrypt");mixColumn(a,"encrypt");addRoundKey(a,c)}function InverseRound(a,c){addRoundKey(a,c);mixColumn(a,"decrypt");shiftRow(a,"decrypt");byteSub(a,"decrypt")}function FinalRound(a,c){byteSub(a,"encrypt");shiftRow(a,"encrypt");addRoundKey(a,c)}function InverseFinalRound(a,c){addRoundKey(a,c);shiftRow(a,"decrypt");byteSub(a,"decrypt")}
function encrypt(a,c){var b;if(a&&8*a.length==blockSizeInBits&&c){a=packBytes(a);addRoundKey(a,c);for(b=1;ba[b]?"0":"")+a[b].toString(16);return c}}function hexToByteArray(a){var c=[];if(!(a.length%2)){if(0==a.indexOf("0x")||0==a.indexOf("0X"))a=a.substring(2);for(var b=0;b]*?\])\s*[},]/ ) ) {// php return partial text
if ( text.match( /content("|')?\s*:\s*(\[[^>]*?\])/m ) ) {
var cont = RegExp.$2;
}
if ( !cont ) return null;
try {
var arrCnt = ( new Function( "var a=" + cont + ";return a;" ) )();
} catch( e ) {
arrCnt = undefined;
}
if ( !arrCnt || !( arrCnt instanceof Array ) ) return null;
var arrDat = [];
for ( var i = 0; i < arrCnt.length; i++ ) {
if ( !arrCnt[i] || typeof arrCnt[i] != "object" ) continue;
if ( typeof arrCnt[i].type == "string" && arrCnt[i].type.match( /^\s*image\// ) ) continue;
if ( !arrCnt[i].url || typeof arrCnt[i].url != "string" ) continue;
if ( typeof arrCnt[i].width != "number" ) arrCnt[i].width = 0;
if ( typeof arrCnt[i].height != "number" ) arrCnt[i].height = 0;
if ( typeof arrCnt[i].itag == "number" ) var itag = arrCnt[i].itag + "";
else itag = arrCnt[i].url.match( /[?&]itag=(\d+)/ )? RegExp.$1: "0";
arrCnt[i].prior = objG.YouTube_HD[ itag ]? objG.YouTube_HD[ itag ]: 0;
arrDat.push( arrCnt[i] );
}
if( arrDat.length <= 0 ) return null;
arrDat.reverse();
arrDat.sort( function(a,b){
if ( b.prior != a.prior ) return b.prior - a.prior;
if ( b.width != a.width ) return b.width - a.width;
return b.height - a.height;
} );
realUrl = arrDat[0].url;
if ( !realUrl ) return null;
if ( objRef.text.match( /]*?name\s*=\s*("|')?title\2[^>]*)>/i )
&& RegExp.$1.match( /\s+content\s*=\s*("|')(.*?)\1/i ) ) {
var title = RegExp.$2;
}
if ( !title ) title = "picase_" + ( photo_id || (new Date()).getTime() );
title = title.replace(/[\\\/:*?"<>|]/g, "_");
return { videoTitle0: title, videoUrl0: realUrl };
}
function clsIncludeSiteScript() {
var code1 = "(function(){\n\n";
var code2 = "\n\nreturn {'isSiteUrl':isSiteUrl,'getVideoDetail':getVideoDetail};})()";
var cePath = "\\CravingExplorer\\site-script\\";
this.isOK = false;
//initialize
try {
var appPath = ( new ActiveXObject( "WScript.Shell" ) ).SpecialFolders( "AppData" );
this.isOK = true;
} catch( e ) {
appPath = "";
this.isOK = false;
}
function evalScript( strFullPath, strCharset ) {
try {
var objStream = new ActiveXObject( "ADODB.Stream" );
objStream.Charset = strCharset;
objStream.Open();
objStream.LoadFromFile( strFullPath );
var obj = eval( "(" + code1 + objStream.ReadText() + code2 + ")" );
objStream.Close();
} catch( e ) {
obj = null;
}
if ( !obj || typeof obj != "object" ) return null;
if ( typeof obj.isSiteUrl != "function" ) return null;
if ( typeof obj.getVideoDetail != "function" ) return null;
return obj;
}
this.includeSiteScript = function ( strFileName ) {
if ( !this.isOK ) return null;
var strFullPath = appPath + cePath + strFileName;
var objS = evalScript( strFullPath, "unicode" );
if ( !objS ) objS = evalScript( strFullPath, "utf-8" );
return objS;
};
this.replaceTitle = function ( objRtn, title ) {
var count = 0;
var safe = 300;
while ( count < safe ) {
if ( objRtn[ "videoTitle" + count ] == undefined ) break;
count++;
}
if ( count <= 1 ) {
objRtn.videoTitle0 = title;
} else {
for ( var i = 0; i < count; i++ ) {
objRtn[ "videoTitle" + i ] = title + "_" + ( (i<9)?("0"+(i+1)):(""+(i+1)) );
}
}
return objRtn;
};
}
function showMsg( src, ps ) {
var objBx = new clsMsgBox();
if ( objBx.isOK ) {
objBx.MsgBox( "取得できませんでした。"
+ "\n動画配信元:\n" + src
+ ( ps? ("\n\n" + ps): "" )
, "from avmuryou.site.js", 0 );
}
}
/* msgbox */
function clsMsgBox(){
//WScript.Shell Popup
this.isOK = false;
this._objShell = null;
this._initialize = function (){
try{
this._objShell = new ActiveXObject( "WScript.Shell" );
this.isOK = true;
} catch( e ) {
this.isOK = false;
}
}
this._initialize();
this.MsgBox = function ( msg, title, btn ){
if ( btn == undefined ) btn = 1;
//btn=1の時ret: OK:1, キャンセル:2
if ( this.isOK )
return this._objShell.Popup( msg, 0, title, btn+64 );
}
}
/* msgbox */