@@ -263,7 +263,7 @@ const pre = () => {
263
263
let rule = { } ;
264
264
// @ts -ignore
265
265
let vercode = typeof pdfl === 'function' ? 'drpy3.1' : 'drpy3' ;
266
- const VERSION = `${ vercode } 3.9.50beta19 202400526 ` ;
266
+ const VERSION = `${ vercode } 3.9.50beta20 202400528 ` ;
267
267
/** 已知问题记录
268
268
* 1.影魔的jinjia2引擎不支持 {{fl}}对象直接渲染 (有能力解决的话尽量解决下,支持对象直接渲染字符串转义,如果加了|safe就不转义)[影魔牛逼,最新的文件发现这问题已经解决了]
269
269
* Array.prototype.append = Array.prototype.push; 这种js执行后有毛病,for in 循环列表会把属性给打印出来 (这个大毛病需要重点排除一下)
@@ -279,7 +279,7 @@ const VERSION = `${vercode} 3.9.50beta19 202400526`;
279
279
280
280
/** 以下是内置变量和解析方法 **/
281
281
var MOBILE_UA =
282
- 'Mozilla/5.0 (Linux; Android 11; M2007J3SC Build/RKQ1.200826.002; wv ) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77 .0.3865.120 MQQBrowser/6.2 TBS/045714 Mobile Safari/537.36' ;
282
+ 'Mozilla/5.0 (Linux; Android 11; Pixel 5 ) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90 .0.4430.91 Mobile Safari/537.36' ;
283
283
const PC_UA =
284
284
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36' ;
285
285
const UA = 'Mozilla/5.0' ;
@@ -1569,7 +1569,7 @@ const verifyCode = (url) => {
1569
1569
// let submit_url = `${host}/index.php/ajax/verify_check`;
1570
1570
// let submit_body = `type=search&verify=${code}`;
1571
1571
1572
- let html : any = request ( submit_url , { headers : { Cookie : cookie , 'User-Agent' : MOBILE_UA } , method : 'POST' } ) ;
1572
+ let html : any = request ( submit_url , { headers : { Cookie : cookie } , method : 'POST' } ) ;
1573
1573
// let html: any = request(submit_url, { headers: { Cookie: cookie, 'User-Agent': MOBILE_UA }, method: 'POST',body:submit_body });
1574
1574
html = JSON . parse ( html ) ;
1575
1575
@@ -1708,6 +1708,13 @@ const request = (url: string, obj: any = undefined, ocr_flag: boolean = false) =
1708
1708
const keys = Object . keys ( headers ) . map ( ( it ) => it . toLowerCase ( ) ) ;
1709
1709
if ( ! keys . includes ( 'user-agent' ) ) {
1710
1710
headers [ 'User-Agent' ] = MOBILE_UA ;
1711
+ // fetch_params 里存在ua则优先,否则才默认手机UA
1712
+ if ( typeof ( fetch_params ) === 'object' && fetch_params && fetch_params . headers ) {
1713
+ let fetch_headers = keysToLowerCase ( fetch_params . headers ) ;
1714
+ if ( fetch_headers [ 'user-agent' ] ) {
1715
+ headers [ 'User-Agent' ] = fetch_headers [ 'user-agent' ] ;
1716
+ }
1717
+ }
1711
1718
}
1712
1719
if ( ! keys . includes ( 'referer' ) ) {
1713
1720
headers [ 'Referer' ] = getHome ( url ) ;
0 commit comments