Skip to content

Commit

Permalink
[kemonoparty] fix KeyError for empty files (#5368)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Mar 24, 2024
1 parent c3bafd6 commit 15a4bc2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gallery_dl/extractor/kemonoparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def _login_impl(self, username, password):

def _file(self, post):
file = post["file"]
if not file:
if not file or "path" not in file:
return ()
file["type"] = "file"
return (file,)
Expand Down
2 changes: 1 addition & 1 deletion gallery_dl/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

__version__ = "1.26.9"
__version__ = "1.27.0-dev"
10 changes: 10 additions & 0 deletions test/results/kemonoparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,16 @@
"published": "2022-07-29T21:12:11.483000",
},

{
"#url" : "https://kemono.su/gumroad/user/3267960360326/post/jwwag",
"#comment" : "empty 'file' with no 'path' (#5368)",
"#category": ("", "kemonoparty", "gumroad"),
"#class" : kemonoparty.KemonopartyPostExtractor,
"#count" : 8,

"type" : "attachment",
},

{
"#url" : "https://kemono.su/discord/server/488668827274444803#608504710906904576",
"#category": ("", "kemonoparty", "discord"),
Expand Down

0 comments on commit 15a4bc2

Please sign in to comment.