From 61407aff45361043833c0e98a4a2199b6ecfd168 Mon Sep 17 00:00:00 2001 From: hjdhnx Date: Sat, 10 Sep 2022 09:30:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=BA=8C=E7=BA=A7?= =?UTF-8?q?=E9=87=8D=E5=AE=9A=E5=90=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/cms.py | 25 +++++++++++++++++++ js/version.txt | 2 +- "js/\345\260\217\345\274\272\350\277\267.js" | 15 +++++++++++ models/rules.db | Bin 40960 -> 40960 bytes readme.md | 4 ++- 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 "js/\345\260\217\345\274\272\350\277\267.js" diff --git a/controllers/cms.py b/controllers/cms.py index 1905469..04c4dad 100644 --- a/controllers/cms.py +++ b/controllers/cms.py @@ -765,6 +765,31 @@ class CMS: vod_play_from = '$$$' playFrom = [] + if p.get('重定向') and str(p['重定向']).startswith('js:'): + headers['Referer'] = getHome(url) + py_ctx.update({ + 'input': url, + 'html': html, + 'TYPE': 'detail', # 海阔js环境标志 + 'cateID': fyclass, # 当前分类 + 'fetch_params': {'headers': headers, 'timeout': self.d.timeout, 'encoding': self.d.encoding}, + 'd': self.d, + 'getParse': self.d.getParse, + 'saveParse': self.d.saveParse, + 'jsp': jsp, 'setDetail': setDetail, + }) + ctx = py_ctx + # print(ctx) + rcode = p['重定向'].replace('js:', '', 1) + jscode = getPreJs() + rcode + # print(jscode) + loader, _ = runJScode(jscode, ctx=ctx) + # print(loader.toString()) + logger.info(f'开始执行二级重定向代码:{rcode}') + html = loader.eval('html') + if isinstance(vod, JsObjectWrapper): + html = str(html) + if p.get('tabs'): # print(p['tabs'].split(';')[0]) vodHeader = pdfa(html,p['tabs'].split(';')[0]) diff --git a/js/version.txt b/js/version.txt index 8a0feb9..5141b61 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.4.3 \ No newline at end of file +3.4.4 \ No newline at end of file diff --git "a/js/\345\260\217\345\274\272\350\277\267.js" "b/js/\345\260\217\345\274\272\350\277\267.js" new file mode 100644 index 0000000..7ce1dbf --- /dev/null +++ "b/js/\345\260\217\345\274\272\350\277\267.js" @@ -0,0 +1,15 @@ +muban.首图2.二级.content = '.stui-content__desc&&Text'; +muban.首图2.二级.title = '.stui-content__detail&&h3&&Text;.stui-content__detail&&p:eq(1)&&Text;'; +muban.首图2.二级.重定向='js:let url = jsp.pd(html,".playbtn&&a&&href");log(url);html = request(url)'; +muban.首图2.二级.tabs='.t-ul&&li'; +muban.首图2.二级.lists='.stui-content__playlist:eq(#id)&&li'; + +var rule = Object.assign(muban.首图2,{ +title:'小强迷', +host:'http://xqmi.top', +url:'/index.php/vod/show/id/fyclass/page/fypage.html', +searchUrl:'/index.php/vod/search/page/fypage/wd/**.html', +searchable:1, +quickSearch:1, +搜索:'li.stui-vodlist__item;a&&title;a&&data-original;.pic-text&&Text;a&&href' +}); \ No newline at end of file diff --git a/models/rules.db b/models/rules.db index 55128d684d0163210f7a53c36e8b78434920dd5d..7f162051936025886c761008807a1aafedec958d 100644 GIT binary patch delta 132 zcmZoTz|?SnX@WH4jEOSNj59VSEa7LAnanC+$;5JcV`B=_<|RUkOyZpK;qtssP2|}a z05JV6VgLXD delta 102 zcmV-s0Ga=Qzyg540+1U4mysMp0hh60qz?fblLZhtv4Lg+v!oIs0uDbPS04@Ku#e}A ztL2ialYkj6vjG(Y3mzK|c>)i<4w?@T4&x7h4ulT>4%iOy4tWpV4=fLgvm_u#4v~-$ Ivw1FuaTL5GDF6Tf diff --git a/readme.md b/readme.md index 5d45f52..a2699b2 100644 --- a/readme.md +++ b/readme.md @@ -46,11 +46,13 @@ [dockerfile教程](https://blog.csdn.net/qq_46158060/article/details/125718218) [获取本地设备信息](https://blog.csdn.net/cui_yonghua/article/details/125508991) [获取本地设备信息](https://m.jb51.net/article/140716.htm) +###### 2022/09/10 +- [X] 1.升级至3.4.4.增加小强迷源,增加二级重定向属性(提供重定向后的源码,让代码重新取重定向过后的线路和播放列表) ###### 2022/09/09 - [X] 1.增加西瓜源,修复一级不支持lazy的bug - [X] 2.兄弟们dockerhub没法push镜像不知道咋回事,3.4.1的镜像自己用docker目录下的文件build吧 - [X] 3.版本升至3.4.2,增加py源支持,放txt/py目录即可,特别鸣谢Pyramid开发者及xiaoya liu提供的技术和源 -- [X] 3.版本升至3.4.3,增加了强制升级功能(本地增量覆盖大法) +- [X] 4.版本升至3.4.3,增加了强制升级功能(本地增量覆盖大法) ###### 2022/09/08 - [X] 1.升级到3.2.9,支持自动合并自定义用户配置(内置t4测试源) - [X] 2.升级到3.3.0,增加奇珍异兽源 -- GitLab