Fixes to live_from_start
This commit is contained in:
parent
28ea6c6aa9
commit
f1a04acaaf
2 changed files with 4 additions and 3 deletions
|
|
@ -1088,6 +1088,7 @@ def extract_ytdlp_logs(logs: list[str], filters: list[str | re.Pattern] = None)
|
||||||
"Video unavailable. This video is private",
|
"Video unavailable. This video is private",
|
||||||
"This video is available to this channel",
|
"This video is available to this channel",
|
||||||
"Private video. Sign in if you've been granted access to this video",
|
"Private video. Sign in if you've been granted access to this video",
|
||||||
|
"[youtube] Premieres in",
|
||||||
] + (filters or [])
|
] + (filters or [])
|
||||||
|
|
||||||
compiled: list[re.Pattern] = [
|
compiled: list[re.Pattern] = [
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ def _patched_prepare_live_from_start_formats(
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from yt_dlp.utils import LazyList, bug_reports_message
|
from yt_dlp.utils import LazyList, bug_reports_message, traverse_obj
|
||||||
|
|
||||||
lock = threading.Lock()
|
lock = threading.Lock()
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
@ -46,8 +46,8 @@ def _patched_prepare_live_from_start_formats(
|
||||||
return
|
return
|
||||||
# re-download player responses & re-list formats
|
# re-download player responses & re-list formats
|
||||||
_, _, prs, player_url = self._download_player_responses(url, smuggled_data, video_id, webpage_url)
|
_, _, prs, player_url = self._download_player_responses(url, smuggled_data, video_id, webpage_url)
|
||||||
video_details = self.traverse_obj(prs, (..., "videoDetails"), expected_type=dict)
|
video_details = traverse_obj(prs, (..., "videoDetails"), expected_type=dict)
|
||||||
microformats = self.traverse_obj(prs, (..., "microformat", "playerMicroformatRenderer"), expected_type=dict)
|
microformats = traverse_obj(prs, (..., "microformat", "playerMicroformatRenderer"), expected_type=dict)
|
||||||
_, live_status, _, formats, _ = self._list_formats(video_id, microformats, video_details, prs, player_url)
|
_, live_status, _, formats, _ = self._list_formats(video_id, microformats, video_details, prs, player_url)
|
||||||
is_live = live_status == "is_live"
|
is_live = live_status == "is_live"
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue