From 1baff81ee32ad35798dff558a696037734bc1cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=9A=E9=A3=8E=E6=8B=82=E6=9F=B3=E9=A2=9C?= <434857005@qq.com> Date: Wed, 10 May 2023 11:52:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A8=A1=E6=9D=BF=E7=9A=84=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + controllers/vod.py | 3 +- controllers/web.py | 23 +- doc/windows搭建说明.md | 10 +- doc/更新日志.md | 4 + js/007影视.js | 2 +- js/drpy.txt | 2 +- js/version.txt | 2 +- static/js/dzUtil.js | 31 ++ templates/cms/mxpro/categoryContent.html | 489 ++++++++++++++++++++++- templates/cms/mxpro/detailContent.html | 21 +- templates/cms/mxpro/homeContent.html | 15 +- templates/cms/mxpro/searchContent.html | 386 +++++++++++++++++- 13 files changed, 951 insertions(+), 38 deletions(-) create mode 100644 static/js/dzUtil.js diff --git a/.gitignore b/.gitignore index 2460850..045de41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /tmp/dr_py-main/ /tmp/dr_py.zip /logs/dr.log +/static/js/.idea/ diff --git a/controllers/vod.py b/controllers/vod.py index 48b1964..dde2187 100644 --- a/controllers/vod.py +++ b/controllers/vod.py @@ -397,6 +397,7 @@ def vod_home(): t = getParmas('t') pg = getParmas('pg', '1') pg = int(pg) + # print('pg:',pg) q = getParmas('q') play_url = getParmas('play_url') @@ -450,7 +451,7 @@ def vod_home(): return multi_search(wd) # return multi_search2(wd) else: - data = cms.searchContent(wd) + data = cms.searchContent(wd, pg) # print(data) return jsonify(data) # return jsonify({'rule':rule,'js_code':js_code}) diff --git a/controllers/web.py b/controllers/web.py index 0a40de1..8b18605 100644 --- a/controllers/web.py +++ b/controllers/web.py @@ -47,16 +47,23 @@ def web_index(web_name, theme): ctx['url'] = request.url vod_id = getParmas('vod_id') vod_name = getParmas('vod_name') + wd = getParmas('wd') + pg = getParmas('pg') or '1' + tid = getParmas('tid') ctx['vod_id'] = vod_id ctx['vod_name'] = vod_name + ctx['wd'] = wd + ctx['pg'] = pg + ctx['tid'] = tid - if vod_id and vod_name: - try: + try: + if vod_id and vod_name: return render_template(f'cms/{theme}/detailContent.html', ctx=ctx) - except Exception as e: - return render_template('404.html', ctx=ctx, error=f'发生错误的原因可能是下面路径未找到:{e}') - else: - try: + elif wd: + return render_template(f'cms/{theme}/searchContent.html', ctx=ctx) + elif tid: + return render_template(f'cms/{theme}/categoryContent.html', ctx=ctx) + else: return render_template(f'cms/{theme}/homeContent.html', ctx=ctx) - except Exception as e: - return render_template('404.html', ctx=ctx, error=f'发生错误的原因可能是下面路径未找到:{e}') \ No newline at end of file + except Exception as e: + return render_template('404.html', ctx=ctx, error=f'发生错误的原因可能是下面路径未找到:{e}') \ No newline at end of file diff --git a/doc/windows搭建说明.md b/doc/windows搭建说明.md index f6989ee..da89c50 100644 --- a/doc/windows搭建说明.md +++ b/doc/windows搭建说明.md @@ -1,6 +1,6 @@ # Windows搭建说明 -###### qq官群1:714730084 -###### qq官群3:878847174 +###### Termux qq官群1:714730084 +###### Termux qq官群3:878847174 ##### [加群链接生成器](https://qun.qq.com/join.html) ##### [git图标生成器](https://github.com/badges/shields) @@ -40,7 +40,7 @@ docker run -it -p 5705:5705 -p 9001:9001 --restart=always --name drpy -d hjdhnx/ ## 方法二:使用python运行 ```shell #先将项目克隆到本地 -git clone https://gitcode.net/qq_32394351/dr_py.git +git clone https://github.com/hjdhnx/dr_py.git #进入目录 cd dr_py @@ -55,9 +55,9 @@ pip install -r requirements.txt python app.py ``` -若报错,请检查是否有python环境`python --version`,入如果没有,请到[python官网下载](https://www.python.org/) +若报错,请检查是否有python环境`python --version`,入如果没有,请到[淘宝python镜像站下载 python-3.8.8-amd64.exe](https://registry.npmmirror.com/binary.html?path=python/3.8.8/) 同样,没有错误提示的话就可以在**这台电脑打开**[链接](http://localhost:5705/index) --- -如果有问题,请提出[issue](https://code.gitlink.org.cn/api/v1/repos/hjdhnx/dr_py/issues?spm=1033.2243.3001.5874) \ No newline at end of file +如果有问题,请提出[issue](https://github.com/hjdhnx/dr_py/issues) \ No newline at end of file diff --git a/doc/更新日志.md b/doc/更新日志.md index ab7b876..bf3317b 100644 --- a/doc/更新日志.md +++ b/doc/更新日志.md @@ -1,3 +1,7 @@ +###### 2023/05/10 +- [X] 3.9.41beta18 后台管理预览源增加搜索页 +- [X] 修复js0搜索不支持翻页问题 +- [X] 更新windows搭建文档 ###### 2023/05/09 - [X] 3.9.41beta16 后台管理预览源增加详情页 diff --git a/js/007影视.js b/js/007影视.js index fc44953..9ab99c7 100644 --- a/js/007影视.js +++ b/js/007影视.js @@ -27,7 +27,7 @@ var rule = { lazy:"js:var html=JSON.parse(request(input).match(/r player_.*?=(.*?) { + obj[key] = val; + return obj; + }, {}); +}; + +/** + * + * @param url 原始接口链接,支持带参数 + * @param params_str 拼接搜索字符串 如 ?a=1&b=2 + * @returns {string} 返回拼接后的完整链接,支持带上原始接口链接的hash + */ +const buildUrl = function (url,params_str){ + const u = new URL(url); + const p = new URLSearchParams(params_str); + const api = u.origin + u.pathname; + let params = Object.fromEntries(u.searchParams.entries()); + let params_obj = Object.fromEntries(p.entries()); + Object.assign(params,params_obj); + let plist = []; + for(let key in params){ + plist.push(key+'='+params[key]); + } + return api + '?' + plist.join('&') + u.hash +}; \ No newline at end of file diff --git a/templates/cms/mxpro/categoryContent.html b/templates/cms/mxpro/categoryContent.html index 566549b..256c8c6 100644 --- a/templates/cms/mxpro/categoryContent.html +++ b/templates/cms/mxpro/categoryContent.html @@ -1,10 +1,491 @@ - + - - Title + 电影 - 我爱电影网 + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ + + +
+
+
+ +
+
+
+
+ 展开 + + 已选择:最新-电影 + + ,共检索到“48838”条结果 +
+ + +
+
    +
  • +
    + + + 电影 + 完结 + +
    +

    宇宙探索编辑部

    + +
    +
    +
  • +
  • +
    + + + 电影 + DVD + +
    +

    火船

    + +
    +
    +
  • +
  • +
    + + + 电影 + DVD + +
    +

    盒装美人

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    疯狂盯梢令

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    鬼精灵

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    哥斯拉之龙战四海

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    奸情一箩筐

    + +
    +
    +
  • +
  • +
    + + + 电影 + TC中字 + +
    +

    永生战士

    + +
    +
    +
  • +
  • +
    + + + 电影 + TC + +
    +

    银河护卫队3

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    自虐狂

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    心中的地图

    + +
    +
    +
  • +
  • +
    + + + 电影 + HD + +
    +

    王牌至尊

    + +
    +
    +
  • +
+
+
+ + +
+
+ +
+
+
+ + +
+ + +
+
+
+ + +

Copyright © 2008-2022 技术支持:我爱电影网 

+ +
+
+
+ +
+ +
+ + + +
+
+ +
+
+ + +
+ + + + + + + + + + + - \ No newline at end of file + diff --git a/templates/cms/mxpro/detailContent.html b/templates/cms/mxpro/detailContent.html index 61f4de6..6be9175 100644 --- a/templates/cms/mxpro/detailContent.html +++ b/templates/cms/mxpro/detailContent.html @@ -36,15 +36,16 @@