CutyCapt dont work with flash

2019-07-07 00:42发布

问题:

I am trying to capture some websites containing Adobe Flash elements with cutycapt with no luck.

My PHP script:

$url=escapeshellarg($url);
$filename=escapeshellarg($filenamebase);
$format=escapeshellarg($format);
$useragent=escapeshellarg($useragent);

$cmd = "xvfb-run --server-args=\"-screen 0, ".$width."x".$height."x24\" CutyCapt --url=$url --out=$filename --out-format=$format --user-agent=$useragent --plugins=\"on\" --delay=5000 --javascript=$js";

exec($cmd);

For exampe, if i want capture http://flashhry.cz/h/kingdom-rush my script is running this cmd in shell:

xvfb-run --server-args="-screen 0, 1024x5000x24" CutyCapt --url='http://sk.search.etargetnet.com/cookie.php?eURL=http%3A%2F%2Fflashhry.cz%2Fh%2Fkingdom-rush' --out='./screens/http_flashhry.cz_h_kingdom-rush.png' --out-format='png' --user-agent='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0' --plugins="on" --delay=5000 --javascript=on

output (http://prntscr.com/5pxc7e) is without flash

commands stdout was:

Xlib:  extension "RANDR" missing on display ":99".

no error output.

I need it work on CentOS 6 server, but my Ubuntu desktop have similar results.

回答1:

Try this for a reference implementation:

https://github.com/jaequery/php-site-screenshot

Note the install script as well for Ubuntu. It might give you an idea of the dependencies for CentOS as well.

https://github.com/jaequery/cutycapt-installer-script-on-ubuntu/blob/master/install

If it still fails, I would imagine that CentOS 6 might be too old to meet the requirements.