Skip to content

Commit

Permalink
[idolcomplex] extract 'id_alnum' metadata (#5171)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Feb 8, 2024
1 parent cf7d6be commit aee5580
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gallery_dl/extractor/idolcomplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _extract_post(self, post_id):
page = self.request(url, retries=10).text
extr = text.extract_from(page)

tags = extr("<title>", " | ")
pid_alnum = extr('/posts/', '"')
vavg = extr('itemprop="ratingValue">', "<")
vcnt = extr('itemprop="reviewCount">', "<")
pid = extr(">Post ID:", "<")
Expand All @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions test/results/idolcomplex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit aee5580

Please sign in to comment.