[scrolller] ignore posts without 'mediaSources' (#5051)

https://github.com/mikf/gallery-dl/issues/5051#issuecomment-2498729103
fixes "KeyError - 'mediaSources'"
This commit is contained in:
Mike Fährmann
2024-11-25 20:08:08 +01:00
parent e9370b7b8a
commit 94c3a4dca5

View File

@@ -32,7 +32,12 @@ class ScrolllerExtractor(Extractor):
for post in self.posts():
src = max(post["mediaSources"], key=self._sort_key)
media_sources = post.get("mediaSources")
if not media_sources:
self.log.warning("%s: No media files", post.get("id"))
continue
src = max(media_sources, key=self._sort_key)
post.update(src)
url = src["url"]
text.nameext_from_url(url, post)