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

RSS parser not filtering media:group/media:content where isDefault = true #3078

Open
will-davies opened this issue Jun 24, 2020 · 8 comments
Assignees
Labels
Feature Request ideas for new features SimplePie 🍰
Milestone

Comments

@will-davies
Copy link

RSS specification for media:group with multiple media:content elements has the ability to define which element is the default.

https://www.rssboard.org/media-rss#media-content
isDefault determines if this is the default object that should be used for the media:group. There should only be one default object per media:group

Currently if a feed has an item with multiple versions of an image for example, all versions are rendered in the view.

i.e.
<media:group> <media:description>…</media:description> <media:content url="http://example.com/image-16x9-2150x1210.jpg" medium="image" type="image/jpeg" width="2150" height="1210"/> <media:content url="http://example.com/image-4x3-940x705.jpg" medium="image" type="image/jpeg" width="940" height="705"/> <media:content url="http://example.com/image-3x2-940x627.jpg" medium="image" type="image/jpeg" width="940" height="627" isDefault="true"/> <media:content url="http://example.com/image-3x4-940x1253.jpg" medium="image" type="image/jpeg" width="940" height="1253"/> <media:content url="http://example.com/image-1x1-1400x1400.jpg" medium="image" type="image/jpeg" width="1400" height="1400"/> <media:thumbnail url="http://example.com/image-4x3-140x105.jpg" width="140" height="105"/> </media:group>

All images are then shown in the reader.

@Alkarex Alkarex added this to the 1.17.0 milestone Jun 24, 2020
@Alkarex
Copy link
Member

Alkarex commented Jun 24, 2020

Could you please provide an example of such a feed, to ease testing?

@will-davies
Copy link
Author

Absolutely, apologies for not including previously.
http://www.abc.net.au/news/feed/45910/rss.xml

@Alkarex Alkarex modified the milestones: 1.17.0, 1.18.0 Sep 2, 2020
@samwilson
Copy link

I came to see if this had already been reported, because I've been putting up with seeing all images for ages. I thought "oh good, I've got another example of a feed that's got this", but no! It's just the ABC again: https://www.abc.net.au/radionational/programs/blueprintforliving/feed/6052176/podcast.xml :-)

Still, it does sound like something that FreshRSS could handle (assuming this is a standard form for feeds).

@Alkarex Alkarex modified the milestones: 1.18.0, 1.19.0 Feb 6, 2021
@Alkarex Alkarex modified the milestones: 1.19.0, 1.20.0 Oct 29, 2021
@math-GH
Copy link
Contributor

math-GH commented Feb 7, 2022

How should we handle the other media enclosures?

Here an example from https://www.abc.net.au/news/feed/45910/rss.xml
5 x media:content
Should we trust the isDefault and use this image, regardless if it is to small/big?

<media:group>
        <media:description>Tammy is one of the 47 per cent of Australians who live with a chronic condition.</media:description>
        <media:content
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=1920&amp;xPos=0&amp;yPos=0&amp;width=862&amp;height=485"
            medium="image"
            type="image/jpeg"
            width="862"
            height="485"
          />
        <media:content
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=1080&amp;xPos=420&amp;yPos=0&amp;width=862&amp;height=862"
            medium="image"
            type="image/jpeg"
            width="862"
            height="862"
          />
        <media:content
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=1620&amp;xPos=150&amp;yPos=0&amp;width=862&amp;height=575"
            medium="image"
            type="image/jpeg"
            width="862"
            height="575"
            isDefault="true"
          />
        <media:content
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=810&amp;xPos=555&amp;yPos=0&amp;width=862&amp;height=1149"
            medium="image"
            type="image/jpeg"
            width="862"
            height="1149"
          />
        <media:content
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=1440&amp;xPos=240&amp;yPos=0&amp;width=862&amp;height=647"
            medium="image"
            type="image/jpeg"
            width="862"
            height="647"
          />
        <media:thumbnail
            url="https://live-production.wcms.abc-cdn.net.au/599642a634d5ed767157c4776208521c?impolicy=wcms_crop_resize&amp;cropH=1080&amp;cropW=810&amp;xPos=555&amp;yPos=0&amp;width=862&amp;height=1149"
            width="862"
            height="1149"
          />
      </media:group>

@will-davies
Copy link
Author

I would think based on the Media RSS specification the parser should be trusting the media:content element that is marked as isDefault=true.

How does the other element parsing algorithms cater for references to images that are too big or too small?

@math-GH
Copy link
Contributor

math-GH commented Feb 8, 2022

How to handle the media:thumbnail in combination with isDefault?

@will-davies
Copy link
Author

My reading of the specification is that the thumbnail element is optional and if present it would override the isDefault. The lack of an isDefault or thumbnail element then the first element is considered the primary.

@Alkarex Alkarex modified the milestones: 1.20.0, 1.21.0 May 7, 2022
@math-GH math-GH added the Feature Request ideas for new features label Aug 28, 2022
@math-GH math-GH self-assigned this Aug 28, 2022
@Alkarex Alkarex modified the milestones: 1.21.0, 1.22.0 Jan 9, 2023
@jwalterclark
Copy link

FWIW the CustomCSS extension can be used as a workaround. At least to avoid all versions of the image being displayed.

I was seeing about a dozen images on every item in CNN's feeds (e.g. http://rss.cnn.com/rss/cnn_latest.rss), which are missing isDefault, and with this CSS I now only see the first.

.content figure.enclosure {
    display:none;
}
.content figure.enclosure:first-of-type {
    display:block;
}

@Alkarex Alkarex modified the milestones: 1.22.0, 1.23.0 Jul 30, 2023
@Alkarex Alkarex modified the milestones: 1.23.0, 1.24.0 Nov 24, 2023
@Alkarex Alkarex modified the milestones: 1.24.0, 1.25.0 Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request ideas for new features SimplePie 🍰
Projects
None yet
Development

No branches or pull requests

5 participants