Skip to content

Commit

Permalink
include warning
Browse files Browse the repository at this point in the history
  • Loading branch information
waska14 committed Oct 5, 2021
1 parent 581a054 commit 67aaab6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Overrides/YoutubeDl/YoutubeDl.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ public function getData(string $videoUrl): ?array
$videoUrl
]));
$output = $this->getProcessOutput($process);
$data = array_filter(preg_split('/[\r\n]/', $output));
if (count($data) == 4) {
$data = array_combine(['title', 'id', 'url', 'format'], $data);
} else {
$data = array_combine(['warning', 'title', 'id', 'url', 'format'], $data);
}
$data = array_combine([
'title', 'id', 'url', 'format'
], array_filter(preg_split('/[\r\n]/', $output)));
Expand Down

0 comments on commit 67aaab6

Please sign in to comment.