custom-components / feedparser

📰 RSS Feed Integration
MIT License
145 stars 33 forks source link

can't pull image #119

Closed 1mfaasj closed 10 months ago

1mfaasj commented 10 months ago

Hi I've got a quick question. I can't pull the images anymore. how should my config look like?

I already tried "enclosure" and "enclosure" without luck.

sensor:
  - platform: feedparser
    name: Nieuws NU
    feed_url: 'https://www.nu.nl/rss'
    date_format: '%a, %d %b %Y %H:%M:%S %Z'
    scan_interval: 15
    inclusions:
      - title
      - link
      - description
      - enclosure
      - published
    exclusions:
      - language

the rss feed looks like this:

<title>Video | Chaos in New Yorkse synagoge na ontdekking geheime tunnel</title>
<link>https://www.nu.nl/videos/6297474/chaos-in-new-yorkse-synagoge-na-ontdekking-geheime-tunnel.html</link>
<description>In New York werd woensdag een groep ultraorthodoxe joden aangehouden. Ze waren ontdekt in een geheime tunnel naar de synagoge. De bedoeling was om de pas ontdekte tunnel af te sluiten en schade te herstellen. De tunnel zou zijn aangelegd door een "groep extremistische studenten", die de tunnel open wilden houden.</description>
<pubDate>Thu, 11 Jan 2024 14:32:42 +0100</pubDate>
<guid isPermaLink="false">https://www.nu.nl/-/6297474/</guid>
<enclosure length="0" type="image/jpeg" url="https://media.nu.nl/m/cudx0b2agrzy_sqr256.jpg/chaos-in-new-yorkse-synagoge-na-ontdekking-geheime-tunnel.jpg"></enclosure>
<category>Video's</category>
<dc:creator>onze videoredactie</dc:creator>
<dc:rights>copyright photo: AP</dc:rights>
</item><item>
ogajduse commented 10 months ago

Try it again with image in inclusions. The integration will try to get the enclosure from the feed if image is in inclusions. I would also advise to use the latest beta version of the integration that contains an improved logic around getting the enclosures from the feed. See the HACS documentation on how to enable the beta releases. Let me know if that fixes the issue.

1mfaasj commented 10 months ago

it's working now with the latest beta version (6) and the image included. Thanks