mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-15 17:15:57 +00:00
actually download <video> posters to media cache
video[@poster] is already supported in the rewriting logic but never actually downloaded
This commit is contained in:
@@ -1229,11 +1229,12 @@ class RSSUtils {
|
|||||||
if ($doc->loadHTML($html)) {
|
if ($doc->loadHTML($html)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
|
|
||||||
$entries = $xpath->query('(//img[@src])|(//video/source[@src])|(//audio/source[@src])');
|
$entries = $xpath->query('(//img[@src])|(//video/source[@src])|(//audio/source[@src])|(//video[@poster])');
|
||||||
|
|
||||||
foreach ($entries as $entry) {
|
foreach ($entries as $entry) {
|
||||||
if ($entry->hasAttribute('src') && strpos($entry->getAttribute('src'), "data:") !== 0) {
|
foreach (array('src', 'poster') as $attr) {
|
||||||
$src = rewrite_relative_url($site_url, $entry->getAttribute('src'));
|
if ($entry->hasAttribute($attr) && strpos($entry->getAttribute($attr), "data:") !== 0) {
|
||||||
|
$src = rewrite_relative_url($site_url, $entry->getAttribute($attr));
|
||||||
|
|
||||||
$local_filename = sha1($src);
|
$local_filename = sha1($src);
|
||||||
|
|
||||||
@@ -1262,6 +1263,7 @@ class RSSUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static function expire_error_log() {
|
static function expire_error_log() {
|
||||||
Debug::log("Removing old error log entries...");
|
Debug::log("Removing old error log entries...");
|
||||||
|
|||||||
Reference in New Issue
Block a user