core: Fix hls error "self.video_res == None"

This commit is contained in:
None 2025-03-25 15:04:54 +01:00
parent 74218e3101
commit 4789c147e4
3 changed files with 29 additions and 4 deletions

BIN
.github/media/logo.ico vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -189,10 +189,16 @@ class M3U8Manager:
tuple_available_resolution = self.parser._video.get_list_resolution()
list_available_resolution = [f"{r[0]}x{r[1]}" for r in tuple_available_resolution]
# Check if self.video_res is not None
if self.video_res is not None:
video_resolution = f"{self.video_res[0]}x{self.video_res[1]}"
else:
video_resolution = "Not set"
console.print(
f"[cyan bold]Video [/cyan bold] [green]Available:[/green] [purple]{', '.join(list_available_resolution)}[/purple] | "
f"[red]Set:[/red] [purple]{FILTER_CUSTOM_REOLUTION}[/purple] | "
f"[yellow]Downloadable:[/yellow] [purple]{self.video_res[0]}x{self.video_res[1]}[/purple]"
f"[yellow]Downloadable:[/yellow] [purple]{video_resolution}[/purple]"
)
if self.parser.codec is not None:

View File

@ -43,6 +43,13 @@ def update():
timeout=config_manager.get_int("REQUESTS", "timeout"),
follow_redirects=True
).json()
response_commits = httpx.get(
url=f"https://api.github.com/repos/{__author__}/{__title__}/commits",
headers={'user-agent': get_userAgent()},
timeout=config_manager.get_int("REQUESTS", "timeout"),
follow_redirects=True
).json()
except Exception as e:
console.print(f"[red]Error accessing GitHub API: {e}")
@ -66,11 +73,23 @@ def update():
else:
percentual_stars = 0
# Check installed version
if str(__version__).replace('v', '') != str(last_version).replace('v', '') :
# Get the current version (installed version)
current_version = __version__
# Get commit details
latest_commit = response_commits[0] if response_commits else None
if latest_commit:
latest_commit_message = latest_commit.get('commit', {}).get('message', 'No commit message')
else:
latest_commit_message = 'No commit history available'
console.print(f"\n[cyan]Current installed version: [yellow]{current_version}")
console.print(f"[cyan]Last commit: [yellow]{latest_commit_message}")
if str(current_version).replace('v', '') != str(last_version).replace('v', ''):
console.print(f"\n[cyan]New version available: [yellow]{last_version}")
console.print(f"\n[red]{__title__} has been downloaded [yellow]{total_download_count} [red]times, but only [yellow]{percentual_stars}% [red]of users have starred it.\n\
[cyan]Help the repository grow today by leaving a [yellow]star [cyan]and [yellow]sharing [cyan]it with others online!")
time.sleep(3)
time.sleep(3)