From e42b44e71e8f3b052a04f35467929986135f6ed2 Mon Sep 17 00:00:00 2001 From: "Il'ya (Marshal)" Date: Wed, 30 Mar 2022 09:42:58 +0200 Subject: [PATCH] fix sparkle dynamic parts --- make_files_tree.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/make_files_tree.py b/make_files_tree.py index 4781aac04d..8e0e11dbfc 100644 --- a/make_files_tree.py +++ b/make_files_tree.py @@ -33,6 +33,10 @@ NONCE_TEMPLATE = f'"nonce":"{DYNAMIC_PART_MOCK}' PROXY_CONFIG_SUB_NET_REGEX = r'\d+\.\d+:8888;' PROXY_CONFIG_SUB_NET_TEMPLATE = 'X.X:8888;' TRANSLATE_SUGGESTION_REGEX = r'
(.?)+
' +SPARKLE_SIG_REGEX = r'sig=(.*?);' +SPARKLE_SE_REGEX = r'se=(.*?);' +SPARKLE_SIG_TEMPLATE = f'sig={DYNAMIC_PART_MOCK};' +SPARKLE_SE_TEMPLATE = f'se={DYNAMIC_PART_MOCK};' # unsecure but so simple CONNECTOR = aiohttp.TCPConnector(ssl=False) @@ -201,6 +205,8 @@ async def crawl(url: str, session: aiohttp.ClientSession): content = re.sub(NONCE_REGEX, NONCE_TEMPLATE, content) content = re.sub(PROXY_CONFIG_SUB_NET_REGEX, PROXY_CONFIG_SUB_NET_TEMPLATE, content) content = re.sub(TRANSLATE_SUGGESTION_REGEX, '', content) + content = re.sub(SPARKLE_SIG_REGEX, SPARKLE_SIG_TEMPLATE, content) + content = re.sub(SPARKLE_SE_REGEX, SPARKLE_SE_TEMPLATE, content) logger.info(f'Write to {filename}') await f.write(content)