php-proxy icon indicating copy to clipboard operation
php-proxy copied to clipboard

Youtube images not be proxified

Open Shawn-Tong opened this issue 7 years ago • 2 comments

In the video page of youtube such as this one: https://www.youtube.com/watch?v=GeoUELDgyM4

The images on the right of the page are not proxified, such as this one: https://i.ytimg.com/vi/Q6dsRpVyyWs/hqdefault.jpg?custom=true&w=168&h=94&stc=true&jpg444=true&jpgq=90&sp=68&sigh=CdrLZ13uW2VKmznBKnQypFadBcI

In some places, ytimg.com is blocked too. Then those images can't be shown.

Could you please fix it?

Shawn-Tong avatar Sep 08 '16 03:09 Shawn-Tong

Looks like requests to i.ytimg.com are not proxied: https://postimg.org/image/jmcoapf6x/

webaddicto avatar Jan 24 '17 00:01 webaddicto

Found the fix:

Edit \src\Plugin\ProxifyPlugin.php

And add this line:

$str = preg_replace_callback('@data-thumb=(["|\'])(.*?)\1@i', array($this, 'html_src'), $str);

After line 167:

$str = preg_replace_callback('@src\s*=\s*(["|\'])(.*?)\1@i', array($this, 'html_src'), $str);

webaddicto avatar Jan 26 '17 18:01 webaddicto