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

Youtube downloader script update stop working today #412

Closed
Amonpointh opened this issue Sep 11, 2019 · 11 comments
Closed

Youtube downloader script update stop working today #412

Amonpointh opened this issue Sep 11, 2019 · 11 comments

Comments

@Amonpointh
Copy link

All youtube script even the update stop working today

Any solution?

No format stream map found - was the video id correct?

This is a new isssue,

This issue started on September 10th

Any solution

@MCrissDev
Copy link

@developernazari
Copy link

It seams that the problem is not with this script.
i checked, all other youtube downloader scripts are stopped working too.

@developernazari
Copy link

developernazari commented Sep 11, 2019

i managed to fix the problem with some NOT pretty looking code!

in \src\Provider\Youtube\VideoInfo.php, line 231, change __construct function:

private function __construct(array $video_info, array $options)
    {
        $this->options = $options;
        $player_response = json_decode($video_info["player_response"],true);
        foreach ($this->allowed_keys as $key) {
            if (isset($video_info[$key])) {
                $this->data[$key] = $video_info[$key];
            } else {
                $this->data[$key] = null;
            }
        }
        $this->data["url_encoded_fmt_stream_map"] = $player_response["streamingData"]["formats"];
    }

now the "No format stream map found - was the video id correct?" error will disappear. but there is a problem with quality label. to fix quality label issue, i changed getQuality() and __construct() function inside \src\Provider\Youtube\Format.php:

    private function __construct(VideoInfo $video_info, array $data, array $config)
    {
        $this->video_info = $video_info;

        $this->config = [
            'decipher_signature' => (isset($config['decipher_signature'])) ? (bool) $config['decipher_signature'] : false,
        ];

        $allowed_keys = [
            'itag',
            's',
            'url',
            'quality',
            'qualityLabel',
        ];

        foreach ($allowed_keys as $key) {
            if (isset($data[$key])) {
                $this->data[$key] = $data[$key];
            } else {
                $this->data[$key] = null;
            }
        }

        $this->raw_data = $data;
    }

    public function getQuality()
    {
        $this->parseUrl();

        return $this->data['qualityLabel'];
    }

and there were another issue with extension name of file, when saving. in order to fix this issue i modified \src\Application\DownloadController.php file at line 60. i changed:
$ext = str_replace(['/', 'x-'], '', strstr($mime, '/'));
to:
$ext = $_GET['mime'];

i know there are many better ways to fix these issues, but it worked for me in a test, and i don't want to mess with it anymore.

@Amonpointh
Copy link
Author

After adding all the changes its showing error

Warning: explode() expects parameter 2 to be string, array given in /home/U/src/Provider/Youtube/VideoInfo.php on line 391

Catchable fatal error: Argument 1 passed to YoutubeDownloader\Provider\Youtube\VideoInfo::parseFormats() must be of the type array, null given, called in /home//U/src/Provider/Youtube/VideoInfo.php on line 392 and defined in /home//U/src/Provider/Youtube/VideoInfo.php on line 252

Not solved can you be more specific

@Amonpointh
Copy link
Author

and there were another issue with extension name of file, when saving. in order to fix this issue i modified \src\Application\DownloadController.php file at line 60. i changed:
$ext = str_replace(['/', 'x-'], '', strstr($mime, '/'));
to:
$ext = $_GET['mime'];

I can't find it at line 60

@robinfocke
Copy link

in line 50 but i have change all files , not work

@Amonpointh
Copy link
Author

Not working at all

@robinfocke
Copy link

I think he has a different code

@developernazari
Copy link

I'm sorry, it seams that i i had an old release installed.
I tried to download new release to address the issue in new codes, but it seems that new release is working fine now and there is no problem with downloading videos anymore.

@Amonpointh
Copy link
Author

It stopped working again

@jeckman
Copy link
Owner

jeckman commented Sep 17, 2019

I don't see any useful info in this thread that helps with debugging anything - closing as a dupe of #396

@jeckman jeckman closed this as completed Sep 17, 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

No branches or pull requests

5 participants