mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
[API] Add verify (#273)
This commit is contained in:
parent
34f6626a58
commit
e43745bbed
@ -58,8 +58,9 @@ def title_search(word_to_search: str) -> int:
|
||||
response = httpx.get(
|
||||
url=search_url,
|
||||
headers={'user-agent': get_userAgent()},
|
||||
follow_redirects=True,
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY,
|
||||
follow_redirects=True
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -148,7 +148,8 @@ def title_search(title: str) -> int:
|
||||
cookies=cookies,
|
||||
headers=headers,
|
||||
json=json_data,
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -58,7 +58,9 @@ def title_search(word_to_search: str) -> int:
|
||||
response = httpx.get(
|
||||
url=search_url,
|
||||
headers={'user-agent': get_userAgent()},
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY,
|
||||
follow_redirects=True
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -60,7 +60,9 @@ def title_search(word_to_search: str) -> int:
|
||||
response = httpx.get(
|
||||
url=search_url,
|
||||
headers={'user-agent': get_userAgent()},
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY,
|
||||
follow_redirects=True
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -58,7 +58,9 @@ def title_search(word_to_search: str) -> int:
|
||||
response = httpx.get(
|
||||
url=search_url,
|
||||
headers={'user-agent': get_userAgent()},
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY,
|
||||
follow_redirects=True
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -55,14 +55,16 @@ def title_search(title_search: str) -> int:
|
||||
media_search_manager.clear()
|
||||
table_show_manager.clear()
|
||||
|
||||
search_url = f"{site_constant.FULL_URL}/api/search?q={title_search}",
|
||||
search_url = f"{site_constant.FULL_URL}/api/search?q={title_search}"
|
||||
console.print(f"[cyan]Search url: [yellow]{search_url}")
|
||||
|
||||
try:
|
||||
response = httpx.get(
|
||||
url=search_url,
|
||||
headers={'user-agent': get_userAgent()},
|
||||
timeout=max_timeout
|
||||
timeout=max_timeout,
|
||||
verify=site_constant.VERIFY,
|
||||
follow_redirects=True
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
|
@ -15,6 +15,9 @@ from StreamingCommunity.Util.console import console
|
||||
from StreamingCommunity.Util._jsonConfig import config_manager
|
||||
|
||||
|
||||
# Variable
|
||||
VERIFY = config_manager.get("REQUESTS", "verify")
|
||||
|
||||
|
||||
def get_tld(url_str):
|
||||
"""Extract the TLD (Top-Level Domain) from the URL."""
|
||||
@ -79,7 +82,7 @@ def validate_url(url, base_url, max_timeout, max_retries=2, sleep=1):
|
||||
return False, None
|
||||
|
||||
client = httpx.Client(
|
||||
verify=False,
|
||||
verify=VERIFY,
|
||||
headers=get_headers(),
|
||||
timeout=max_timeout
|
||||
)
|
||||
|
@ -31,6 +31,10 @@ class SiteConstant:
|
||||
def ROOT_PATH(self):
|
||||
return config_manager.get('DEFAULT', 'root_path')
|
||||
|
||||
@property
|
||||
def VERIFY(self):
|
||||
return config_manager.get('REQUESTS', 'verify')
|
||||
|
||||
@property
|
||||
def DOMAIN_NOW(self):
|
||||
return config_manager.get_site(self.SITE_NAME, 'domain')
|
||||
|
@ -24,6 +24,7 @@
|
||||
"telegram_bot": false
|
||||
},
|
||||
"REQUESTS": {
|
||||
"verify": false,
|
||||
"timeout": 20,
|
||||
"max_retry": 8,
|
||||
"proxy_start_min": 0.1,
|
||||
|
@ -3,6 +3,7 @@ bs4
|
||||
rich
|
||||
tqdm
|
||||
m3u8
|
||||
certifi
|
||||
psutil
|
||||
unidecode
|
||||
jsbeautifier
|
||||
@ -11,5 +12,4 @@ pycryptodomex
|
||||
ua-generator
|
||||
qbittorrent-api
|
||||
python-qbittorrent
|
||||
Pillow
|
||||
pyTelegramBotAPI
|
Loading…
x
Reference in New Issue
Block a user