代码拉取完成,页面将自动刷新
import threading
import os
import re
import sys
from urllib.parse import quote
cookies = []
def get_cookies():
if not os.path.exists('./test/logs'):
os.makedirs('./test/logs')
with open("jdCookie.js", 'r') as f:
txt = f.read()
for cookie in re.findall("(.*['\"]pt_key[^'|\"]*)", txt):
if '//' not in cookie:
cookie = re.search(r"(pt_key.*)", cookie).group(0)
cookies.append(cookie)
print(len(cookies), cookies)
def main(ck, index):
filename = sys.argv[1]
for file in os.listdir('./'):
if filename in file:
filename = file
if '.ts' in filename:
program = "ts-node"
elif '.js' in filename:
program = "node"
else:
program = "node"
with open(f"./test/logs/{filename.split('.')[0]}-{index}.log", 'w') as f:
f.truncate(0)
os.system(f"{program} {filename} {quote(ck)} >> ./test/logs/{filename.split('.')[0]}-{index}.log &")
print('done')
if __name__ == '__main__':
print(sys.argv)
get_cookies()
for i in range(len(cookies)):
threading.Thread(target=main, args=(cookies[i], i)).start()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。