summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-08-02 17:01:53 +0300
committerAndrew Dolgov <[email protected]>2016-08-02 17:01:53 +0300
commit46506d3fd69b1dd8137bddf08ed8596771bf0b89 (patch)
tree3759c9f97feb674211875c7849cdde03094dc330 /plugins
parent8c395462be32131fde2aa1f89c5fbc8b99c418a0 (diff)
af_redditimgur: rework gfycat pages
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/af_redditimgur/init.php21
1 files changed, 7 insertions, 14 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 02c499c6f..e43846abf 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -138,25 +138,18 @@ class Af_RedditImgur extends Plugin {
if (@$tmpdoc->loadHTML($tmp)) {
$tmpxpath = new DOMXPath($tmpdoc);
- $source_meta = $tmpxpath->query("//meta[@name='twitter:player:stream' and contains(@content, '.mp4')]")->item(0);
- $poster_meta = $tmpxpath->query("//meta[@property='og:image' and contains(@content,'thumbs.gfycat.com')]")->item(0);
+ $source_node = $tmpxpath->query("//video[contains(@class,'share-video')]//source[contains(@src, '.mp4')]")->item(0);
+ $poster_node = $tmpxpath->query("//video[contains(@class,'share-video') and @poster]")->item(0);
- if ($source_meta) {
- $source_stream = $source_meta->getAttribute("content");
- $poster_url = false;
+ if ($source_node && $poster_node) {
+ $source_stream = $source_node->getAttribute("src");
+ $poster_url = $poster_node->getAttribute("poster");
- if ($source_stream) {
-
- if ($poster_meta)
- $poster_url = $poster_meta->getAttribute("content");
-
- $this->handle_as_video($doc, $entry, $source_stream, $poster_url);
- $found = 1;
- }
+ $this->handle_as_video($doc, $entry, $source_stream, $poster_url);
+ $found = 1;
}
}
}
-
}
// imgur .gif -> .gifv