From e6a22834df1776ec4e486526f6df2bf53cb7e06f Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Mon, 1 Jul 2024 12:43:52 +0200 Subject: [PATCH] [ie/orf:on] Allow downloading of video in segments (#10314) Closes #10142 Authored by: seproDev --- README.md | 3 +++ yt_dlp/extractor/orf.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ea7c67174..794d507b2 100644 --- a/README.md +++ b/README.md @@ -1851,6 +1851,9 @@ #### afreecatvlive #### soundcloud * `formats`: Formats to request from the API. Requested values should be in the format of `{protocol}_{extension}` (omitting the bitrate), e.g. `hls_opus,http_aac`. The `*` character functions as a wildcard, e.g. `*_mp3`, and can passed by itself to request all formats. Known protocols include `http`, `hls` and `hls-aes`; known extensions include `aac`, `opus` and `mp3`. Original `download` formats are always extracted. Default is `http_aac,hls_aac,http_opus,hls_opus,http_mp3,hls_mp3` +#### orfon (orf:on) +* `prefer_segments_playlist`: Prefer a playlist of program segments instead of a single complete video when available. If individual segments are desired, use `--concat-playlist never --extractor-args "orfon:prefer_segments_playlist"` + **Note**: These options may be changed/removed in the future without concern for backward compatibility diff --git a/yt_dlp/extractor/orf.py b/yt_dlp/extractor/orf.py index f1403d920..9c37a54d6 100644 --- a/yt_dlp/extractor/orf.py +++ b/yt_dlp/extractor/orf.py @@ -550,7 +550,8 @@ def _real_extract(self, url): return self._extract_video_info(segment_id, selected_segment) # Even some segmented videos have an unsegmented version available in API response root - if not traverse_obj(api_json, ('sources', ..., ..., 'src', {url_or_none})): + if (self._configuration_arg('prefer_segments_playlist') + or not traverse_obj(api_json, ('sources', ..., ..., 'src', {url_or_none}))): return self.playlist_result( (self._extract_video_info(str(segment['id']), segment) for segment in segments), video_id, **self._parse_metadata(api_json), multi_video=True)