@@ -230,6 +230,18 @@ class Options
230
230
private ?string $ convertSubsFormat = null ;
231
231
private bool $ forceKeyframesAtCuts = false ;
232
232
233
+ // Extractor Options
234
+ /**
235
+ * @var int|'infinite'|null
236
+ */
237
+ private $ extractorRetries ;
238
+ private bool $ allowDynamicMpd = false ;
239
+ private bool $ hlsSplitDiscontinuity = false ;
240
+ /**
241
+ * @var array<non-empty-string, string>
242
+ */
243
+ private array $ extractorArgs = [];
244
+
233
245
/**
234
246
* @var list<non-empty-string>
235
247
*/
@@ -1666,6 +1678,69 @@ public function convertSubsFormat(?string $subsFormat): self
1666
1678
return $ new ;
1667
1679
}
1668
1680
1681
+ /**
1682
+ * @param int|'infinite'|null $retries
1683
+ */
1684
+ public function extractorRetries ($ retries ): self
1685
+ {
1686
+ $ new = clone $ this ;
1687
+ $ new ->extractorRetries = $ retries ;
1688
+
1689
+ return $ new ;
1690
+ }
1691
+
1692
+ /**
1693
+ * Process dynamic DASH manifests.
1694
+ */
1695
+ public function allowDynamicMpd (bool $ allowDynamicMpd ): self
1696
+ {
1697
+ $ new = clone $ this ;
1698
+ $ new ->allowDynamicMpd = $ allowDynamicMpd ;
1699
+
1700
+ return $ new ;
1701
+ }
1702
+
1703
+ /**
1704
+ * Split HLS playlists to different formats at discontinuities such as ad breaks.
1705
+ */
1706
+ public function hlsSplitDiscontinuity (bool $ hlsSplitDiscontinuity ): self
1707
+ {
1708
+ $ new = clone $ this ;
1709
+ $ new ->hlsSplitDiscontinuity = $ hlsSplitDiscontinuity ;
1710
+
1711
+ return $ new ;
1712
+ }
1713
+
1714
+ /**
1715
+ * Pass args for a single extractor.
1716
+ *
1717
+ * @see https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#extractor-arguments
1718
+ *
1719
+ * @param non-empty-string $extractor
1720
+ */
1721
+ public function extractorArgs (string $ extractor , string $ args ): self
1722
+ {
1723
+ $ new = clone $ this ;
1724
+ $ new ->extractorArgs [$ extractor ] = $ args ;
1725
+
1726
+ return $ new ;
1727
+ }
1728
+
1729
+ /**
1730
+ * Pass args for all extractors.
1731
+ *
1732
+ * @see https://github.com/yt-dlp/yt-dlp?tab=readme-ov-file#extractor-arguments
1733
+ *
1734
+ * @param array<non-empty-string, string> $extractorArgs
1735
+ */
1736
+ public function extractorsArgs (array $ extractorArgs ): self
1737
+ {
1738
+ $ new = clone $ this ;
1739
+ $ new ->extractorArgs = $ extractorArgs ;
1740
+
1741
+ return $ new ;
1742
+ }
1743
+
1669
1744
/**
1670
1745
* @param non-empty-string $url
1671
1746
* @param non-empty-string ...$urls
@@ -1825,6 +1900,12 @@ public function toArray(): array
1825
1900
'exec ' => $ this ->exec ,
1826
1901
'convert-subs-format ' => $ this ->convertSubsFormat ,
1827
1902
'force-keyframes-at-cuts ' => $ this ->forceKeyframesAtCuts ,
1903
+ // Extractor Options
1904
+ 'extractor-retries ' => $ this ->extractorRetries ,
1905
+ 'allow-dynamic-mpd ' => $ this ->allowDynamicMpd ,
1906
+ 'hls-split-discontinuity ' => $ this ->hlsSplitDiscontinuity ,
1907
+ 'extractor-args ' => $ this ->extractorArgs ,
1908
+
1828
1909
'url ' => $ this ->url ,
1829
1910
];
1830
1911
}
0 commit comments