This commit is contained in:
2026-01-12 16:15:51 -08:00
parent 22aad691a8
commit a8c8d08609
3 changed files with 47 additions and 18 deletions

View File

@@ -92,7 +92,7 @@
"(hitfile\\.net/[a-z0-9A-Z]{4,9})"
],
"regexp": "(hitf\\.(to|cc)/([a-z0-9A-Z]{4,9}))|(htfl\\.(net|to|cc)/([a-z0-9A-Z]{4,9}))|(hitfile\\.(net)/download/free/([a-z0-9A-Z]{4,9}))|((hitfile\\.net/[a-z0-9A-Z]{4,9}))",
"status": false
"status": true
},
"mega": {
"name": "mega",
@@ -426,7 +426,7 @@
"google\\.com/uc\\?id=([0-9A-Za-z_-]+)"
],
"regexp": "(((drive|docs)\\.google\\.com/open\\?id=([0-9A-Za-z_-]+)))|((drive|docs)\\.google\\.com/file/d/([0-9A-Za-z_-]+))|(google\\.com/uc\\?id=([0-9A-Za-z_-]+))",
"status": false
"status": true
},
"hexupload": {
"name": "hexupload",

View File

@@ -680,19 +680,37 @@ def main() -> int:
"""Show a simple interactive menu to choose install/uninstall or delegate."""
try:
installed = _is_installed()
term_width = shutil.get_terminal_size((80, 20)).columns
while True:
os.system("cls" if os.name == "nt" else "clear")
print("====================================")
print(" MEDEIA MACINA BOOTSTRAP MENU")
print("====================================")
print("1) Install / Reinstall")
print("2) Extras > HydrusNetwork")
if installed:
print("3) Uninstall")
print("4) Status")
print("q) Quit")
# Center the logo
logo_lines = LOGO.strip().splitlines()
# Filter out the ruler lines if they are still there
logo_lines = [line for line in logo_lines if not any(c.isdigit() for c in line.strip())]
choice = input("\nChoose an option: ").strip().lower()
print("\n" * 2)
for line in logo_lines:
print(line.center(term_width))
print("\n")
menu_title = " MEDEIA MACINA BOOTSTRAP MENU "
border = "=" * len(menu_title)
print(border.center(term_width))
print(menu_title.center(term_width))
print(border.center(term_width))
print("\n")
install_text = "1) Reinstall" if installed else "1) Install"
print(install_text.center(term_width))
print("2) Extras > HydrusNetwork".center(term_width))
if installed:
print("3) Uninstall".center(term_width))
print("q) Quit".center(term_width))
prompt = "\nChoose an option: "
# Try to center the prompt roughly
indent = " " * ((term_width // 2) - (len(prompt) // 2))
choice = input(f"{indent}{prompt}").strip().lower()
if choice in ("1", "install", "reinstall"):
return "install"
@@ -703,11 +721,6 @@ def main() -> int:
if installed and choice in ("3", "uninstall"):
return "uninstall"
if installed and choice in ("4", "status"):
print("\nInstallation detected." if installed else "\nNot installed.")
input("\nPress Enter to continue...")
continue
if choice in ("q", "quit", "exit"):
return 0
except EOFError:
@@ -910,7 +923,14 @@ def main() -> int:
if not args.quiet and not args.debug:
# Clear the terminal before showing logo
os.system('cls' if os.name == 'nt' else 'clear')
print(LOGO)
term_width = shutil.get_terminal_size((80, 20)).columns
logo_lines = LOGO.strip().splitlines()
# Filter out the ruler lines
logo_lines = [line for line in logo_lines if not any(c.isdigit() for c in line.strip())]
print("\n" * 2)
for line in logo_lines:
print(line.center(term_width))
print("\n")
# Determine total steps for progress bar
total_steps = 7 # Base: venv, pip, deps, project, cli, finalize, env

View File

@@ -166,6 +166,10 @@ def list_formats(
if cookiefile:
ydl_opts["cookiefile"] = str(cookiefile)
else:
# Best effort attempt to use browser cookies if no file is explicitly passed
ydl_opts["cookiesfrombrowser"] = "chrome"
if no_playlist:
ydl_opts["noplaylist"] = True
if playlist_items:
@@ -558,6 +562,11 @@ class YtDlpTool:
cookiefile = self.resolve_cookiefile()
if cookiefile is not None and cookiefile.is_file():
base_options["cookiefile"] = str(cookiefile)
else:
# Add browser cookies support "just in case" if no file found (best effort)
# This uses yt-dlp's support for extracting from common browsers.
# Defaulting to 'chrome' as the most common path.
base_options["cookiesfrombrowser"] = "chrome"
if opts.no_playlist:
base_options["noplaylist"] = True