用apache nutch爬行视频

时间:2016-04-19 15:23:15

标签: apache hadoop web-crawler nutch

如何使用Apache Nutch获取这样的视频标签:

<video width="320" height="240" controls>
  <source src="video/video.mp4" type="video/mp4">
  <source src="video/video.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>

Apache nutch可以获取图片标签,但不能在视频源中使用。任何人都可以指导我吗?

感谢您的帮助

2 个答案:

答案 0 :(得分:1)

我已经通过在插件parse-html(DOMContentUtils.java)上添加源标记来解决这个问题

trait

然后用ant重建。

希望它对其他人有用

答案 1 :(得分:0)

您需要将此插入 parse-plugins.xml。

<mimeType name="video/mp4">
    <plugin id="parse-tika" />
</mimeType>

<mimeType name="video/ogg">
    <plugin id="parse-tika" />
</mimeType>

在插件中添加parse-tika包含 nutch-site.xml 的属性。

<property>
        <name>plugin.includes</name>
        <value>protocol-http|urlfilter-regex|parse-(text|html|tika)|index-(basic|anchor)|query-(basic|site|url)|response-(json|xml)|summary-basic|urlnormalizer-(pass|regex|basic)</value>

    </property>