nmdias / FeedKit

An RSS, Atom and JSON Feed parser written in Swift
MIT License
1.19k stars 174 forks source link

Can not locate image in RSSFeed #130

Closed ahmedrezik closed 4 years ago

ahmedrezik commented 4 years ago

An rssfeeditem does not contain an attribute that holds the item's image or it's URL

GarthSnyder commented 4 years ago

FeedKit is a relatively thin layer over the RSS format spec (e.g., here for feed items). It doesn't add anything that's not in the spec; RSS items do not have images. If the feed itself has an image, you can reasonably impute that image to the items it contains, but since this isn't officially part of RSS, FeedKit doesn't do it for you.

In theory, an item's URL is in the link field. But keep in mind that RSS is a folk format, so there are many noncompliant feeds out there. If the link field doesn't contain the type of content that you think it should, you should also check for an enclosure of the appropriate type.