mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
Update config.json
This commit is contained in:
parent
dae058c94e
commit
b40d202255
@ -401,7 +401,7 @@ The `run-container` command mounts also the `config.json` file, so any change to
|
||||
| Website | Status |
|
||||
|:-------------------|:------:|
|
||||
| [1337xx](https://1337xx.to/) | ✅ |
|
||||
| [Altadefinizione](https://altadefinizione.com/) | ✅ |
|
||||
| [Altadefinizione](https://altadefinizione.prof/) | ✅ |
|
||||
| [AnimeUnity](https://animeunity.so/) | ✅ |
|
||||
| [Ilcorsaronero](https://ilcorsaronero.link/) | ✅ |
|
||||
| [CB01New](https://cb01new.pics/) | ✅ |
|
||||
|
@ -47,11 +47,7 @@ def title_search(title_search: str) -> int:
|
||||
try:
|
||||
response = client.get(
|
||||
url=f"https://{SITE_NAME}.{domain_to_use}/?story={title_search.replace(' ', '+')}&do=search&subaction=search&titleonly=3",
|
||||
headers={
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
|
||||
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
'User-Agent': get_headers()
|
||||
},
|
||||
headers={'User-Agent': get_headers()},
|
||||
timeout=max_timeout
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
@ -43,11 +43,7 @@ def validate_url(url, base_url, max_timeout):
|
||||
# Check 1: Initial request without following redirects
|
||||
console.print("[cyan]Performing initial connection check...")
|
||||
with httpx.Client(
|
||||
headers={
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
|
||||
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
'User-Agent': get_headers()
|
||||
},
|
||||
headers={'User-Agent': get_headers()},
|
||||
follow_redirects=False,
|
||||
timeout=max_timeout
|
||||
) as client:
|
||||
@ -58,14 +54,11 @@ def validate_url(url, base_url, max_timeout):
|
||||
# Check 2: Follow redirects and verify final domain
|
||||
console.print("[cyan]Checking redirect destination...")
|
||||
with httpx.Client(
|
||||
headers={
|
||||
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
|
||||
'accept-language': 'it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7',
|
||||
'User-Agent': get_headers()
|
||||
},
|
||||
headers={'User-Agent': get_headers()},
|
||||
follow_redirects=True,
|
||||
timeout=max_timeout
|
||||
) as client:
|
||||
|
||||
response = client.get(url)
|
||||
if not check_response(response, 2):
|
||||
return False
|
||||
@ -114,6 +107,7 @@ def search_domain(site_name: str, base_url: str, get_first: bool = False):
|
||||
config_manager.write_config()
|
||||
console.print(f"[green]Successfully validated initial URL")
|
||||
return tld, test_url
|
||||
|
||||
except Exception as e:
|
||||
console.print(f"[red]Error testing initial URL: {str(e)}")
|
||||
|
||||
@ -134,6 +128,7 @@ def search_domain(site_name: str, base_url: str, get_first: bool = False):
|
||||
choices=["y", "n"],
|
||||
default="y"
|
||||
).lower() == "y":
|
||||
|
||||
config_manager.config['SITE'][site_name]['domain'] = new_domain
|
||||
config_manager.write_config()
|
||||
return new_domain, f"{base_url}.{new_domain}"
|
||||
|
@ -8,6 +8,7 @@ sys.path.append(src_path)
|
||||
|
||||
|
||||
# Other
|
||||
import time
|
||||
import glob
|
||||
import logging
|
||||
import importlib
|
||||
@ -15,6 +16,7 @@ from rich.console import Console
|
||||
|
||||
|
||||
# Util
|
||||
from StreamingCommunity.Util._jsonConfig import config_manager
|
||||
from StreamingCommunity.Api.Template.Util import search_domain
|
||||
|
||||
|
||||
@ -60,7 +62,7 @@ def load_site_names():
|
||||
for module_name, _, use_for in modules:
|
||||
|
||||
# Construct a unique alias for the module
|
||||
module_alias = f'{module_name}_site_name'
|
||||
module_alias = f'{module_name}'
|
||||
logging.info(f"Module alias: {module_alias}")
|
||||
|
||||
try:
|
||||
@ -114,15 +116,18 @@ def update_readme(site_names, domain_to_use):
|
||||
if __name__ == "__main__":
|
||||
site_names = load_site_names()
|
||||
for alias, (site_name, use_for) in site_names.items():
|
||||
print(f"Alias: {alias}, SITE_NAME: {site_name}, Use for: {use_for}")
|
||||
original_domain = config_manager.get_list("SITE", alias)['domain']
|
||||
|
||||
if site_name == "animeunity":
|
||||
domain_to_use, _ = search_domain(site_name=site_name, base_url=f"https://www.{site_name}", get_first=True)
|
||||
else:
|
||||
domain_to_use, _ = search_domain(site_name=site_name, base_url=f"https://{site_name}", get_first=True)
|
||||
|
||||
|
||||
# Update readme
|
||||
print("\n")
|
||||
print("Return domain: ", domain_to_use)
|
||||
update_readme(alias, domain_to_use)
|
||||
if original_domain != domain_to_use:
|
||||
print("\n")
|
||||
print("Return domain: ", domain_to_use)
|
||||
update_readme(alias, domain_to_use)
|
||||
|
||||
print("------------------------------------")
|
||||
time.sleep(2)
|
@ -59,7 +59,7 @@
|
||||
"domain": "prof"
|
||||
},
|
||||
"altadefinizione": {
|
||||
"domain": "com"
|
||||
"domain": "prof"
|
||||
},
|
||||
"guardaserie": {
|
||||
"domain": "academy"
|
||||
|
Loading…
x
Reference in New Issue
Block a user