1+ // http://localhost:5757/api/人人视频?ac=list&t=1&pg=1
2+ // http://localhost:5757/api/人人视频?ac=detail&ids=447
3+ // http://localhost:5757/api/人人视频?wd=&pg=1
4+ // http://localhost:5757/api/人人视频?play=&flag=人人视频
5+ var rule = {
6+ 类型 : '影视' ,
7+ title : '人人视频' ,
8+ desc : '人人视频纯js版本' ,
9+ homeUrl :'' ,
10+ url : '/api.php/getappapi.index/typeFilterVodList' ,
11+ searchUrl : '/api.php/getappapi.index/searchList' ,
12+ searchable : 2 ,
13+ quickSearch : 0 ,
14+ headers : {
15+ 'User-Agent' : 'okhttp/3.14.9' ,
16+ 'Connection' : 'Keep-Alive' ,
17+ 'Accept-Encoding' : 'gzip' ,
18+ 'app-version-code' : '167' ,
19+ 'app-ui-mode' : 'light' ,
20+ 'Content-Type' : 'application/x-www-form-urlencoded; charset=UTF-8'
21+ } ,
22+ timeout : 5000 ,
23+ play_parse : true ,
24+ class_parse : async ( ) => {
25+ let classes = [ { "type_id" : "2" , "type_name" : "剧集" } , { "type_id" : "1" , "type_name" : "电影" } , {
26+ "type_id" : "3" ,
27+ "type_name" : "动漫"
28+ } , ] ;
29+ return {
30+ class : classes ,
31+ }
32+ } ,
33+ 预处理 : async ( ) => {
34+ let domain_config = {
35+ method :'GET' ,
36+ url :'http://111.180.203.165:9999/d/115/jiekou.txt'
37+ }
38+ rule . homeUrl = ( await req ( domain_config ) ) . content
39+ } ,
40+ 推荐 : async ( ) => {
41+ return [ ]
42+ } ,
43+ 一级 : async function ( tid , pg , filter , extend ) {
44+ let { MY_CATE , input} = this ;
45+ let page = pg || 1 ;
46+ if ( page === 0 ) page = 1 ;
47+ const data = {
48+ 'area' : '全部' ,
49+ 'year' : '全部' ,
50+ 'type_id' : MY_CATE ,
51+ 'page' : page ,
52+ 'sort' : '最新' ,
53+ 'lang' : '全部' ,
54+ 'class' : '全部'
55+ }
56+ let d = [ ] ;
57+ const html = JSON . parse ( ( await req ( rule . homeUrl + input , { method :'post' , data :data } ) ) . content ) ;
58+ let videos = JSON . parse ( category_decrypt ( html . data ) ) . recommend_list
59+ videos . forEach ( it => {
60+ d . push ( {
61+ title : it . vod_name ,
62+ url : it . vod_id ,
63+ desc : it . vod_blurb ,
64+ pic_url : it . vod_pic
65+ } )
66+ } )
67+ return setResult ( d )
68+ } ,
69+ 二级 : async function ( ids ) {
70+ let { input} = this ;
71+ let data = {
72+ 'vod_id' : ids [ 0 ]
73+ }
74+ let html = JSON . parse ( ( await req ( `${ rule . homeUrl } /api.php/getappapi.index/vodDetail` , { method :'post' , headers : {
75+ 'Content-Type' : 'application/json' ,
76+ 'User-Agent' : 'okhttp/3.14.9' ,
77+ 'Host' : `${ rule . homeUrl . replace ( 'https://' , '' ) } `
78+ } , data :data } ) ) . content ) ;
79+ let list = JSON . parse ( detail_decrypt ( html . data ) ) ;
80+ const vod = {
81+ vod_id : list . vod . vod_id ,
82+ vod_name : list . vod . vod_name ,
83+ vod_pic : list . vod . vod_pic ,
84+ vod_remarks : list . vod . vod_remarks
85+ } ;
86+ const playlist = list . vod_play_list
87+ let playmap = { } ;
88+ for ( const i in playlist ) {
89+ let form = playlist [ i ] . player_info . show
90+ const list = playlist [ i ] . urls
91+ if ( ! playmap . hasOwnProperty ( form ) ) {
92+ playmap [ form ] = [ ] ;
93+ }
94+ for ( const i in list ) {
95+ playmap [ form ] . push ( list [ i ] . name . trim ( ) + '$' + list [ i ] . parse_api_url . replace ( '$' , '' ) . replace ( '&' , '' ) ) ;
96+
97+ }
98+ }
99+ vod . vod_play_from = Object . keys ( playmap ) . join ( '$$$' ) ;
100+ const urls = Object . values ( playmap ) ;
101+ const playUrls = urls . map ( ( urllist ) => {
102+ return urllist . join ( "#" )
103+ } ) ;
104+ vod . vod_play_url = playUrls . join ( '$$$' ) ;
105+
106+ return vod
107+ } ,
108+ 搜索 : async function ( wd , quick , pg ) {
109+ let html = JSON . parse ( ( await req ( `${ rule . homeUrl } /api.php/getappapi.index/searchList` , {
110+ method :'post' ,
111+ data :{
112+ 'keywords' : wd ,
113+ 'type_id' : '0' ,
114+ 'page' : pg
115+ }
116+ } ) ) . content ) ;
117+ let d = [ ] ;
118+ let videos = JSON . parse ( detail_decrypt ( html . data ) ) . search_list
119+ videos . forEach ( it => {
120+ d . push ( {
121+ title : it . vod_name ,
122+ url : it . vod_id ,
123+ desc : it . vod_blurb ,
124+ pic_url : it . vod_pic
125+ } )
126+ } )
127+ return setResult ( d )
128+ } ,
129+ lazy : async function ( flag , id , flags ) {
130+ let { input} = this ;
131+ if ( id . indexOf ( 'm3u8' ) < 0 ) {
132+ let html = JSON . parse ( ( await req ( {
133+ url :id . replace ( 'ip=ip' , 'ip=$ip&' ) ,
134+ method :'post' ,
135+ headers : {
136+ 'User-Agent' : 'Mozilla/9.0 (Macintosh; Intel Mac OS X 10.8; rv:69.0) Gecko/20100101 Firefox/69.0'
137+ }
138+ } ) ) . content )
139+ let link = html . url
140+ return { parse : 0 , url : link , js : '' }
141+ } else {
142+ return { parse : 0 , url : input , js : '' }
143+ }
144+ } ,
145+ } ;
146+
147+ function encrypt ( word ) {
148+ const key = CryptoJS . enc . Utf8 . parse ( "31c93c7bc211d778" ) ;
149+ const iv = CryptoJS . enc . Utf8 . parse ( "31c93c7bc211d778" ) ;
150+ const encrypted = CryptoJS . AES . encrypt ( CryptoJS . enc . Utf8 . parse ( word ) , key , {
151+ iv : iv ,
152+ mode : CryptoJS . mode . CBC ,
153+ padding : CryptoJS . pad . Pkcs7
154+ } ) ;
155+ return encrypted . toString ( ) ;
156+ }
157+
158+ function category_decrypt ( word ) {
159+ const key = CryptoJS . enc . Utf8 . parse ( "31c93c7bc211d778" ) ;
160+ const iv = CryptoJS . enc . Utf8 . parse ( "33520 USB Digita" ) ;
161+ const decrypt = CryptoJS . AES . decrypt ( word , key , {
162+ iv : iv ,
163+ mode : CryptoJS . mode . CBC ,
164+ padding : CryptoJS . pad . Pkcs7
165+ } ) ;
166+ return decrypt . toString ( CryptoJS . enc . Utf8 ) ;
167+ }
168+
169+ function detail_decrypt ( word ) {
170+ const key = CryptoJS . enc . Utf8 . parse ( "31c93c7bc211d778" ) ;
171+ const iv = CryptoJS . enc . Utf8 . parse ( "31c93c7bc211d778" ) ;
172+ const decrypt = CryptoJS . AES . decrypt ( word , key , {
173+ iv : iv ,
174+ mode : CryptoJS . mode . CBC ,
175+ padding : CryptoJS . pad . Pkcs7
176+ } ) ;
177+ return decrypt . toString ( CryptoJS . enc . Utf8 ) ;
178+ }
0 commit comments