diff --git a/app.py b/app.py index 32fb42d74a4d7e37f0820a2037b2c82ca7ea2469..5c13283d192934e51eaacc5c613477a8e7907801 100644 --- a/app.py +++ b/app.py @@ -53,8 +53,6 @@ def vod(): ctx,js_code = parser.runJs(js_path) rule = ctx.eval('rule') cms = CMS(rule) - print(cms) - print(cms.title) wd = getParmas('wd') ac = getParmas('ac') quick = getParmas('quick') @@ -66,9 +64,23 @@ def vod(): ext = getParmas('ext') ids = getParmas('ids') q = getParmas('q') - print(getParmas()) - return jsonify({'rule':rule,'js_code':js_code}) + if ac and t: # 一级 + data = cms.categoryContent(t,pg) + # print(data) + return jsonify(data) + if ac and ids: # 二级 + data = cms.detailContent(ids.split(',')) + # print(data) + return jsonify(data) + if wd: # 搜索 + data = cms.searchContent(wd) + # print(data) + return jsonify(data) + + # return jsonify({'rule':rule,'js_code':js_code}) + home_data = cms.homeContent() + return jsonify(home_data) if __name__ == '__main__': app.run(host="0.0.0.0", port=9000) \ No newline at end of file diff --git "a/js/\351\270\255\345\245\210\351\243\236.js" "b/js/\351\270\255\345\245\210\351\243\236.js" index 8def5666873b1b22d5ddbe766a7ce892c96c2e2a..830a77e15fcc892d53d19c226aeea300bfdc1fb7 100644 --- "a/js/\351\270\255\345\245\210\351\243\236.js" +++ "b/js/\351\270\255\345\245\210\351\243\236.js" @@ -1,7 +1,7 @@ var rule = { title:'鸭奈飞', url:'https://yanetflix.com/vodshow/fyclass--------fypage---.html', - detailUrl:'https://yanetflix.com/voddetail/fyid.html', + detailUrl:'https://yanetflix.com/voddetail/fyid.html',//非必填 // url:'https://yanetflix.com/vodshow/', searchUrl:'/vodsearch/**----------fypage---.html', ua:'MOBILE_UA', diff --git a/models/cms.py b/models/cms.py index 49ec190c814013862b7ae97eff435826a6a4ec73..c8b78571068115ac9a363ce6cf9be05e9f14e27f 100644 --- a/models/cms.py +++ b/models/cms.py @@ -121,8 +121,11 @@ class CMS: :return: """ # video-info-header - fyid = array[0] - url = self.detailUrl.replace('fyid', fyid) + fyid = str(array[0]) + if not fyid.startswith('http'): + url = self.detailUrl.replace('fyid', fyid) + else: + url = fyid print(url) headers = {'user-agent': self.ua} r = requests.get(url, headers=headers) @@ -203,7 +206,7 @@ class CMS: } return result - def searchContent(self, key, fypage=1,quick=1): + def searchContent(self, key, fypage=1): pg = str(fypage) url = self.searchUrl.replace('**', key).replace('fypage',pg) if not str(url).startswith('http'):