【问题标题】:CutyCapt dont work with flashCutyCapt 不适用于闪光灯
【发布时间】:2015-01-08 14:13:10
【问题描述】:

我正在尝试使用 cutycapt 捕获一些包含 Adob​​e Flash 元素的网站,但没有成功。

我的 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 中运行这个 cmd:

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

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

命令标准输出是:

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

没有错误输出。

我需要它在 CentOS 6 服务器上工作,但我的 Ubuntu 桌面也有类似的结果。

【问题讨论】:

  • 我向 CutyCapt 的作者询问了关于捕获 Flash 内容的问题,他确认至少当前版本不支持。
  • 还有其他选择吗?除了 webkit2png - 我无法让它工作。
  • 有些替代品,看here,我没测试过。

标签: flash cutycapt


【解决方案1】:

试试这个作为参考实现:

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

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

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

如果仍然失败,我想 CentOS 6 可能太旧而无法满足要求。

【讨论】:

  • 这需要cutycapt,它不能做flash。它只是一个简单的 php 脚本,和我自己的 php 脚本完全一样(虽然我的更复杂)
  • Cutycapt 至少在某一点上可以很好地使用 Flash。如果作者证实了这一点,我无法争论,但它之前确实有效。
  • 据此:stackoverflow.com/questions/10990535/debugging-cutycapt-flash 我认为它可以以某种方式与闪存一起使用。我只是很不幸,我无法让它工作。
  • 对我来说效果很好(这是你链接的我的问题)。确保它是桌面发行版并且实际上安装了 Flash。除此之外,检查您的延迟参数并将其设置为毫秒(不是秒)。在捕获之前,您必须留出足够的时间让 Flash 执行和加载。
  • 正如我所说,我有自己的 php(它做同样的事情,但有更多的选择)来做到这一点,并在 CentOS 服务器和 Ubuntu 桌面上进行了尝试,两者都安装了 flash 并且可以正常工作。我尝试延迟最多 10 秒(足够的时间让闪光灯加载)。问题不在于 php,也不在于延迟(您可以在我的问题中看到我的 php 到底在执行什么)。问题是 CutyCapt 无法看到(和输出)flash 元素。
猜你喜欢
  • 1970-01-01
  • 2016-05-29
  • 1970-01-01
  • 1970-01-01
  • 2014-12-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多