Skip to content

Commit

Permalink
Merge pull request #115 from jadehh/113-爱影视搜索图片无法加载
Browse files Browse the repository at this point in the history
* 支持build 指定文件
  • Loading branch information
jadehh authored May 11, 2024
2 parents 4519d23 + 096ce40 commit 4b701a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
15 changes: 10 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,25 @@ def getType(self):


class Build():
def __init__(self, aliToken, biliCookie, is_18="False"):
def __init__(self, channelKey,aliToken, biliCookie, is_18="False"):
self.is_18 = str_to_bool(is_18)
self.aliToken = aliToken
self.biliCookie = biliCookie
self.jsMouleList = self.getJsFile()
self.jsMouleList = self.getJsFile(channelKey)
super().__init__()

def getJsFile(self):
def getJsFile(self,channelKey):
jsMoudleList = []
js_path = "js"
fileList = os.listdir(js_path)
for fileName in fileList:
jsMoudle = JSMoudle(js_path + "/" + fileName)
if jsMoudle.getName() is not None:
jsMoudleList.append(jsMoudle)
if len(channelKey):
if channelKey == jsMoudle.getJSName():
jsMoudleList.append(jsMoudle)
else:
jsMoudleList.append(jsMoudle)
return jsMoudleList

def getBaseConfig(self, baseObj, jsMoudle, tvType="TVBox"):
Expand Down Expand Up @@ -214,10 +218,11 @@ def build(self):

if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--key', type=str, default="") ## 添加环境变量
parser.add_argument('--aliToken', type=str, default="6827db23e5474d02a07fd7431d3d5a5a") ## 添加环境变量
parser.add_argument('--is_18', type=str, default="False") ## 添加
parser.add_argument('--biliCookie', type=str,
default="buvid3=02675249-8ED3-C418-87F5-59E18316459714816infoc; b_nut=1704421014; _uuid=5D435F74-F574-D9AB-62C1-B9294DE465D913102infoc; buvid_fp=e8c5650c749398e9b5cad3f3ddb5081e; buvid4=007E85D1-52C1-7E6E-07CF-837FFBC9349516677-024010502-J5vTDSZDCw4fNnXRejbSVg%3D%3D; rpdid=|()kYJmulRu0J'u~|RRJl)JR; PVID=1; SESSDATA=3be091d3%2C1720332009%2C699ed%2A11CjAcCdwXG5kY1umhCOpQHOn_WP7L9xFBfWO7KKd4BPweodpR6VyIfeNyPiRmkr5jCqsSVjg0R0dZOVVHRUo3RnhPRTZFc3JPbGdiUjFCdHpiRDhiTkticmdKTjVyS1VhbDdvNjFMSDJlbUJydUlRdjFUNGFBNkJlV2ZTa0N1Q1BEVi1QYTQzTUh3IIEC; bili_jct=b0ee7b5d3f27df893545d811d95506d4; DedeUserID=78014638; DedeUserID__ckMd5=4c8c5d65065e468a; enable_web_push=DISABLE; header_theme_version=CLOSE; home_feed_column=5; CURRENT_BLACKGAP=0; CURRENT_FNVAL=4048; b_lsid=75E916AA_18EA1A8D995; bsource=search_baidu; FEED_LIVE_VERSION=V_HEADER_LIVE_NO_POP; browser_resolution=1507-691; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTIzNjk5MTMsImlhdCI6MTcxMjExMDY1MywicGx0IjotMX0.8zQW_fNTCSBlK_JkHnzu3gDw62wuTK1qgKcbGec3swM; bili_ticket_expires=171236985") ## 添加
args = parser.parse_args()
build = Build(aliToken=args.aliToken, biliCookie=args.biliCookie, is_18=args.is_18)
build = Build(channelKey=args.key,aliToken=args.aliToken, biliCookie=args.biliCookie, is_18=args.is_18)
build.build()
15 changes: 8 additions & 7 deletions js/testSpider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {__jsEvalReturn} from './jianpian.js';
import {__jsEvalReturn} from './aiyingshi.js';

import * as Utils from "../lib/utils.js";

Expand Down Expand Up @@ -51,14 +51,14 @@ async function testMusicPlay(vodDetail) {
}

async function test() {
let siteKey = 'jianpian';
let siteKey = 'aiyingshi';
let siteType = 3;
await spider.init({
skey: siteKey, stype: siteType, ext: {
"token": "51427b95ab9d47a6921a27951ebd3f1e",
"box": "TV",
"code": "1",
"from": "jianpian",
"from": "aiyingshi",
"danmu": true,
"cookie": "buvid3=02675249-8ED3-C418-87F5-59E18316459714816infoc; b_nut=1704421014; _uuid=5D435F74-F574-D9AB-62C1-B9294DE465D913102infoc; buvid_fp=e8c5650c749398e9b5cad3f3ddb5081e; buvid4=007E85D1-52C1-7E6E-07CF-837FFBC9349516677-024010502-J5vTDSZDCw4fNnXRejbSVg%3D%3D; rpdid=|()kYJmulRu0J'u~|RRJl)JR; PVID=1; SESSDATA=3be091d3%2C1720332009%2C699ed%2A11CjAcCdwXG5kY1umhCOpQHOn_WP7L9xFBfWO7KKd4BPweodpR6VyIfeNyPiRmkr5jCqsSVjg0R0dZOVVHRUo3RnhPRTZFc3JPbGdiUjFCdHpiRDhiTkticmdKTjVyS1VhbDdvNjFMSDJlbUJydUlRdjFUNGFBNkJlV2ZTa0N1Q1BEVi1QYTQzTUh3IIEC; bili_jct=b0ee7b5d3f27df893545d811d95506d4; DedeUserID=78014638; DedeUserID__ckMd5=4c8c5d65065e468a; enable_web_push=DISABLE; header_theme_version=CLOSE; home_feed_column=5; CURRENT_BLACKGAP=0; CURRENT_FNVAL=4048; b_lsid=75E916AA_18EA1A8D995; bsource=search_baidu; FEED_LIVE_VERSION=V_HEADER_LIVE_NO_POP; browser_resolution=1507-691; bili_ticket=eyJhbGciOiJIUzI1NiIsImtpZCI6InMwMyIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTIzNjk5MTMsImlhdCI6MTcxMjExMDY1MywicGx0IjotMX0.8zQW_fNTCSBlK_JkHnzu3gDw62wuTK1qgKcbGec3swM; bili_ticket_expires=171236985"
}
Expand All @@ -68,6 +68,11 @@ async function test() {
console.debug(JSON.stringify(classes))


//测试首页列表
let homeVod = JSON.parse(await spider.homeVod())
console.debug(JSON.stringify(homeVod));


// 测试搜索
let search_page = JSON.parse(await spider.search("甄嬛传", false, 1))
console.debug(JSON.stringify(search_page))
Expand All @@ -77,10 +82,6 @@ async function test() {
let detail1 = JSON.parse(await spider.detail("1872"))
await testPlay(detail1)

//测试首页列表
let homeVod = JSON.parse(await spider.homeVod())
console.debug(JSON.stringify(homeVod));


// 测试分类
let catePage = JSON.parse(await spider.category("2", "1", undefined, {}));
Expand Down

0 comments on commit 4b701a7

Please sign in to comment.