diff options
| author | 2021-11-10 01:26:14 -0500 | |
|---|---|---|
| committer | 2021-11-10 01:26:14 -0500 | |
| commit | eb745742e8e40a0e6d5fcbc512cff1f7a9942186 (patch) | |
| tree | a4308c1de3aeb950ee432bc2ff39c7ff68c4bffc /gallery_dl/extractor/deviantart.py | |
| parent | a5c549937ad0f16c952a6ffcb600313a1367c4d6 (diff) | |
| parent | fc8c5e642017e2b4e5299e2093e72b316479690d (diff) | |
Update upstream source from tag 'upstream/1.19.2'
Update to upstream version '1.19.2'
with Debian dir 2bad68ddd3fb1e0861921ad76bda30c3ab0babd9
Diffstat (limited to 'gallery_dl/extractor/deviantart.py')
| -rw-r--r-- | gallery_dl/extractor/deviantart.py | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py index 4604d39..61affb5 100644 --- a/gallery_dl/extractor/deviantart.py +++ b/gallery_dl/extractor/deviantart.py @@ -137,11 +137,12 @@ class DeviantartExtractor(Extractor): def prepare(self, deviation): """Adjust the contents of a Deviation-object""" - try: - deviation["index"] = text.parse_int( - deviation["url"].rpartition("-")[2]) - except KeyError: - deviation["index"] = 0 + if "index" not in deviation: + try: + deviation["index"] = text.parse_int( + deviation["url"].rpartition("-")[2]) + except KeyError: + deviation["index"] = 0 if self.user: deviation["username"] = self.user @@ -602,7 +603,10 @@ class DeviantartStashExtractor(DeviantartExtractor): if stash_id[0] == "0": uuid = text.extract(page, '//deviation/', '"')[0] if uuid: - yield self.api.deviation(uuid) + deviation = self.api.deviation(uuid) + deviation["index"] = text.parse_int(text.extract( + page, 'gmi-deviationid="', '"')[0]) + yield deviation return for item in text.extract_iter( |
