| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 9 | class YoutubeDownloader extends AbstractDownloader |
||
| 10 | { |
||
| 11 | /** @var array $options */ |
||
| 12 | protected $options; |
||
| 13 | |||
| 14 | /** @var string $youtubeVideoURL */ |
||
| 15 | protected $youtubeVideoURL; |
||
| 16 | |||
| 17 | public function getURL() : string |
||
| 18 | { |
||
| 19 | $this->youtubeVideoURL = 'https://www.youtube.com/watch?v=' . $this->getVideoId(); |
||
| 20 | |||
| 21 | $yt = new \YouTube\YouTubeDownloader(); |
||
| 22 | $links = $yt->getDownloadLinks($this->youtubeVideoURL); |
||
| 23 | |||
| 24 | $videoFilter = new VideoResultFilter(); |
||
| 25 | $videoFilter->setValidator(new CUrlValidator()); |
||
| 26 | $formatVideos = $videoFilter->filter($links, $this->getFormats()); |
||
|
|
|||
| 27 | |||
| 28 | $formatVideos = $this->filterByFormats($formatVideos); |
||
| 29 | |||
| 30 | return array_values($formatVideos)[0]; |
||
| 31 | } |
||
| 32 | |||
| 33 | public static function getPublicUrlRegex(): string |
||
| 36 | } |
||
| 37 | |||
| 38 | public static function getType(): string |
||
| 43 |