Skip to content

Commit 4789c14

Browse files
committed
core: Fix hls error "self.video_res == None"
1 parent 74218e3 commit 4789c14

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

.github/media/logo.ico

-4.37 KB
Binary file not shown.

StreamingCommunity/Lib/Downloader/HLS/downloader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,16 @@ def log_selection(self):
189189
tuple_available_resolution = self.parser._video.get_list_resolution()
190190
list_available_resolution = [f"{r[0]}x{r[1]}" for r in tuple_available_resolution]
191191

192+
# Check if self.video_res is not None
193+
if self.video_res is not None:
194+
video_resolution = f"{self.video_res[0]}x{self.video_res[1]}"
195+
else:
196+
video_resolution = "Not set"
197+
192198
console.print(
193199
f"[cyan bold]Video [/cyan bold] [green]Available:[/green] [purple]{', '.join(list_available_resolution)}[/purple] | "
194200
f"[red]Set:[/red] [purple]{FILTER_CUSTOM_REOLUTION}[/purple] | "
195-
f"[yellow]Downloadable:[/yellow] [purple]{self.video_res[0]}x{self.video_res[1]}[/purple]"
201+
f"[yellow]Downloadable:[/yellow] [purple]{video_resolution}[/purple]"
196202
)
197203

198204
if self.parser.codec is not None:

StreamingCommunity/Upload/update.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ def update():
4343
timeout=config_manager.get_int("REQUESTS", "timeout"),
4444
follow_redirects=True
4545
).json()
46+
47+
response_commits = httpx.get(
48+
url=f"https://api.github.com/repos/{__author__}/{__title__}/commits",
49+
headers={'user-agent': get_userAgent()},
50+
timeout=config_manager.get_int("REQUESTS", "timeout"),
51+
follow_redirects=True
52+
).json()
4653

4754
except Exception as e:
4855
console.print(f"[red]Error accessing GitHub API: {e}")
@@ -66,11 +73,23 @@ def update():
6673
else:
6774
percentual_stars = 0
6875

69-
# Check installed version
70-
if str(__version__).replace('v', '') != str(last_version).replace('v', '') :
76+
# Get the current version (installed version)
77+
current_version = __version__
78+
79+
# Get commit details
80+
latest_commit = response_commits[0] if response_commits else None
81+
if latest_commit:
82+
latest_commit_message = latest_commit.get('commit', {}).get('message', 'No commit message')
83+
else:
84+
latest_commit_message = 'No commit history available'
85+
86+
console.print(f"\n[cyan]Current installed version: [yellow]{current_version}")
87+
console.print(f"[cyan]Last commit: [yellow]{latest_commit_message}")
88+
89+
if str(current_version).replace('v', '') != str(last_version).replace('v', ''):
7190
console.print(f"\n[cyan]New version available: [yellow]{last_version}")
7291

7392
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\
7493
[cyan]Help the repository grow today by leaving a [yellow]star [cyan]and [yellow]sharing [cyan]it with others online!")
7594

76-
time.sleep(3)
95+
time.sleep(3)

0 commit comments

Comments
 (0)