webfeed icon indicating copy to clipboard operation
webfeed copied to clipboard

Feature/extended media group

Open imprologic opened this issue 2 years ago • 0 comments

Some Atom feeds, like the ones on YouTube, have the thumbnail image defined inside the media:group element, like below:

...
		<media:group>
			<media:title>Saifedean Ammous: How Bitcoin ENDS Inflation</media:title>
			<media:content url="https://www.youtube.com/v/SD6exDEZe3A?version=3" type="application/x-shockwave-flash" width="640" height="390"/>
			<media:thumbnail url="https://i4.ytimg.com/vi/SD6exDEZe3A/hqdefault.jpg" width="480" height="360"/>
			<media:description>Removed for brevity</media:description>
			<media:community>
				<media:starRating count="117" average="5.00" min="1" max="5"/>
				<media:statistics views="1078"/>
			</media:community>
		</media:group>
...

Because of this peculiarity, it's currently impossible for a webfeed user to get the thumbnail of a YouTube video.

This PR adds the following properties to the Group class:

  final Thumbnail? thumbnail;
  final Title? title;
  final Description? description;

The user can now call

item.media?.group?.thumbnail?.url

to get a YouTube thumbnail URL.

imprologic avatar Apr 29 '23 19:04 imprologic