Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
fixed case of no format list found
Browse files Browse the repository at this point in the history
  • Loading branch information
mhama committed Jan 18, 2020
1 parent b9ede42 commit 41fb8f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Provider/Youtube/VideoInfo.php
Expand Up @@ -437,7 +437,7 @@ public function getFormats()
if (isset($this->data['url_encoded_fmt_stream_map'])) {
$formats = explode(',', $this->data['url_encoded_fmt_stream_map']);
$this->formats = $this->parseFormats($formats, $this->options);
} elseif (isset($this->player_response)) {
} elseif (isset($this->player_response) && isset($this->player_response['streamingData']) && isset($this->player_response['streamingData']['formats'])) {
$streaming_formats = $this->player_response['streamingData']['formats'];
$this->formats = $this->parseStreamingFormats($streaming_formats, $this->options);
} else {
Expand All @@ -460,7 +460,7 @@ public function getAdaptiveFormats()
if (isset($this->data['adaptive_fmts'])) {
$adaptive_formats = explode(',', $this->data['adaptive_fmts']);
$this->adaptive_formats = $this->parseFormats($adaptive_formats, $this->options);
} elseif (isset($this->player_response)) {
} elseif (isset($this->player_response) && isset($this->player_response['streamingData']) && isset($this->player_response['streamingData']['adaptiveFormats'])) {
$streaming_formats = $this->player_response['streamingData']['adaptiveFormats'];
$this->adaptive_formats = $this->parseStreamingFormats($streaming_formats, $this->options);
} else {
Expand Down

0 comments on commit 41fb8f8

Please sign in to comment.