mirror of
https://github.com/NohamR/OqeeRewind.git
synced 2026-01-11 00:28:16 +00:00
Improve error handling and track selection logic
This commit is contained in:
@@ -413,8 +413,22 @@ def select_track(content_dict, quality_spec, content_type):
|
||||
|
||||
candidates = []
|
||||
for key, tracks in content_dict.items():
|
||||
if filter_part and filter_part.lower() not in key.lower():
|
||||
continue
|
||||
if filter_part:
|
||||
should_skip = True
|
||||
if content_type == "video" and "x" in key:
|
||||
# For video, check height
|
||||
try:
|
||||
_, height = key.split("x")
|
||||
if filter_part.endswith("p"):
|
||||
target_height = filter_part[:-1]
|
||||
else:
|
||||
target_height = filter_part
|
||||
if target_height in height:
|
||||
should_skip = False
|
||||
except ValueError:
|
||||
pass
|
||||
if should_skip and filter_part.lower() not in key.lower():
|
||||
continue
|
||||
candidates.extend(tracks)
|
||||
|
||||
if not candidates:
|
||||
|
||||
Reference in New Issue
Block a user