mirror of
https://github.com/Arrowar/StreamingCommunity.git
synced 2025-06-05 02:55:25 +00:00
core: Fix hls error "self.video_res == None"
This commit is contained in:
parent
74218e3101
commit
4789c147e4
BIN
.github/media/logo.ico
vendored
BIN
.github/media/logo.ico
vendored
Binary file not shown.
Before Width: | Height: | Size: 4.4 KiB |
@ -189,10 +189,16 @@ class M3U8Manager:
|
|||||||
tuple_available_resolution = self.parser._video.get_list_resolution()
|
tuple_available_resolution = self.parser._video.get_list_resolution()
|
||||||
list_available_resolution = [f"{r[0]}x{r[1]}" for r in tuple_available_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(
|
console.print(
|
||||||
f"[cyan bold]Video [/cyan bold] [green]Available:[/green] [purple]{', '.join(list_available_resolution)}[/purple] | "
|
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"[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:
|
if self.parser.codec is not None:
|
||||||
|
@ -43,6 +43,13 @@ def update():
|
|||||||
timeout=config_manager.get_int("REQUESTS", "timeout"),
|
timeout=config_manager.get_int("REQUESTS", "timeout"),
|
||||||
follow_redirects=True
|
follow_redirects=True
|
||||||
).json()
|
).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:
|
except Exception as e:
|
||||||
console.print(f"[red]Error accessing GitHub API: {e}")
|
console.print(f"[red]Error accessing GitHub API: {e}")
|
||||||
@ -66,11 +73,23 @@ def update():
|
|||||||
else:
|
else:
|
||||||
percentual_stars = 0
|
percentual_stars = 0
|
||||||
|
|
||||||
# Check installed version
|
# Get the current version (installed version)
|
||||||
if str(__version__).replace('v', '') != str(last_version).replace('v', '') :
|
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[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\
|
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!")
|
[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)
|
Loading…
x
Reference in New Issue
Block a user