Skip to content

Commit

Permalink
[aryion] fix malformed 'last-modified' headers (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Apr 10, 2020
1 parent 38bc643 commit 6c531be
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gallery_dl/extractor/aryion.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ def _parse_post(self, post_id):
if not fname:
fname, ext = ext, fname

# fix 'last-modified' header
lmod = headers["last-modified"]
if lmod[22] != ":":
lmod = "{}:{} GMT".format(lmod[:22], lmod[22:24])

post_url = "{}/g4/view/{}".format(self.root, post_id)
extr = text.extract_from(self.request(post_url).text)

Expand All @@ -85,6 +90,7 @@ def _parse_post(self, post_id):
"<p>", "</p>"), "", "")),
"filename" : fname,
"extension" : ext,
"_mtime" : lmod,
}

d1, _, d2 = data["date"].partition(",")
Expand Down Expand Up @@ -144,6 +150,7 @@ class AryionPostExtractor(AryionExtractor):
"views" : int,
"favorites": int,
"comments" : int,
"_mtime" : "Sat, 16 Feb 2019 19:30:34 GMT",
},
})

Expand Down

0 comments on commit 6c531be

Please sign in to comment.