Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/extended media group #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

imprologic
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant