22// @name VIP视频破解
33// @name :en VIP Video Cracker
44// @namespace hoothin
5- // @version 1.5.0
5+ // @version 1.5.1
66// @description 解析并破解各大视频站的VIP权限
77// @description :en Crack VIP permissions of some chinese video sites
88// @author hoothin
3434// @grant GM_getValue
3535// @grant GM_openInTab
3636// @grant unsafeWindow
37+ // @grant GM_xmlhttpRequest
3738// @license MIT License
3839// ==/UserScript==
3940
6465 { name :"舞动秋天" , url :"http://qtzr.net/s/?qt=%s" } ,
6566 { name :"CloudParse" , url :"http://api.cloudparse.com/?url=%s" } ,
6667 { name :"迷失之梦" , url :"http://mt2t.com/yun?url=%s" }
67- ] , video ;
68+ ] , video , i = 0 ;
6869 var iqiyi = location . hostname . indexOf ( "iqiyi.com" ) != - 1 ;
6970 var vipVideoCrackJump = GM_getValue ( "vipVideoCrackJump" ) ;
7071 var vipVideoCrackUrl = GM_getValue ( "vipVideoCrackUrl" ) ;
9293 select . onchange = function ( ) {
9394 var value = select . options [ select . options . selectedIndex ] . value ;
9495 if ( value ) {
95- window . open ( value . replace ( "%s" , ( iqiyi ?decodeURIComponent ( document . querySelector ( ".sns-icon>li>a" ) . href . replace ( / .* u r l = ( .* ) % 3 F s r c .* / , "$1" ) ) :location . href . replace ( / # . * / , "" ) ) ) ) ;
96+ window . open ( value . replace ( "%s" , ( iqiyi && location . href . indexOf ( "#" ) != - 1 ?decodeURIComponent ( document . querySelector ( ".sns-icon>li>a" ) . href . replace ( / .* u r l = ( .* ) % 3 F s r c .* / , "$1" ) ) :location . href ) ) ) ;
9697 if ( value . indexOf ( "hacg.user.js" ) != - 1 ) {
9798 GM_setValue ( "hacgGodTurnVisited" , true ) ;
9899 select . options . remove ( select . options . selectedIndex ) ;
99100 } else {
100101 vipVideoCrackUrl = value ;
101102 GM_setValue ( "vipVideoCrackUrl" , vipVideoCrackUrl ) ;
102- if ( video . parentNode && ! iqiyi ) video . parentNode . replaceChild ( placeholder , video ) ;
103+ if ( video . parentNode ) video . parentNode . replaceChild ( placeholder , video ) ;
103104 }
104105 select . options . selectedIndex = 0 ;
105106 }
121122 function crackJump ( ) {
122123 if ( vipVideoCrackJump ) {
123124 var value = vipVideoCrackUrl ?vipVideoCrackUrl :cracks [ 0 ] . url ;
124- GM_openInTab ( value . replace ( "%s" , ( iqiyi && document . querySelector ( ".sns-icon>li>a" ) ? decodeURIComponent ( document . querySelector ( ".sns-icon>li>a" ) . href . replace ( / . * u r l = ( . * ) % 3 F s r c . * / , "$1" ) ) :location . href . replace ( / # . * / , "" ) ) ) , false ) ;
125- if ( video . parentNode && ! iqiyi ) video . parentNode . replaceChild ( placeholder , video ) ;
125+ GM_openInTab ( value . replace ( "%s" , ( iqiyi ? location . href . replace ( / # . * / , "" ) :location . href ) ) , false ) ;
126+ if ( video . parentNode ) video . parentNode . replaceChild ( placeholder , video ) ;
126127 }
127128 }
128129 var si = setInterval ( function ( ) {
154155 return replaceState . apply ( history , arguments ) ;
155156 } ;
156157 if ( iqiyi ) {
158+ document . querySelector ( '#widget-dramaseries' ) . addEventListener ( 'click' , function ( e ) {
159+ var target = e . target . parentNode ;
160+ if ( target . tagName != "LI" ) return ;
161+ GM_xmlhttpRequest ( {
162+ method : 'GET' ,
163+ url : "http://cache.video.qiyi.com/jp/vi/" + target . dataset . videolistTvid + "/" + target . dataset . videolistVid + "/?callback=crackIqiyi" ,
164+ onload : function ( result ) {
165+ var crackIqiyi = function ( d ) {
166+ location . href = d . vu ;
167+ } ;
168+ eval ( result . responseText ) ;
169+ }
170+ } ) ;
171+ } ) ;
157172 unsafeWindow . addEventListener ( "hashchange" , function ( ) {
158173 crackJump ( ) ;
159174 } ) ;
160175 }
161- } else {
162- //console.log("no player!");
176+ } else if ( i ++ > 10 ) {
177+ clearInterval ( si ) ;
178+ console . log ( "no player!" ) ;
163179 }
164180 } , 500 ) ;
165181} ) ( ) ;
0 commit comments