diff options
author | fox <[email protected]> | 2018-07-15 09:04:09 +0000 |
---|---|---|
committer | Gogs <[email protected]> | 2018-07-15 09:04:09 +0000 |
commit | 331ded21ba0ba0439d9843840b015366921a9148 (patch) | |
tree | 32e550d349d8ef17be3c9a4fa9cbfd346c5bf4d8 /plugins | |
parent | 6e6c3a878d561099ea5c50181a1eb4d4b4494552 (diff) | |
parent | 1cb3084d53025cfcc6873aa4f79afdd79d10252f (diff) |
Merge branch 'tumblr_hd_videos' of Self-Perfection/tt-rss into master
Diffstat (limited to 'plugins')
-rwxr-xr-x | plugins/af_tumblr_1280/init.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/af_tumblr_1280/init.php b/plugins/af_tumblr_1280/init.php index d74253b57..8aba0e652 100755 --- a/plugins/af_tumblr_1280/init.php +++ b/plugins/af_tumblr_1280/init.php @@ -4,7 +4,7 @@ class Af_Tumblr_1280 extends Plugin { function about() { return array(1.0, - "Replace Tumblr pictures with largest size if available (requires CURL)", + "Replace Tumblr pictures and videos with largest size if available (requires CURL)", "fox"); } @@ -64,6 +64,19 @@ class Af_Tumblr_1280 extends Plugin { } } + $video_sources = $xpath->query('//video/source[contains(@src, \'.tumblr.com/video_file\')]'); + + foreach ($video_sources as $source) { + $src = $source->getAttribute("src"); + + $new_src = preg_replace("/\/\d{3}$/", "", $src); + + if ($src != $new_src) { + $source->setAttribute("src", $new_src); + $found = true; + } + } + if ($found) { $doc->removeChild($doc->firstChild); //remove doctype $article["content"] = $doc->saveHTML(); |