Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grabbing original file location(s) failed. #10

Open
nickdodd25 opened this issue Oct 17, 2013 · 17 comments
Open

Grabbing original file location(s) failed. #10

nickdodd25 opened this issue Oct 17, 2013 · 17 comments

Comments

@nickdodd25
Copy link

Seems that this issue is back.

"Grabbing original file location(s) failed."

I just installed this for the first time on my vps (Centos 5.9) and that is all i get. I also see that 10 months ago this issue was fixed once so it must have came back again recently. If you need any more info on this issue let me know

@subet
Copy link

subet commented Jan 23, 2014

I have the same problem. All examples showing the same error message. I have Centos 6.5 (x86_64 virtuozzo – vps-1132179-16404) hosting with FFMpeg installed.

For example: http://www.youtubeindirici.com/labs/stable/example-audio-1.php

@apurbapathak
Copy link

Same issue on my server.

@andru183
Copy link

andru183 commented Oct 4, 2014

Did anyone ever fix this? Still have this issue

@abumq
Copy link

abumq commented Oct 22, 2014

Anyone?

@MyDigitalNeeds
Copy link

I wonder if any other installs of this software have since broken. I do not have time to figure this out, or i would.

@mammuth
Copy link

mammuth commented Jan 3, 2015

Get the same error.

@maykbrito
Copy link

hello.
I found this class today and face same problem.

Here's my solution

Change line 472:

$htmlTitle = htmlentities(utf8_decode($pb_info["title"]));

With:

$htmlTitle = htmlentities(utf8_decode($pb_info["title"]), ENT_QUOTES | ENT_IGNORE, "UTF-8");

AND

line 576:

$title = htmlentities(utf8_decode($title));

With:

$title = htmlentities(utf8_decode($title), ENT_QUOTES | ENT_IGNORE, "UTF-8");

@pperrin
Copy link

pperrin commented Oct 3, 2015

I get this error two or three times then it works (no change just call it again!)... haven't sorted out why - but youtube must be returning different values each time(?)

@neotropic2023
Copy link

NVM, was not it.

But the problem is with the crazy randomness of the string returned and used in "function get_url_map($data)"

OK, I actually think it is youtube messing with me now. My statement does work. I think with me doing way to many requests debugging, they do not like that

So again, since the string is so random, altered a bit of code in the function mentioned above.

REPLACE

           foreach($urls as $url) {
                if(preg_match('/itag=([0-9]+)&url=(.*?)&.*?/si',$url,$um))
                {
                    $u = urldecode($um[2]);
                    $tmp[$um[1]] = $u;
                }
            }

WITH

            foreach($urls as $url) {
                $lines = explode('&',$url);
                $num = '';
                $url = '';
                foreach($lines as $u){
                    $num = ((empty($num)) && (preg_match("/itag=/i",$u))) ? str_replace("itag=","",$u):$num;
                    $url = ((empty($url)) && (preg_match("/url=/i",$u))) ? str_replace("url=","",$u):$url;
                    if((!empty($url)) && ((!empty($num)))){
                        $tmp[$num] = urldecode($url);
                        break;
                    }
                }
            }

bascoder added a commit to bascoder/php-yt_downloader that referenced this issue Mar 26, 2016
@asilva732
Copy link

was this issue resolved? I'm still having this issue on line 534. I do a Cygwin environment that runs fine when just downloading videos.

Also noticed all the php scripts are missing their closing syntax (?>). Never worked with php before so pardon if I am not using the correct term.

Edit: No problems encountered with applying the two code updates above.

@neotropic2023
Copy link

Even with my changes, I still get random fails. But with how I created my generator, I just have them hit a re-fetch/retry button and it works. Located here: http://www.neotropicworks.com/youtube/

Granted, nothing you can do if the file is restricted or what not.

I will have to see what they changed on this as of late. I am sure what I put up above can be improved maybe.

@neotropic2023
Copy link

@asilva732

The closing PHP tags should not matter really if they are there or not. I guess would depend on the server. The script would not run period if it was an issue. I always close them any ways if I see them missing.

@hersche
Copy link

hersche commented Jan 30, 2017

it looks like a fork fixed this already?

bascoder@48d9a60

not shure, just on a run-through by searching components for projects..

@Levan777
Copy link

maykbrito, neotropic2023, YOU SAVED MY LIFE!! Thanks!

@dom-robinson
Copy link

dom-robinson commented Jan 23, 2018

I implemented maykbrito and neotropic2023's suggestions which have massively increased reliability.

Something else that is an issue: I added an echo here:

        $url = sprintf($this->YT_INFO_ALT, urlencode($url));

        echo nl2br ($vid_id." received as ".$url." \n");**

        if(self::curl_httpstatus($url) !== 200) {
            throw new Exception("Invalid Youtube video ID: $vid_id");
            exit(); }
        else { 
            self::set_video_id($vid_id); 
        }

It showed me that requests to videos on youtube which did not allow embedding were 'unauthorised' when they should be returning some JSON.

Once i allowed embedding on the video these files returned successfully - although occasionally the return is obviously too slow from Youtube to be 100% reliable.

Im having a think about how to make the process a little more reliable.

@Lerie82
Copy link

Lerie82 commented Apr 13, 2018

Nothing here resolves this issue. This software does not work.

@Babashov
Copy link

hello.
I found this class today and face same problem.

Here's my solution

Change line 472:

$htmlTitle = htmlentities(utf8_decode($pb_info["title"]));

With:

$htmlTitle = htmlentities(utf8_decode($pb_info["title"]), ENT_QUOTES | ENT_IGNORE, "UTF-8");

AND

line 576:

$title = htmlentities(utf8_decode($title));

With:

$title = htmlentities(utf8_decode($title), ENT_QUOTES | ENT_IGNORE, "UTF-8");

I did your solution but still getting this error: Grabbing original file location(s) failed. Youtube error message: HTTP is not supported.&status=fail&errorcode=180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests