CutyCapt不使用闪光灯 [英] CutyCapt dont work with flash

查看:164
本文介绍了CutyCapt不使用闪光灯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的PHP脚本:

  $ 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);

例如,如果我想捕获 http://flashhry.cz/h/kingdom-rush 我的脚本在shell中运行这个命令:

  xvfb-run --server-args = -  screen 0,1024x5000x24CutyCapt --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 

输出( http://prntscr.com/5pxc7e)没有闪光



命令stdout是:

pre $ Xlib: RANDR扩展名缺失:99。

无错误输出。



它可以在CentOS 6服务器上运行,但是我的Ubuntu桌面也有相似的结果。

试试这个参考实现:



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



请注意Ubuntu的安装脚本。它可能会让你了解CentOS的依赖关系。



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



如果仍然失败,我会想象CentOS 6可能太老了,无法满足要求。


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.

解决方案

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.

这篇关于CutyCapt不使用闪光灯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆