diff --git a/app.py b/app.py index b3e7ecfa2c63da2bc49b40fd61e97647737dfdbc..c7cf03b24c5f6b5e51404f7c1ef5f114b243a909 100644 --- a/app.py +++ b/app.py @@ -7,6 +7,7 @@ import random from utils.encode import base64Encode import js2py from flask_sqlalchemy import SQLAlchemy +from flask_migrate import Migrate import config # import settings import warnings @@ -32,7 +33,7 @@ print('自定义播放解析地址:',app.config.get('PLAY_URL')) print('当前操作系统',sys.platform) app.logger.name="drLogger" db = SQLAlchemy(app) - +migrate = Migrate(app, db) rule_list = getRuleLists() logger.info(rule_list) logger.info(f'局域网: {getHost(1, 5705)}/index\n本地: {getHost(0, 5705)}/index') @@ -104,6 +105,7 @@ def vod(): # rule = ctx.eval('rule') ruleDict = ctx.rule.to_dict() ruleDict['id'] = rule # 把路由请求的id装到字典里,后面播放嗅探才能用 + # print(ruleDict) # print(rule) # print(type(rule)) # print(ruleDict) diff --git a/classes/cms.py b/classes/cms.py index 39aa21ca1590b0ad428a7cafaa926336b61dd60c..88cfcf3e65ee1ab74ae7218b98cff081702aec3a 100644 --- a/classes/cms.py +++ b/classes/cms.py @@ -11,7 +11,7 @@ from utils.web import * from models import * from utils.config import config from utils.log import logger -from utils.encode import base64Encode,baseDecode,fetch,post,request,getCryptoJS,getPreJs,buildUrl +from utils.encode import base64Encode,baseDecode,fetch,post,request,getCryptoJS,getPreJs,buildUrl,getHome,verifyCode from utils.safePython import safePython from utils.parser import runPy,runJScode from utils.htmlParser import jsoup @@ -23,7 +23,7 @@ from easydict import EasyDict as edict py_ctx = { 'requests':requests,'print':print,'base64Encode':base64Encode,'baseDecode':baseDecode, 'log':logger.info,'fetch':fetch,'post':post,'request':request,'getCryptoJS':getCryptoJS, -'buildUrl':buildUrl +'buildUrl':buildUrl,'getHome':getHome,'verifyCode':verifyCode } # print(getCryptoJS()) @@ -35,12 +35,19 @@ class CMS: self.id = rule.get('id', self.title) self.lazy = rule.get('lazy', False) self.play_disable = new_conf.get('PLAY_DISABLE',False) + self.retry_count = new_conf.get('RETRY_CNT',3) self.lazy_mode = new_conf.get('LAZYPARSE_MODE') - self.vod = redirect(url_for('vod')).headers['Location'] + try: + self.vod = redirect(url_for('vod')).headers['Location'] + except: + self.vod = '/vod' # if not self.play_disable and self.lazy: if not self.play_disable: self.play_parse = rule.get('play_parse', False) - play_url = getHost(self.lazy_mode) + try: + play_url = getHost(self.lazy_mode) + except: + play_url = getHost(1,5705) # play_url = new_conf.get('PLAY_URL',getHost(2)) if not play_url.startswith('http'): play_url = 'http://'+play_url @@ -65,6 +72,10 @@ class CMS: detailUrl = rule.get('detailUrl','') searchUrl = rule.get('searchUrl','') headers = rule.get('headers',{}) + cookie = self.getCookie() + # print(f'{self.title}cookie:{cookie}') + if cookie: + headers['cookie'] = cookie limit = rule.get('limit',6) encoding = rule.get('编码', 'utf-8') self.limit = min(limit,30) @@ -81,6 +92,8 @@ class CMS: lower_keys = list(map(lambda x:x.lower(),keys)) if not 'user-agent' in lower_keys: headers['User-Agent'] = UA + if not 'referer' in lower_keys: + headers['Referer'] = host self.headers = headers self.host = host self.homeUrl = urljoin(host,homeUrl) if host and homeUrl else homeUrl @@ -180,6 +193,8 @@ class CMS: res = self.db.session.query(self.RuleClass).filter(self.RuleClass.name == name).first() # _logger.info('xxxxxx') if res: + if not all([res.class_name,res.class_url]): + return [] cls = res.class_name.split('&') cls2 = res.class_url.split('&') classes = [{'type_name':cls[i],'type_id':cls2[i]} for i in range(len(cls))] @@ -189,6 +204,37 @@ class CMS: else: return [] + def getCookie(self): + name = self.getName() + if not self.db: + msg = f'{name}未提供数据库连接' + print(msg) + return False + res = self.db.session.query(self.RuleClass).filter(self.RuleClass.name == name).first() + if res: + return res.cookie or None + else: + return None + + def saveCookie(self,cookie): + name = self.getName() + if not self.db: + msg = f'{name}未提供数据库连接' + print(msg) + return False + res = self.db.session.query(self.RuleClass).filter(self.RuleClass.name == name).first() + if res: + res.cookie = cookie + self.db.session.add(res) + else: + res = self.RuleClass(name=name, cookie=cookie) + self.db.session.add(res) + try: + self.db.session.commit() + logger.info(f'{name}已保存cookie:{cookie}') + except Exception as e: + return f'保存cookie发生了错误:{e}' + def saveClass(self, classes): if not self.db: msg = '未提供数据库连接' @@ -305,18 +351,18 @@ class CMS: html = r.text if self.class_parse and not has_cache: p = self.class_parse.split(';') - print(p) + # print(p) jsp = jsoup(self.url) pdfh = jsp.pdfh pdfa = jsp.pdfa pd = jsp.pd items = pdfa(html,p[0]) - print(len(items)) - print(items) + # print(len(items)) + # print(items) for item in items: title = pdfh(item, p[1]) url = pd(item, p[2]) - print(url) + # print(url) tag = url if len(p) > 3 and p[3].strip(): tag = self.regexp(p[3].strip(),url,0) @@ -626,9 +672,22 @@ class CMS: pq = jsp.pq videos = [] try: - r = requests.get(url, headers=self.headers) + r = requests.get(url, headers=self.headers,timeout=self.timeout) r.encoding = self.encoding html = r.text + # print(html) + if html.find('输入验证码') > -1: + cookie = verifyCode(url,self.headers,self.timeout,self.retry_count) + if not cookie: + return { + 'list': videos + } + self.saveCookie(cookie) + self.headers['cookie'] = cookie + r = requests.get(url, headers=self.headers, timeout=self.timeout) + r.encoding = self.encoding + html = r.text + items = pdfa(html, p[0]) # print(items) videos = [] @@ -709,10 +768,14 @@ if __name__ == '__main__': from utils import parser # js_path = f'js/玩偶姐姐.js' # js_path = f'js/555影视.js' + with open('../js/模板.js', encoding='utf-8') as f: + before = f.read() js_path = f'js/cokemv.js' - ctx, js_code = parser.runJs(js_path) - rule = ctx.eval('rule') - cms = CMS(rule) + ctx, js_code = parser.runJs(js_path,before=before) + ruleDict = ctx.rule.to_dict() + # ruleDict['id'] = rule # 把路由请求的id装到字典里,后面播放嗅探才能用 + + cms = CMS(ruleDict) print(cms.title) print(cms.homeContent()) # print(cms.categoryContent('5',1)) @@ -721,4 +784,4 @@ if __name__ == '__main__': # print(cms.detailContent(1,['https://cokemv.me/voddetail/40573.html'])) # cms.categoryContent('dianying',1) # print(cms.detailContent(['67391'])) - # print(cms.searchContent('斗罗大陆')) \ No newline at end of file + print(cms.searchContent('斗罗大陆')) \ No newline at end of file diff --git a/commands.txt b/commands.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3d8f964786ccb00a556064faa0e6c3530ee566f --- /dev/null +++ b/commands.txt @@ -0,0 +1,15 @@ +flask db init +flask db migrate +flask db upgrade + + +废弃操作仅限 flask-migrate==2.7.0: +# # 导入数据迁移核心类 +# from flask_migrate import Migrate +# from flask_script import Manager +# manager = Manager(app) +# 初始化数据迁移 +# migrate = Migrate(app, db) +# manager.add_command('sql', MigrateCommand) +# python app.py sql migrate -m “init” +# python app.py sql upgrade \ No newline at end of file diff --git a/config.py b/config.py index 994c6c30c9967daa3cc891cdbccd6a046319b452..9b7263d8f18021482f80d6b69d93bd8bbb8d60eb 100644 --- a/config.py +++ b/config.py @@ -24,4 +24,5 @@ LAZYPARSE_MODE = 1 # 播放解析模式(0 本地 1 局域网 2远程 仅在全 WALL_PAPER_ENABLE = True # 启用自定义壁纸 WALL_PAPER = "https://picsum.photos/1280/720/?blur=10" # 自定义壁纸,可注释 SUP_PORT = 9001 # supervisord 服务端口 +RETRY_CNT = 3 # 验证码重试次数 # {% if config.WALL_PAPER %}"wallpaper":"{{ config.WALL_PAPER }}",{% endif %} \ No newline at end of file diff --git "a/js/555\345\275\261\350\247\206.js" "b/js/555\345\275\261\350\247\206.js" index b4343eded73b687b42bdbe9322f4b80b85658c21..61586ab2f43bcc9cc36099935086217aaa40d7e8 100644 --- "a/js/555\345\275\261\350\247\206.js" +++ "b/js/555\345\275\261\350\247\206.js" @@ -1,6 +1,10 @@ var rule = Object.assign(muban.mxpro,{ title:'555影视', host:'https://www.5dy6.cc', +headers:{//网站的请求头,完整支持所有的,常带ua和cookies + 'User-Agent':'MOBILE_UA', + "Cookie": "searchneed=ok" +}, searchable:1, quickSearch:1, }); \ No newline at end of file diff --git a/js/cokemv.js b/js/cokemv.js index 1f4a3d2db34336c34ed55ec984a410b3f88a3394..df775d55704ce8e39fdddba3655e4cb866b2a870 100644 --- a/js/cokemv.js +++ b/js/cokemv.js @@ -2,4 +2,6 @@ var rule = Object.assign(muban.mxpro,{ title:'cokemv', host:'https://cokemv.me', class_parse:'.navbar-items li:gt(1):lt(7);a&&Text;a&&href;/(\\d+).html', +searchable:1, +quickSearch:1, }); \ No newline at end of file diff --git "a/js/\345\234\250\347\272\277\344\271\213\345\256\266.js" "b/js/\345\234\250\347\272\277\344\271\213\345\256\266.js" new file mode 100644 index 0000000000000000000000000000000000000000..231e21d43cccbdea6af15ae6be37a5e47557a9c3 --- /dev/null +++ "b/js/\345\234\250\347\272\277\344\271\213\345\256\266.js" @@ -0,0 +1,4 @@ +var rule = Object.assign(muban.首图2,{ +title:'在线之家', +host:'https://zxzj.vip', +}); \ No newline at end of file diff --git "a/js/\345\244\234\347\251\272.js" "b/js/\345\244\234\347\251\272.js" index fb75453d52aaad4b3832165dbbe4bb53483a8b54..7006435db401a6811a4777596a5997c1e3d858ed 100644 --- "a/js/\345\244\234\347\251\272.js" +++ "b/js/\345\244\234\347\251\272.js" @@ -3,7 +3,7 @@ title:'夜空', host:'https://www.yekong.cc', url:'/pianku-fyclass--------fypage---/', searchUrl:'/search-**----------fypage---/', -searchable:0, +searchable:1, quickSearch:0, class_parse:'.navbar-items li:gt(1):lt(7);a&&Text;a&&href;.*v/(.*?)/', }); \ No newline at end of file diff --git "a/js/\345\275\261\350\247\206\345\267\245\345\216\202.js" "b/js/\345\275\261\350\247\206\345\267\245\345\216\202.js" new file mode 100644 index 0000000000000000000000000000000000000000..5fb5b1f8caa03648eb904c31c2401d95a59b5f4c --- /dev/null +++ "b/js/\345\275\261\350\247\206\345\267\245\345\216\202.js" @@ -0,0 +1,6 @@ +var rule = Object.assign(muban.首图,{ +title:'影视工厂', +host:'https://www.ysgc.cc', +searchable:1, +quickSearch:1, +}); \ No newline at end of file diff --git "a/js/\346\250\241\346\235\277.js" "b/js/\346\250\241\346\235\277.js" index 8fc98fb481735daefcf9ec98a99469c0c668c4d6..26be864bf050dc951ab7d203006708551478a6f8 100644 --- "a/js/\346\250\241\346\235\277.js" +++ "b/js/\346\250\241\346\235\277.js" @@ -21,7 +21,7 @@ var muban = { quickSearch:0,//是否启用快速搜索, headers:{//网站的请求头,完整支持所有的,常带ua和cookies 'User-Agent':'MOBILE_UA', - "Cookie": "searchneed=ok" + // "Cookie": "searchneed=ok" }, class_parse:'.navbar-items li:gt(2):lt(8);a&&Text;a&&href;/(\\d+).html', play_parse:true, @@ -32,6 +32,48 @@ var muban = { 一级:'body a.module-poster-item.module-item;a&&title;.lazyload&&data-original;.module-item-note&&Text;a&&href', 二级:{"title":"h1&&Text;.module-info-tag&&Text","img":".lazyload&&data-original","desc":".module-info-item:eq(1)&&Text;.module-info-item:eq(2)&&Text;.module-info-item:eq(3)&&Text","content":".module-info-introduction&&Text","tabs":".module-tab-item","lists":".module-play-list:eq(#id) a"}, 搜索:'body .module-item;.module-card-item-title&&Text;.lazyload&&data-original;.module-item-note&&Text;a&&href;.module-info-item-content&&Text', +}, +首图:{ + title:'', + host:'', + url:'/vodshow/fyclass--------fypage---/', + searchUrl:'/vodsearch/**----------fypage---.html', + searchable:0,//是否启用全局搜索, + quickSearch:0,//是否启用快速搜索, + headers:{//网站的请求头,完整支持所有的,常带ua和cookies + 'User-Agent':'MOBILE_UA', + // "Cookie": "searchneed=ok" + }, + class_parse:'.myui-header__menu li.hidden-sm:gt(0):lt(5);a&&Text;a&&href;/(\\d+).html', + play_parse:true, + lazy:'', + limit:10, + 推荐:'ul.myui-vodlist.clearfix;li;a&&title;a&&data-original;.pic-text&&Text;a&&href', + double:true, // 推荐内容是否双层定位 + 一级:'.myui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href', + 二级:{"title":".myui-content__detail .title&&Text;.myui-content__detail p:eq(-2)&&Text","img":".myui-content__thumb .lazyload&&data-original","desc":".myui-content__detail p:eq(0)&&Text;.myui-content__detail p:eq(1)&&Text;.myui-content__detail p:eq(2)&&Text","content":".content&&Text","tabs":".nav-tabs:eq(0) li","lists":".myui-content__list:eq(#id) li"}, + 搜索:'#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', +}, +首图2:{ + title:'', + host:'', + url:'/list/fyclass-fypage.html', + searchUrl:'/vodsearch/**----------fypage---.html', + searchable:0, + quickSearch:0, + headers:{ + 'User-Agent':'MOBILE_UA', + // "Cookie": "" + }, + class_parse:'.stui-header__menu li:gt(0):lt(7);a&&Text;a&&href;/(\\d+).html', + play_parse:true, + lazy:'', + limit:10, + 推荐:'ul.stui-vodlist.clearfix;li;a&&title;.lazyload&&data-original;.pic-text&&Text;a&&href', + double:true, // 推荐内容是否双层定位 + 一级:'.stui-vodlist li;a&&title;a&&data-original;.pic-text&&Text;a&&href', + 二级:{"title":".stui-content__detail .title&&Text;.stui-content__detail p:eq(-2)&&Text","img":".stui-content__thumb .lazyload&&data-original","desc":".stui-content__detail p:eq(0)&&Text;.stui-content__detail p:eq(1)&&Text;.stui-content__detail p:eq(2)&&Text","content":".detail&&Text","tabs":".stui-vodlist__head","lists":".stui-content__playlist:eq(#id) li"}, + 搜索:'#searchList li;a&&title;.lazyload&&data-original;.text-muted&&Text;a&&href;.text-muted:eq(-1)&&Text', } diff --git "a/js/\347\234\213\350\247\206\347\225\214.js" "b/js/\347\234\213\350\247\206\347\225\214.js" index c2e15be53bfe16d6885ea8d7f1142714e146eed4..369f870c9dfd8f83924a5cb0514a05b53236a3ad 100644 --- "a/js/\347\234\213\350\247\206\347\225\214.js" +++ "b/js/\347\234\213\350\247\206\347\225\214.js" @@ -2,7 +2,7 @@ var rule = Object.assign(muban.mxpro,{ title:'看视界', host:'https://www.1080kan.cc', url:'/show/fyclass--------fypage---.html', -searchUrl:'/search/**-------------.html', +searchUrl:'/search/**----------fypage---.html', searchable:0, quickSearch:0, class_parse:'.navbar-items li:gt(1):lt(6);a&&Text;a&&href;.*/(.*?).html', diff --git "a/js/\350\216\253\346\211\216\345\205\224.js" "b/js/\350\216\253\346\211\216\345\205\224.js" index 7c220cb6728173d405e80227f2afeffdf4c0e791..1422e12b9ea4cb916ab538e1e7c12ccd149a9fb5 100644 --- "a/js/\350\216\253\346\211\216\345\205\224.js" +++ "b/js/\350\216\253\346\211\216\345\205\224.js" @@ -2,5 +2,8 @@ var rule = Object.assign(muban.mxpro,{ title:'莫扎兔', host:'https://www.mozhatu.com', url:'/index.php/vod/show/id/fyclass/page/fypage.html', +searchUrl:'/index.php/vod/search/page/fypage/wd/**.html', class_parse:'.navbar-items li:gt(2):lt(8);a&&Text;a&&href;.*/(.*?).html', +searchable:1, +quickSearch:1, }); \ No newline at end of file diff --git a/models/rule_classes.py b/models/rule_classes.py index 368acf464b96a519f2529b3d89bb4f99eeac88e5..6e05174e07e64f7e8180d8d0729f9cd475afa7c7 100644 --- a/models/rule_classes.py +++ b/models/rule_classes.py @@ -15,10 +15,11 @@ def init(db): name = db.Column(db.String(20),unique=True) class_name = db.Column(db.String(255)) class_url = db.Column(db.String(255)) + cookie = db.Column(db.String(255)) def __repr__(self): - return "" % ( - self.name, self.class_name, self.class_url) + return "" % ( + self.name, self.class_name, self.class_url,self.cookie) # db.create_all() db.create_all() diff --git a/models/rules.db b/models/rules.db index f178621d5452102f2eac59f7c141da81b149fbb8..e71680741cff6767c1310bae59f052da15f017ce 100644 Binary files a/models/rules.db and b/models/rules.db differ diff --git "a/py/\346\265\213\350\257\225\350\277\207\351\252\214\350\257\201.py" "b/py/\346\265\213\350\257\225\350\277\207\351\252\214\350\257\201.py" new file mode 100644 index 0000000000000000000000000000000000000000..75d383b75d9032e201690615c1b49653f250526f --- /dev/null +++ "b/py/\346\265\213\350\257\225\350\277\207\351\252\214\350\257\201.py" @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# File : 测试过验证.py +# Author: DaShenHan&道长-----先苦后甜,任凭晚风拂柳颜------ +# Date : 2022/8/30 + +import requests +import ddddocr +from time import sleep,time +from urllib.parse import urljoin,quote,unquote +import requests.utils + +url = 'https://cokemv.me/vodsearch/斗罗大陆----------1---.html' +PC_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36' + +headers = {'user-agent':PC_UA} + +def getHome(url): + # http://www.baidu.com:9000/323 + urls = url.split('//') + homeUrl = urls[0] + '//' + urls[1].split('/')[0] + return homeUrl + +def verifyCode(url,total_cnt=3): + headers['Referer'] = getHome(url) + cnt = 0 + ocr = ddddocr.DdddOcr() + while cnt < total_cnt: + s = requests.session() + try: + img = s.get(url="https://cokemv.me/index.php/verify/index.html?t="+str(time()), headers=headers,timeout=5).content + code = ocr.classification(img) + print('验证结果:',code) + res = s.post( + url=f"https://cokemv.me/index.php/ajax/verify_check?type=search&verify={code}", + headers=headers + ).json() + if res["msg"] == "ok": + cookies_dict = requests.utils.dict_from_cookiejar(s.cookies) + cookie_str = ';'.join([f'{k}={cookies_dict[k]}' for k in cookies_dict]) + # return cookies_dict + return cookie_str + except: + pass + cnt += 1 + sleep(1) + return '' + +r = requests.get(url,headers=headers) +html = r.text +print(html) +if html.find('输入验证码') > -1: + s = verifyCode(url) + print(s) \ No newline at end of file diff --git a/readme.md b/readme.md index 546d116d44d06cc83c6a260f01167f5491e5189f..8f73e39d49554467194395d0fed37447a95360c9 100644 --- a/readme.md +++ b/readme.md @@ -11,6 +11,7 @@ - [X] 8.增加外网免嗅(自定义config.py里面改) - [X] 9.增加错误处理和首页单个详情获取 - [X] 10.增加本地直播地址自定义 +- [X] 11.增加数据库迁移,[新版教程](https://www.cjavapy.com/article/1977/) [旧版教程](https://www.cnblogs.com/LoveMoney-MrLi/articles/15765985.html) ###### 2022/08/29 - [X] 1.更换js引擎,速度更快性能更好 - [X] 2.新版js支持与python互动,后期可能支持js免嗅(lazy:'js:xxx') diff --git a/requirements.txt b/requirements.txt index e787e7ee0260ae71fa1e7f0fe58dfd42294b64f2..9b5a125e222e63ce878728664aec494fdfb888c0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,12 @@ js2py pyquery flask -requests +flask_migrate flask-sqlalchemy +requests netifaces gevent ; python_version < '3.9' supervisor ; sys_platform != 'win32' and python_version < '3.9' func_timeout -easydict \ No newline at end of file +easydict +ddddocr \ No newline at end of file diff --git a/utils/encode.py b/utils/encode.py index d65fc99a6cca8f6b65901cac867c30a8fea7a376..117c66ec0e7ea1216ed989e63b7afa36bac14165 100644 --- a/utils/encode.py +++ b/utils/encode.py @@ -6,8 +6,11 @@ import base64 import requests +import requests.utils +from time import sleep import os from utils.web import UC_UA,PC_UA +import ddddocr def getPreJs(): base_path = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) # 上级目 @@ -27,6 +30,41 @@ def getCryptoJS(): code = f.read() return code +def getHome(url): + # http://www.baidu.com:9000/323 + urls = url.split('//') + homeUrl = urls[0] + '//' + urls[1].split('/')[0] + return homeUrl + +def verifyCode(url,headers,timeout=5,total_cnt=3): + lower_keys = list(map(lambda x: x.lower(), headers.keys())) + host = getHome(url) + if not 'referer' in lower_keys: + headers['Referer'] = host + print(f'开始自动过验证,请求头:{headers}') + cnt = 0 + ocr = ddddocr.DdddOcr() + while cnt < total_cnt: + s = requests.session() + try: + img = s.get(url=f"{host}/index.php/verify/index.html", headers=headers,timeout=timeout).content + code = ocr.classification(img) + print(f'第{cnt+1}次验证码识别结果:{code}') + res = s.post( + url=f"{host}/index.php/ajax/verify_check?type=search&verify={code}", + headers=headers).json() + if res["msg"] == "ok": + cookies_dict = requests.utils.dict_from_cookiejar(s.cookies) + cookie_str = ';'.join([f'{k}={cookies_dict[k]}' for k in cookies_dict]) + # return cookies_dict + return cookie_str + except: + print(f'第{cnt+1}次验证码提交失败') + pass + cnt += 1 + sleep(1) + return '' + def base64Encode(text): return base64.b64encode(text.encode("utf8")).decode("utf-8") #base64编码 diff --git a/utils/parser.py b/utils/parser.py index 7724c5c5897a7451eb33c5cd4cd86b5aabd6f62a..679eaf5e588519ed0bff089c86126f0779c3b6d1 100644 --- a/utils/parser.py +++ b/utils/parser.py @@ -51,10 +51,12 @@ def runJs(jsPath, before='', after='', ctx=None): js_code = fp.read() else: js_path = os.path.join(base_path, jsPath) + # print(js_path) with open(js_path, 'r', encoding='UTF-8') as fp: js_code = fp.read() # print(js_code) jscode_to_run = js_code + # print(jscode_to_run) if before: jscode_to_run = before + jscode_to_run if after: