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

Fix 'No format stream map found' issue (421) #422

Merged
merged 2 commits into from
Oct 29, 2019

Conversation

zannix
Copy link

@zannix zannix commented Oct 19, 2019

Example YouTube video: https://www.youtube.com/watch?v=kXYiU_JCYtU

It used to show 'No format stream map found' message, now it works fine as long as 'enable_youtube_decipher_signature' is set to true in config.php

…WithOptions() - fixes the issue of 'No format stream map found'
@zannix zannix changed the title Fix 'No format stream map found' issue (412) Fix 'No format stream map found' issue (421) Oct 19, 2019
@jeckman jeckman requested a review from Art4 October 19, 2019 15:21

$options = ['curl' => []];

if ($this->options['use_ip'] !== false) {
$options['curl'][CURLOPT_INTERFACE] = $this->options['use_ip'];
}

$video_info_url = 'https://www.youtube.com/get_video_info?&video_id=' . $input . '&asv=3&el=detailpage&hl=en_US';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the url would undo the improvements of #365.

Comment on lines -153 to -160
//But just incase it doesn't, we can fallback to the old URL.
if (strpos($response->getBody()->__toString(), 'status=fail') !== false) {
$video_info_url = 'https://www.youtube.com/get_video_info?&video_id=' . $input . '&asv=3&el=detailpage&hl=en_US';
$request = $this->getHttpClient()->createFullRequest(
'GET',
$video_info_url
);
$response = $this->getHttpClient()->send($request, $options);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback was introduced with #365. Why do you deleted it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fallback is falling back on the URL that is the only one actually working right now, therefore I commented out the old URL and substituted it with the new one and deleted the fallback. The benefit of getting age restricted videos is no longer there if no videos are working at the moment.

* @param array $options
* @param mixed $string
*
* @return VideoInfo
*/
public static function createFromStringWithOptions($string, array $options)
public static function createFromStringWithOptions($string, array $options, $video_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new 3rd parameter must either have a default value or the tests must be changed to reflect this change. All travis builds failed because of this.
https://travis-ci.org/jeckman/YouTube-Downloader/builds/600005207

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, new commit addresses this issue

@@ -182,6 +182,9 @@ public static function createFromStringWithOptions($string, array $options)

parse_str($string, $video_info);

// $string may not contain video_id, so we append it manually
$video_info['video_id'] = $video_id;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should check if video_id isn't set already before we overwrite it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done inside the new commit

@Art4
Copy link
Collaborator

Art4 commented Oct 19, 2019

This PR would undo some improvements of #365 from @BenNottelling
Not sure if this is correct.

@zannix
Copy link
Author

zannix commented Oct 27, 2019

Please review changes

Copy link
Collaborator

@Art4 Art4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Ping @jeckman

@jeckman jeckman merged commit 2286183 into jeckman:master Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants