@@ -125,6 +125,7 @@ class Options
125
125
private bool $ hlsUseMpegts = false ;
126
126
private ?string $ externalDownloader = null ;
127
127
private ?string $ externalDownloaderArgs = null ;
128
+ private ?string $ downloadSections = null ;
128
129
129
130
// Filesystem Options
130
131
private ?string $ batchFile = null ;
@@ -227,6 +228,7 @@ class Options
227
228
private ?string $ ffmpegLocation = null ;
228
229
private ?string $ exec = null ;
229
230
private ?string $ convertSubsFormat = null ;
231
+ private bool $ forceKeyframesAtCuts = false ;
230
232
231
233
/**
232
234
* @var list<non-empty-string>
@@ -1502,6 +1504,30 @@ public function audioQuality(?string $audioQuality): self
1502
1504
return $ new ;
1503
1505
}
1504
1506
1507
+ /**
1508
+ * Download only chapters that match the regular expression.
1509
+ */
1510
+ public function downloadSections (?string $ downloadSections ): self
1511
+ {
1512
+ $ new = clone $ this ;
1513
+ $ new ->downloadSections = $ downloadSections ;
1514
+
1515
+ return $ new ;
1516
+ }
1517
+
1518
+ /**
1519
+ * Force keyframes at cuts when downloading/splitting/removing sections.
1520
+ * This is slow due to needing a re-encode, but the resulting video
1521
+ * may have fewer artifacts around the cuts.
1522
+ */
1523
+ public function forceKeyframesAtCuts (bool $ forceKeyframesAtCuts ): self
1524
+ {
1525
+ $ new = clone $ this ;
1526
+ $ new ->forceKeyframesAtCuts = $ forceKeyframesAtCuts ;
1527
+
1528
+ return $ new ;
1529
+ }
1530
+
1505
1531
/**
1506
1532
* Remux the video into another container if necessary (currently supported:
1507
1533
* avi, flv, gif, mkv, mov, mp4, webm, aac, aiff, alac, flac, m4a, mka, mp3, ogg,
@@ -1713,6 +1739,7 @@ public function toArray(): array
1713
1739
'hls-use-mpegts ' => $ this ->hlsUseMpegts ,
1714
1740
'external-downloader ' => $ this ->externalDownloader ,
1715
1741
'external-downloader-args ' => $ this ->externalDownloaderArgs ,
1742
+ 'download-sections ' => $ this ->downloadSections ,
1716
1743
// Filesystem Options
1717
1744
'batch-file ' => $ this ->batchFile ,
1718
1745
'id ' => $ this ->id ,
@@ -1797,6 +1824,7 @@ public function toArray(): array
1797
1824
'ffmpeg-location ' => $ this ->ffmpegLocation ,
1798
1825
'exec ' => $ this ->exec ,
1799
1826
'convert-subs-format ' => $ this ->convertSubsFormat ,
1827
+ 'force-keyframes-at-cuts ' => $ this ->forceKeyframesAtCuts ,
1800
1828
'url ' => $ this ->url ,
1801
1829
];
1802
1830
}
0 commit comments