mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-07 12:05:35 +00:00
Update readme
This commit is contained in:
parent
441e761953
commit
5d71f81b61
19
README.md
19
README.md
@ -400,15 +400,16 @@ The `run-container` command mounts also the `config.json` file, so any change to
|
|||||||
|
|
||||||
| Website | Status |
|
| Website | Status |
|
||||||
|:-------------------|:------:|
|
|:-------------------|:------:|
|
||||||
| 1337xx | ✅ |
|
| [1337xx](https://1337xx.to/) | ✅ |
|
||||||
| Altadefinizione | ✅ |
|
| [Altadefinizione](https://altadefinizione.prof/) | ✅ |
|
||||||
| AnimeUnity | ✅ |
|
| [AnimeUnity](https://animeunity.so/) | ✅ |
|
||||||
| Ilcorsaronero | ✅ |
|
| [Ilcorsaronero](https://ilcorsaronero.link/) | ✅ |
|
||||||
| CB01New | ✅ |
|
| [CB01New](https://cb01new.pics/) | ✅ |
|
||||||
| DDLStreamItaly | ✅ |
|
| [DDLStreamItaly](https://ddlstreamitaly.co/) | ✅ |
|
||||||
| GuardaSerie | ✅ |
|
| [GuardaSerie](https://guardaserie.academy/) | ✅ |
|
||||||
| MostraGuarda | ✅ |
|
| [MostraGuarda](https://mostraguarda.stream/) | ✅ |
|
||||||
| StreamingCommunity | ✅ |
|
| [StreamingCommunity](https://streamingcommunity.prof/) | ✅ |
|
||||||
|
|
||||||
|
|
||||||
# Tutorials
|
# Tutorials
|
||||||
|
|
||||||
|
@ -146,11 +146,9 @@ def search_domain(site_name: str, base_url: str, get_first: bool = False):
|
|||||||
# Get configuration values
|
# Get configuration values
|
||||||
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
max_timeout = config_manager.get_int("REQUESTS", "timeout")
|
||||||
domain = str(config_manager.get_dict("SITE", site_name)['domain'])
|
domain = str(config_manager.get_dict("SITE", site_name)['domain'])
|
||||||
|
test_url = f"{base_url}.{domain}"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Test current domain configuration
|
|
||||||
test_url = f"{base_url}.{domain}"
|
|
||||||
|
|
||||||
if validate_url(test_url, max_timeout):
|
if validate_url(test_url, max_timeout):
|
||||||
parsed_url = urlparse(test_url)
|
parsed_url = urlparse(test_url)
|
||||||
tld = parsed_url.netloc.split('.')[-1]
|
tld = parsed_url.netloc.split('.')[-1]
|
||||||
@ -163,7 +161,7 @@ def search_domain(site_name: str, base_url: str, get_first: bool = False):
|
|||||||
|
|
||||||
# Perform Google search if current domain fails
|
# Perform Google search if current domain fails
|
||||||
query = base_url.split("/")[-1]
|
query = base_url.split("/")[-1]
|
||||||
search_results = list(search(query, num_results=10, lang="it"))
|
search_results = list(search(query, num_results=15, lang="it"))
|
||||||
console.print(f"Google search: {search_results}")
|
console.print(f"Google search: {search_results}")
|
||||||
|
|
||||||
def normalize_for_comparison(url):
|
def normalize_for_comparison(url):
|
||||||
|
@ -20,6 +20,7 @@ from StreamingCommunity.Api.Template.Util import search_domain
|
|||||||
|
|
||||||
# Variable
|
# Variable
|
||||||
console = Console()
|
console = Console()
|
||||||
|
README_PATH = "README.md"
|
||||||
|
|
||||||
|
|
||||||
def load_site_names():
|
def load_site_names():
|
||||||
@ -78,6 +79,39 @@ def load_site_names():
|
|||||||
|
|
||||||
return site_names
|
return site_names
|
||||||
|
|
||||||
|
def update_readme(site_names):
|
||||||
|
if not os.path.exists(README_PATH):
|
||||||
|
console.print(f"[red]README file not found at {README_PATH}")
|
||||||
|
return
|
||||||
|
|
||||||
|
with open(README_PATH, "r", encoding="utf-8") as file:
|
||||||
|
lines = file.readlines()
|
||||||
|
|
||||||
|
updated_lines = []
|
||||||
|
|
||||||
|
for line in lines:
|
||||||
|
if line.startswith("| [") and "|" in line:
|
||||||
|
site_name = line.split("[")[1].split("]")[0]
|
||||||
|
alias = f"{site_name.lower()}"
|
||||||
|
|
||||||
|
if alias in site_names:
|
||||||
|
domain_to_use, _ = search_domain(site_name=alias, base_url=f"https://{alias}", get_first=True)
|
||||||
|
print("Update line: ", line)
|
||||||
|
|
||||||
|
if site_name == "animeunity":
|
||||||
|
updated_line = f"| [{site_name}](https://www.{alias}.{domain_to_use}/) | ✅ |\n"
|
||||||
|
else:
|
||||||
|
updated_line = f"| [{site_name}](https://{alias}.{domain_to_use}/) | ✅ |\n"
|
||||||
|
|
||||||
|
print("To: ", updated_line.strip())
|
||||||
|
updated_lines.append(updated_line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
updated_lines.append(line)
|
||||||
|
|
||||||
|
with open(README_PATH, "w", encoding="utf-8") as file:
|
||||||
|
file.writelines(updated_lines)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
site_names = load_site_names()
|
site_names = load_site_names()
|
||||||
for alias, (site_name, use_for) in site_names.items():
|
for alias, (site_name, use_for) in site_names.items():
|
||||||
@ -85,6 +119,11 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if site_name == "animeunity":
|
if site_name == "animeunity":
|
||||||
domain_to_use, _ = search_domain(site_name=site_name, base_url=f"https://www.{site_name}", get_first=True)
|
domain_to_use, _ = search_domain(site_name=site_name, base_url=f"https://www.{site_name}", get_first=True)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
domain_to_use, _ = search_domain(site_name=site_name, base_url=f"https://{site_name}", get_first=True)
|
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)
|
Loading…
x
Reference in New Issue
Block a user