Skip to content

Commit

Permalink
fix auto domain
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovi-0 committed Mar 1, 2024
1 parent fbca52d commit fe0cb97
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 33 deletions.
31 changes: 15 additions & 16 deletions Src/Api/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,27 @@

def domain_version():
domain_req = requests.get("https://api.telegra.ph/getPage/Link-Aggiornato-StreamingCommunity-01-17")
domain = domain_req.json()['result']['description']
domain = domain_req.json()['result']['description'].split(".")[1]
console.print("[green]Get rules ...")
req_repo = None

while True:
console.print(f"[blue]Test domain [white]=> [red]{domain}")
site_url = domain
try:
site_request = requests.get(site_url, headers={'user-agent': get_headers()})
soup = BeautifulSoup(site_request.text, "lxml")
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
console.print(f"[blue]Rules [white]=> [red].{domain}")
return domain, version
console.print(f"[blue]Test domain [white]=> [red]{domain}")
site_url = f"https://streamingcommunity.{domain}"

except Exception as e:
console.log("[red]Cant get version, problem with domain. Try again.")
domain = None
continue
try:
site_request = requests.get(site_url, headers={'user-agent': get_headers()})
soup = BeautifulSoup(site_request.text, "lxml")
version = json.loads(soup.find("div", {"id": "app"}).get("data-page"))['version']
console.print(f"[blue]Rules [white]=> [red].{domain}")

return domain, version

except Exception as e:
console.log("[red]Cant get version, problem with domain. Try again.")
sys.exit(0)


def search(title_search, domain):
req = requests.get(f"{domain}/api/search?q={title_search}", headers={'user-agent': get_headers()})
req = requests.get(f"https://streamingcommunity.{domain}/api/search?q={title_search}", headers={'user-agent': get_headers()})

if req.ok:
return [{'name': title['name'], 'type': title['type'], 'id': title['id'], 'slug': title['slug']} for title in
Expand Down
Empty file removed Src/Lib/FFmpeg/file_list.txt
Empty file.
2 changes: 1 addition & 1 deletion Src/Upload/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ def main_update():
print("\n")
console.print(f"[red]{repo_name} was downloaded [yellow]{down_count} [red]times, but only [yellow]{percentual_stars}% [red]of You(!!) have starred it. \n\
[cyan]Help the repository grow today, by leaving a [yellow]star [cyan]and [yellow]sharing [cyan]it to others online!")
time.sleep(2.5)
time.sleep(3)
print("\n")
12 changes: 0 additions & 12 deletions Src/Util/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,3 @@
# Variable
msg = Prompt()
console = Console()
SAVE_DEBUG = False

class ConfigurazioneLogger:
def __init__(self, nome_file_log='debug.log'):
self.nome_file_log = nome_file_log
self.configura_logger()

def configura_logger(self):
if SAVE_DEBUG:
logging.basicConfig(filename=self.nome_file_log, filemode='w', level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')

config_logger = ConfigurazioneLogger()
4 changes: 1 addition & 3 deletions Src/Util/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ def remove_file(file_path):
except OSError as e:
print(f"Error removing file '{file_path}': {e}")
else:
print(f"File '{file_path}' does not exist.")

time.sleep(1)
print(f"File '{file_path}' does not exist.")
1 change: 0 additions & 1 deletion data.json

This file was deleted.

0 comments on commit fe0cb97

Please sign in to comment.