Skip to content

Commit 4aa2870

Browse files
author
Taois
committed
fix:nothing
1 parent 30368b4 commit 4aa2870

File tree

5 files changed

+35
-28
lines changed

5 files changed

+35
-28
lines changed

spider/py/base/spider.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -203,26 +203,30 @@ def cleanText(self, src):
203203
src)
204204
return clean
205205

206-
def fetch(self, url, params=None, headers=None, cookies=None, timeout=5, verify=True, allow_redirects=True):
207-
rsp = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=timeout, verify=verify,
208-
allow_redirects=allow_redirects)
206+
def fetch(self, url, params=None, headers=None, cookies=None, timeout=5, verify=True,
207+
allow_redirects=True, stream=None):
208+
rsp = requests.get(url, params=params, headers=headers, cookies=cookies, timeout=timeout,
209+
verify=verify,
210+
allow_redirects=allow_redirects, stream=stream)
209211
rsp.encoding = 'utf-8'
210212
return rsp
211213

212-
def post(self, url, data=None, headers=None, cookies=None, timeout=5, verify=True, allow_redirects=True):
214+
def post(self, url, data=None, headers=None, cookies=None, timeout=5, verify=True, allow_redirects=True,
215+
stream=None):
213216
rsp = requests.post(url, data=data, headers=headers, cookies=cookies, timeout=timeout, verify=verify,
214-
allow_redirects=allow_redirects)
217+
allow_redirects=allow_redirects, stream=stream)
215218
rsp.encoding = 'utf-8'
216219
return rsp
217220

218-
def postJson(self, url, json, headers=None, cookies=None, timeout=5, verify=True, allow_redirects=True):
221+
def postJson(self, url, json, headers=None, cookies=None, timeout=5, verify=True, allow_redirects=True,
222+
stream=None):
219223
rsp = requests.post(url, json=json, headers=headers, cookies=cookies, timeout=timeout, verify=verify,
220-
allow_redirects=allow_redirects)
224+
allow_redirects=allow_redirects, stream=stream)
221225
rsp.encoding = 'utf-8'
222226
return rsp
223227

224228
def postBinary(self, url, data: dict, boundary=None, headers=None, cookies=None, timeout=5, verify=True,
225-
allow_redirects=True):
229+
allow_redirects=True, stream=None):
226230
if boundary is None:
227231
boundary = f'--dio-boundary-{int(time.time())}'
228232
if headers is None:
@@ -234,7 +238,7 @@ def postBinary(self, url, data: dict, boundary=None, headers=None, cookies=None,
234238
m = encode_multipart_formdata(fields, boundary=boundary)
235239
data = m[0]
236240
rsp = requests.post(url, data=data, headers=headers, cookies=cookies, timeout=timeout, verify=verify,
237-
allow_redirects=allow_redirects)
241+
allow_redirects=allow_redirects, stream=stream)
238242
rsp.encoding = 'utf-8'
239243
return rsp
240244

spider/py/core/t4_daemon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def _deep_sizeof(obj) -> int:
4848
HOST = "127.0.0.1"
4949
PORT = 57570
5050

51-
MAX_MSG_SIZE = 10 * 1024 * 1024 # 10MB
51+
MAX_MSG_SIZE = 60 * 1024 * 1024 # 60MB
5252
MAX_CACHED_INSTANCES = 100 # 最大缓存实例数
5353
INIT_TIMEOUT = 100 # init 超时(秒)
5454
REQUEST_TIMEOUT = 30 # 单次请求 socket 超时(秒)
@@ -118,7 +118,7 @@ def recv_exact(rfile, n: int) -> bytes:
118118
def send_packet(wfile, obj: dict):
119119
payload = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
120120
if len(payload) > MAX_MSG_SIZE:
121-
raise ValueError("payload too large")
121+
raise ValueError(f"payload too large:{len(payload)} > {MAX_MSG_SIZE}")
122122
wfile.write(struct.pack(">I", len(payload)))
123123
wfile.write(payload)
124124
wfile.flush()

spider/py/core/t4_daemon_lite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def recv_exact(rfile, n: int) -> bytes:
106106
def send_packet(wfile, obj: dict):
107107
payload = pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
108108
if len(payload) > MAX_MSG_SIZE:
109-
raise ValueError("payload too large")
109+
raise ValueError(f"payload too large:{len(payload)} > {MAX_MSG_SIZE}")
110110
wfile.write(struct.pack(">I", len(payload)))
111111
wfile.write(payload)
112112
wfile.flush()

spider/py/data/bili_config.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"users": {
33
"fake": {
44
"cookies_dic": {
5-
"buvid3": "5E1065DB-EE9A-D69C-6AD8-C58C1E6A54E847891infoc",
6-
"b_nut": "1757970347",
7-
"__at_once": "6770703451717213879"
5+
"buvid3": "C388E051-8B09-CBB4-D24F-553E939CBA0568463infoc",
6+
"b_nut": "1758067368",
7+
"__at_once": "4811634013224838281"
88
}
99
}
1010
},
@@ -460,6 +460,10 @@
460460
"n": "火影忍者手游",
461461
"v": "3_292"
462462
},
463+
{
464+
"n": "崩坏:因缘精灵",
465+
"v": "3_1011"
466+
},
463467
{
464468
"n": "鸣潮",
465469
"v": "3_874"
@@ -1465,13 +1469,13 @@
14651469
"key": "tid",
14661470
"name": "赛事",
14671471
"value": [
1468-
{
1469-
"n": "游戏赛事",
1470-
"v": "13_561"
1471-
},
14721472
{
14731473
"n": "赛事综合",
14741474
"v": "13_563"
1475+
},
1476+
{
1477+
"n": "游戏赛事",
1478+
"v": "13_561"
14751479
}
14761480
]
14771481
}

spider/py/哔哩哔哩.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ def get_tuijian_filter(E):
499499

500500
def __init__(self, query_params=None, t4_api=None):
501501
super().__init__(query_params=query_params, t4_api=t4_api)
502-
self.localProxyUrl = None
502+
self.localProxyUrl = self.getProxyUrl() + '&type='
503503
self.time_diff1 = {V: [0, 300], A0: [300, 900], AL: [900, 1800], AQ: [1800, 3600],
504504
'5': [3600, 0x4ee2d6d415b85acef80ffffffff]};
505505
self.time_diff = L;
@@ -517,16 +517,15 @@ def __init__(self, query_params=None, t4_api=None):
517517

518518
def init(self, extend=B):
519519
print('============{0}============'.format(extend))
520-
self.localProxyUrl = self.getProxyUrl() + '&type='
521520

522-
def isVideoFormat(A, url):
523-
0
521+
def isVideoFormat(self, url):
522+
pass
524523

525-
def manualVideoCheck(A):
526-
0
524+
def manualVideoCheck(self):
525+
pass
527526

528-
def destroy(A):
529-
0
527+
def destroy(self):
528+
pass
530529

531530
def format_img(B, img):
532531
A = img;
@@ -2366,7 +2365,7 @@ def get_fastesUrl(C, ja, id, mediaType):
23662365
C.pC_urlDic[id][Bf] = F(d(J(lambda x: x.split('=')[:2], D[0].split('?')[1].split('&'))).get(Bf, 0))
23672366
for G in D: C.pool.submit(C._testUrl, G, id, E)
23682367

2369-
def localProxy(D, param):
2368+
def localProxy(D, param, *args, **kwargs):
23702369
N = 'range';
23712370
M = 'application/octet-stream';
23722371
E = param;

0 commit comments

Comments
 (0)