Fix minor issues with Immoscout24 image extraction #517
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes two minor issues I've encountered in the log while scraping Immoscout24 results.
777ad0c: Some images on scraped listings are rejected by Telegram for being Webp files, as they fall through the filter that shortens them to just the
.jpg
link. Those are the images used to link to virtual viewings and are apparently just basic placeholders. They're recognisable by the@xsi.type
property being set tocommon:VirtualTour
so it's easiest just to exclude everything butcommon:Picture
altogether.c1c6c4f: In some cases, the same filter shortened image links to just a few characters, which failed to be submitted to Telegram as a result. I found this is due to some images on Immoscout carrying the
.jpeg
extension, with an extra e over.jpg
. The filter had to take that into account so I built it as a regex into the jsonpath filter.Neither of these issues was fatal, but this should result in more images successfully scraped and sent as well as less error messages and unsuccessful API calls to notification platforms.