Closed KUNKUN2121 closed 4 years ago
haha, I have found the solution
haha, I have found the solution
Am also facing the same issue. How did you manage to fix it?
haha, I have found the solution
Am also facing the same issue. How did you manage to fix it?
actually it comes from reddit
just delete the cookie setting and made the ua like you are a google bot
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
@Athlon1600 please fix it, I can not pr now
haha, I have found the solution
Am also facing the same issue. How did you manage to fix it?
actually it comes from reddit
just delete the cookie setting and made the ua like you are a google bot
Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
@Athlon1600 please fix it, I can not pr now
Can you elaborate on how you fixed the issue? I'm having the same problem
Still Broken Above User-Agent Doesn't Work
It broke again...I have found it...
OK I likely fixed it, but it still has some limits First, make it like this
// force old YouTube layout!
public function onBeforeRequest(ProxyEvent $event)
{
//$event['request']->headers->set('Cookie', 'PREF=f6=8');
$event['request']->headers->set('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
}
This will fix the layout in video pages etc.
Then like this
//in onCompleted function
$url = $event['request']->getUrl();
if( (!preg_match('/watch/',$url)) && (!preg_match('/results/',$url)) && (!preg_match('/feed/',$url)) && (!preg_match('/channel/',$url)) && (!preg_match('/ombed/',$url)) && (!preg_match('/css/',$url)) ) //if in the homepage
die(header('location:index.php?q=https%3A%2F%2Fwww.youtube.com%2Ffeed%2Ftrending')); //only in url mode 0 , if you want to use it in other mode, try to post url to index.php
This code will direct users to the feed page which works well...
Nevermind Got It To Work thanks! One Question Do You get 720P YouTube on your proxy when setting the resolution?
Thanks so much!
Nevermind Got It To Work thanks! One Question Do You get 720P YouTube on your proxy when setting the resolution?
I replaced 480 with 720, It seems has a better quality...I'm not sure
According to the code, It seems has a priority in finding the video urls... so it might just find a .mp4 format video ...
@kinglyl 's solution appears to be working. We're giving up on trying to make homepage load, and redirecting straight to trending page. https://github.com/Athlon1600/php-proxy-plugin-bundle/commit/541ee4376e8d59fe5ca1b712e61a522fbf4c13b6
Now just do composer update
and it should work, because it already works on here:
https://unblockvideos.com/
you'd have to change the logic here: https://github.com/Athlon1600/php-proxy-plugin-bundle/blob/master/src/YoutubePlugin.php#L62
which currently works by just taking the first video it finds which happens to be 360 rather than 720.
which currently works by just taking the first video it finds which happens to be 480 rather than 720.
$links = $youtube->getDownloadLinks($url, "mp4 360, mp4");
why 480? why not 360........
sorry, meant to write 360 not 480. And the reason it default to such low resolution is because back when this was coded in, I had very limited bandwidth and lots of people who were using youtube, so this was the only way to not exceed my monthly bandwidth limits...
This issue can be closed now
Holy SH*T Youtube seems not working in old layout again in my site And unblockvideos.com are facing 429 error so I don't know whither it is only my problem or not
I can see trending page in old layout, but video page is in new now
Maybe a cache problem? It doesn't work for me.
I can see trending page in old layout, but video page is in new now
Now I can see video page in old layout but trending page is in new
It seems Html::remove_scripts()
does't work in https://www.youtube.com and https://www.youtube.com/gaming
Trending page broken!
I'm aware, but that page on youtube heavily depends on javascript and php-proxy does not parse javascript well. Hopefully I can find a solution to this...
It seems that the only way to solve the problem is redirect to a specific video page combine PREF and GoogleBot UA
public function onBeforeRequest(ProxyEvent $event)
{
$event['request']->headers->set('Cookie', 'PREF=f6=8');
$event['request']->headers->set('User-Agent', 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
}
and
// homepage will never work properly. Redirect to trending instead.
if (!preg_match('/(watch|results|ombed|css)/i', $url)) {
$response->headers->set('location', proxify_url("https://www.youtube.com/watch?v=kXShLPXfWZA", $url));//you can change it
return;
}
So users can open Youtube and find videos in the result page
When I try to watch YouTube, it says "Please update your browser" and cannot be displayed even if you press "Notify me later"