mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-09 17:24:10 +01:00
Lock less agressively
This gives a speed performance of about 30%
This commit is contained in:
parent
2fbe18557b
commit
01f672fe27
1 changed files with 5 additions and 5 deletions
|
@ -2724,17 +2724,17 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
microformats = traverse_obj(
|
microformats = traverse_obj(
|
||||||
prs, (..., 'microformat', 'playerMicroformatRenderer'),
|
prs, (..., 'microformat', 'playerMicroformatRenderer'),
|
||||||
expected_type=dict)
|
expected_type=dict)
|
||||||
_, live_status, _, formats, _ = self._list_formats(video_id, microformats, video_details, prs, player_url)
|
with lock:
|
||||||
is_live = live_status == 'is_live'
|
_, live_status, _, formats, _ = self._list_formats(video_id, microformats, video_details, prs, player_url)
|
||||||
start_time = time.time()
|
is_live = live_status == 'is_live'
|
||||||
|
start_time = time.time()
|
||||||
|
|
||||||
def mpd_feed(format_id, delay):
|
def mpd_feed(format_id, delay):
|
||||||
"""
|
"""
|
||||||
@returns (manifest_url, manifest_stream_number, is_live) or None
|
@returns (manifest_url, manifest_stream_number, is_live) or None
|
||||||
"""
|
"""
|
||||||
for retry in self.RetryManager(fatal=False):
|
for retry in self.RetryManager(fatal=False):
|
||||||
with lock:
|
refetch_manifest(format_id, delay)
|
||||||
refetch_manifest(format_id, delay)
|
|
||||||
|
|
||||||
f = next((f for f in formats if f['format_id'] == format_id), None)
|
f = next((f for f in formats if f['format_id'] == format_id), None)
|
||||||
if not f:
|
if not f:
|
||||||
|
|
Loading…
Reference in a new issue