From: Andrew Dolgov Date: Mon, 5 Aug 2013 06:33:13 +0000 (+0400) Subject: parser: support media:content elements within media:group X-Git-Tag: 1.10~32 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4289b68f0d4e4bcf5e9c09cf03367be3e638ccba;p=tt-rss.git parser: support media:content elements within media:group --- diff --git a/classes/feeditem/atom.php b/classes/feeditem/atom.php index 8a21d614..e88b5ec1 100644 --- a/classes/feeditem/atom.php +++ b/classes/feeditem/atom.php @@ -149,6 +149,18 @@ class FeedItem_Atom extends FeedItem_Common { array_push($encs, $enc); } + $enclosures = $this->xpath->query("media:group/media:content", $this->elem); + + foreach ($enclosures as $enclosure) { + $enc = new FeedEnclosure(); + + $enc->type = $enclosure->getAttribute("type"); + $enc->link = $enclosure->getAttribute("url"); + $enc->length = $enclosure->getAttribute("length"); + + array_push($encs, $enc); + } + return $encs; } diff --git a/classes/feeditem/rss.php b/classes/feeditem/rss.php index e5960243..a2e9f01a 100644 --- a/classes/feeditem/rss.php +++ b/classes/feeditem/rss.php @@ -124,6 +124,18 @@ class FeedItem_RSS extends FeedItem_Common { array_push($encs, $enc); } + $enclosures = $this->xpath->query("media:group/media:content", $this->elem); + + foreach ($enclosures as $enclosure) { + $enc = new FeedEnclosure(); + + $enc->type = $enclosure->getAttribute("type"); + $enc->link = $enclosure->getAttribute("url"); + $enc->length = $enclosure->getAttribute("length"); + + array_push($encs, $enc); + } + return $encs; }