mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-07 21:18:28 +00:00
[fd/dash] Re-extract if using --load-info-json with --live-from-start (#13922)
Closes #13906 Authored by: bashonly
This commit is contained in:
parent
662af5bb83
commit
fe53ebe5b6
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from . import get_suitable_downloader
|
from . import get_suitable_downloader
|
||||||
from .fragment import FragmentFD
|
from .fragment import FragmentFD
|
||||||
from ..utils import update_url_query, urljoin
|
from ..utils import ReExtractInfo, update_url_query, urljoin
|
||||||
|
|
||||||
|
|
||||||
class DashSegmentsFD(FragmentFD):
|
class DashSegmentsFD(FragmentFD):
|
||||||
@ -28,6 +28,11 @@ def real_download(self, filename, info_dict):
|
|||||||
requested_formats = [{**info_dict, **fmt} for fmt in info_dict.get('requested_formats', [])]
|
requested_formats = [{**info_dict, **fmt} for fmt in info_dict.get('requested_formats', [])]
|
||||||
args = []
|
args = []
|
||||||
for fmt in requested_formats or [info_dict]:
|
for fmt in requested_formats or [info_dict]:
|
||||||
|
# Re-extract if --load-info-json is used and 'fragments' was originally a generator
|
||||||
|
# See https://github.com/yt-dlp/yt-dlp/issues/13906
|
||||||
|
if isinstance(fmt['fragments'], str):
|
||||||
|
raise ReExtractInfo('the stream needs to be re-extracted', expected=True)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fragment_count = 1 if self.params.get('test') else len(fmt['fragments'])
|
fragment_count = 1 if self.params.get('test') else len(fmt['fragments'])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Loading…
Reference in New Issue
Block a user