Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
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 | } |
||
43 |