-
Notifications
You must be signed in to change notification settings - Fork 32
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
No more images after update 0.1.8 -> 0.1.11 #78
Comments
For anybody facing the same issue, I changed the code in the sensor for feedparser. Now it should show both image en enclosure the right way! Maybe this can be added to the official release as well! # Existing code
if "image" in self._inclusions and "image" not in entry_value.keys():
images = []
if "summary" in entry.keys():
images = re.findall(r"<img.+?src=\"(.+?)\".+?>", entry["summary"])
if images:
entry_value["image"] = images[0]
else:
if "links" in entry.keys():
images = re.findall(
'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+', str(entry["links"][1])
)
if images:
entry_value["image"] = images[0]
else:
entry_value[
"image"
] = "https://www.home-assistant.io/images/favicon-192x192-full.png" # Modified code
if "image" in self._inclusions and "image" not in entry_value.keys():
images = []
if "summary" in entry.keys():
images = re.findall(r"<img.+?src=\"(.+?)\".+?>", entry["summary"])
if images:
entry_value["image"] = images[0]
else:
if "enclosures" in entry.keys() and entry["enclosures"]:
enclosure_url = entry["enclosures"][0].get("url")
if enclosure_url:
entry_value["image"] = enclosure_url
else:
if "links" in entry.keys():
images = re.findall(
'(?:(?:https?|ftp):\/\/)?[\w/\-?=%.]+\.[\w/\-&?=%.]+', str(entry["links"][1])
)
if images:
entry_value["image"] = images[0]
else:
entry_value[
"image"
] = "https://www.home-assistant.io/images/favicon-192x192-full.png" |
I am looking into it in my free time. I also plan to add tests for the integration in #80 to ensure that future releases do not break stuff. |
Thanks, @zboersen , it did the trick ;-) |
I have the fix. I should publish a new feedparser version with the fix this weekend. @BebeMischa @zboersen |
#81 should fix this issue. If they do not show up, could you please provide the feed URL, so I can investigate? Note: #78, #57 and #64 should be addressed and fixed by #81. |
Hello guys and girls,
I've just updated and now I have no more images in my feed. Something I need to change or is it a bug?
My feed sensor:
result:
Before this update it worked fine...
The text was updated successfully, but these errors were encountered: