Add Telegram finder source
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import json
|
||||
import re
|
||||
|
||||
|
||||
def fetch_nonce(html_content):
|
||||
match = re.search(r'"nonce"\s*:\s*"([^"]+)"', html_content)
|
||||
if not match:
|
||||
raise ValueError("Nonce не найден на странице.")
|
||||
return match.group(1)
|
||||
|
||||
|
||||
def fetch_args(html_content):
|
||||
match = re.search(
|
||||
r"ObjectManagerList\.add\((\{.*?\})\)\.initLazyLoad", html_content, re.S
|
||||
)
|
||||
if not match:
|
||||
raise ValueError("Данные страниц не найдены на странице.")
|
||||
|
||||
pages = json.loads(match.group(1))
|
||||
args = pages.get("args", [])
|
||||
return json.loads(args) if isinstance(args, str) else args
|
||||
Reference in New Issue
Block a user