From aee5580c62faafca5716b8bc58a93ebd6c84686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 8 Feb 2024 18:29:54 +0100 Subject: [PATCH] [idolcomplex] extract 'id_alnum' metadata (#5171) --- gallery_dl/extractor/idolcomplex.py | 4 ++-- test/results/idolcomplex.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/idolcomplex.py b/gallery_dl/extractor/idolcomplex.py index 12164124b89..c723b065654 100644 --- a/gallery_dl/extractor/idolcomplex.py +++ b/gallery_dl/extractor/idolcomplex.py @@ -101,7 +101,7 @@ def _extract_post(self, post_id): page = self.request(url, retries=10).text extr = text.extract_from(page) - tags = extr("", " | ") + pid_alnum = extr('/posts/', '"') vavg = extr('itemprop="ratingValue">', "<") vcnt = extr('itemprop="reviewCount">', "<") pid = extr(">Post ID:", "<") @@ -121,8 +121,8 @@ def _extract_post(self, post_id): data = { "id" : text.parse_int(pid), + "id_alnum" : pid_alnum, "md5" : file_url.rpartition("/")[2].partition(".")[0], - "tags" : text.unescape(tags), "vote_average": text.parse_float(vavg), "vote_count" : text.parse_int(vcnt), "created_at" : created, diff --git a/test/results/idolcomplex.py b/test/results/idolcomplex.py index eab0edbf7b8..ce1f7390128 100644 --- a/test/results/idolcomplex.py +++ b/test/results/idolcomplex.py @@ -73,6 +73,7 @@ "filename" : "509eccbba54a43cea6b275a65b93c51d", "height" : 683, "id" : 694215, + "id_alnum" : "vkr36qdOaZ4", "md5" : "509eccbba54a43cea6b275a65b93c51d", "rating" : "g", "tags" : "lyumos the_witcher shani_(the_witcher) 1girl green_eyes non-asian redhead waistcoat wreath cosplay 3:2_aspect_ratio", @@ -110,6 +111,8 @@ "#class" : idolcomplex.IdolcomplexPostExtractor, "#sha1_content": "694ec2491240787d75bf5d0c75d0082b53a85afd", + "id" : 694215, + "id_alnum" : "vkr36qdOaZ4", "tags_character": "shani_(the_witcher)", "tags_copyright": "the_witcher", "tags_idol" : str,