Skip to content

Commit

Permalink
ndl short url
Browse files Browse the repository at this point in the history
  • Loading branch information
zsokami committed Nov 27, 2024
1 parent 8521dbc commit 5f1c6eb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions update_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@

GITHUB_REPOSITORY_RAW_URL_PREFIX = f'https://raw.githubusercontent.com/{GITHUB_REPOSITORY}/'

ini_file_name = next((f for f in os.listdir() if f.endswith('.ini') and 'Full' in f), None)
ini_file_name_nocountry = next((f for f in os.listdir() if f.endswith('.ini') and 'Full' not in f), None)
ini_file_name = 'ACL4SSR_Online_Full_Mannix.ini'
ini_file_name_nocountry = 'ACL4SSR_Online_Mannix.ini'
ini_file_name_nodnsleak = 'ACL4SSR_Online_Full_Mannix_No_DNS_Leak.ini'
ini_file_name_nocountry_nodnsleak = 'ACL4SSR_Online_Mannix_No_DNS_Leak.ini'


if URL_SHORTENER_API_KEY:
Expand Down Expand Up @@ -644,7 +646,9 @@ def aliases_urls(name, suffix=''):

upsert_args = [
*aliases_urls(ini_file_name),
*aliases_urls(ini_file_name_nocountry, '-nc')
*aliases_urls(ini_file_name_nocountry, '-nc'),
*aliases_urls(ini_file_name_nodnsleak, '-ndl'),
*aliases_urls(ini_file_name_nocountry_nodnsleak, '-nc-ndl'),
]

with ThreadPoolExecutor(len(upsert_args)) as executor:
Expand All @@ -653,7 +657,7 @@ def aliases_urls(name, suffix=''):
for url in sc_urls:
print(f"{url}?url=")
else:
for name in [ini_file_name, ini_file_name_nocountry]:
for name in [ini_file_name, ini_file_name_nocountry, ini_file_name_nodnsleak, ini_file_name_nocountry_nodnsleak]:
if name:
print(f"{GITHUB_REPOSITORY_RAW_URL_PREFIX}{GITHUB_REF_NAME}/{name}")
_url = f"/sub?target=clash&udp=true&scv=true&config=https://raw.githubusercontent.com/{GITHUB_REPOSITORY}/{GITHUB_REF_NAME}/{name}?url="
Expand Down

0 comments on commit 5f1c6eb

Please sign in to comment.