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_.*?=(.*?))[1]);log(html);var url=html.url;if(html.encrypt=='1'){url=unescape(url)}else if(html.encrypt=='2'){url=unescape(base64Decode(url))}if(/m3u8|mp4/.test(url)){input=url}else if(/qq|iqiyi/.test(url)){input={jx:0,url:'https://jx.m3u8.tv/jiexi/?url='+url,parse:1,header:JSON.stringify({'user-agent':'Mozilla/5.0'})}}else{input}", // searchUrl:'/search/**----------fypage---.html', - searchUrl:'/index.php/ajax/suggest?mid=1&wd=**', + searchUrl:'/index.php/ajax/suggest?mid=1&wd=**&pg=fypage', detailUrl:'/detail/fyid.html', //非必填,二级详情拼接链接 搜索:'json:list;name;pic;;id', } \ No newline at end of file diff --git a/js/drpy.txt b/js/drpy.txt index 72931b6..f2dde86 100644 --- a/js/drpy.txt +++ b/js/drpy.txt @@ -1 +1 @@ -{"showTime":89200000,"txt":"drpy 3.9.41beta16 -道长"} \ No newline at end of file +{"showTime":89200000,"txt":"drpy 3.9.41beta18 -道长"} \ No newline at end of file diff --git a/js/version.txt b/js/version.txt index 2b1c126..fd02056 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.41beta17 \ No newline at end of file +3.9.41beta18 \ No newline at end of file diff --git a/static/js/dzUtil.js b/static/js/dzUtil.js new file mode 100644 index 0000000..a4641e2 --- /dev/null +++ b/static/js/dzUtil.js @@ -0,0 +1,31 @@ +/** + * 扩展es6函数 fromEntries + * @param iterable + * @returns {*} + */ +Object.fromEntries = function fromEntries (iterable) { + return [...iterable].reduce((obj, [key, val]) => { + 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 @@ - +
- -Copyright © 2008-2022 技术支持:我爱电影网
+ +