Skip to content

Commit

Permalink
[mangadex] transform 'date' timestamps to datetime objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Mar 18, 2020
1 parent ae2a332 commit 2530db3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gallery_dl/extractor/mangadex.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class MangadexChapterExtractor(MangadexExtractor):
pattern = r"(?:https?://)?(?:www\.)?mangadex\.(?:org|cc)/chapter/(\d+)"
test = (
("https://mangadex.org/chapter/122094", {
"keyword": "1c834dca33025f521e1874aee1f71c51e28ebf99",
"keyword": "ef1084c2845825979e150512fed8fdc209baf05a",
"content": "7ab3bef5caccb62b881f8e6e70359d3c7be8137f",
}),
# oneshot
("https://mangadex.cc/chapter/138086", {
"count": 64,
"keyword": "178777bd0352fb19eb934cbee5630d16e3fb60ab",
"keyword": "f3da80e57b1acfe1bede7d6ebe82a4bae3f9101a",
}),
)

Expand Down Expand Up @@ -93,7 +93,7 @@ def metadata(self):
"chapter_minor": sep + minor,
"chapter_id": cdata["id"],
"group": mdata["chapter"][self.chapter_id]["group_name"],
"date": cdata["timestamp"],
"date": text.parse_timestamp(cdata["timestamp"]),
"lang": util.language_to_code(cdata["lang_name"]),
"language": cdata["lang_name"],
}
Expand All @@ -115,16 +115,16 @@ class MangadexMangaExtractor(MangadexExtractor):
test = (
("https://mangadex.org/manga/2946/souten-no-koumori", {
"pattern": r"https://mangadex.org/chapter/\d+",
"keywords": {
"keyword": {
"manga": "Souten no Koumori",
"manga_id": 2946,
"title": "Oneshot",
"title": "re:One[Ss]hot",
"volume": 0,
"chapter": 0,
"chapter_minor": "",
"chapter_id": int,
"group": str,
"date": int,
"date": "type:datetime",
"lang": str,
"language": str,
},
Expand Down Expand Up @@ -169,7 +169,7 @@ def chapters(self):
"chapter_minor": sep + minor,
"chapter_id": text.parse_int(chid),
"group": text.unescape(info["group_name"]),
"date": info["timestamp"],
"date": text.parse_timestamp(info["timestamp"]),
"lang": lang,
"language": util.code_to_language(lang),
"_extractor": MangadexChapterExtractor,
Expand Down

0 comments on commit 2530db3

Please sign in to comment.