mirror of
https://github.com/LSPosed/MagiskOnWSALocal.git
synced 2025-09-02 02:30:14 +00:00
Do not open and close files in each new thread
This commit is contained in:
parent
bbfc3c2d29
commit
fd51bd872b
1 changed files with 7 additions and 4 deletions
|
@ -119,6 +119,8 @@ with open(Path.cwd().parent / "xml/FE3FileUrl.xml", "r") as f:
|
||||||
if not download_dir.is_dir():
|
if not download_dir.is_dir():
|
||||||
download_dir.mkdir()
|
download_dir.mkdir()
|
||||||
|
|
||||||
|
tmpdownlist = open(download_dir/tempScript, 'a')
|
||||||
|
|
||||||
def send_req(i, v, out_file, out_file_name):
|
def send_req(i, v, out_file, out_file_name):
|
||||||
out = session.post(
|
out = session.post(
|
||||||
'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured',
|
'https://fe3.delivery.mp.microsoft.com/ClientWebService/client.asmx/secured',
|
||||||
|
@ -130,10 +132,9 @@ def send_req(i, v, out_file, out_file_name):
|
||||||
url = l.getElementsByTagName("Url")[0].firstChild.nodeValue
|
url = l.getElementsByTagName("Url")[0].firstChild.nodeValue
|
||||||
if len(url) != 99:
|
if len(url) != 99:
|
||||||
print(f"download link: {url}\npath: {out_file}\n", flush=True)
|
print(f"download link: {url}\npath: {out_file}\n", flush=True)
|
||||||
with open(download_dir/tempScript, 'a') as tmpdownlist:
|
tmpdownlist.writelines(url + '\n')
|
||||||
tmpdownlist.writelines(url + '\n')
|
tmpdownlist.writelines(f' dir={download_dir}\n')
|
||||||
tmpdownlist.writelines(f' dir={download_dir}\n')
|
tmpdownlist.writelines(f' out={out_file_name}\n')
|
||||||
tmpdownlist.writelines(f' out={out_file_name}\n')
|
|
||||||
|
|
||||||
threads = []
|
threads = []
|
||||||
for filename, values in identities.items():
|
for filename, values in identities.items():
|
||||||
|
@ -163,3 +164,5 @@ for filename, values in identities.items():
|
||||||
th.start()
|
th.start()
|
||||||
for th in threads:
|
for th in threads:
|
||||||
th.join()
|
th.join()
|
||||||
|
|
||||||
|
tmpdownlist.close()
|
||||||
|
|
Loading…
Add table
Reference in a new issue