From a26d71c2287018ca0caa53af7a458345f0b70323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 29 Jul 2025 10:35:57 +0200 Subject: [PATCH] [cien] provide 'author['id']' metadata (#6582) https://github.com/mikf/gallery-dl/issues/6582#issuecomment-3131187851 --- gallery_dl/extractor/cien.py | 6 ++++-- test/results/cien.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/cien.py b/gallery_dl/extractor/cien.py index 7dfe6b67..45e5dab7 100644 --- a/gallery_dl/extractor/cien.py +++ b/gallery_dl/extractor/cien.py @@ -52,17 +52,19 @@ class CienArticleExtractor(CienExtractor): example = "https://ci-en.net/creator/123/article/12345" def items(self): - url = f"{self.root}/creator/{self.groups[0]}/article/{self.groups[1]}" + author_id, post_id = self.groups + url = f"{self.root}/creator/{author_id}/article/{post_id}" page = self.request(url, notfound="article").text files = self._extract_files(page) post = self._extract_jsonld(page)[0] post["post_url"] = url - post["post_id"] = text.parse_int(self.groups[1]) + post["post_id"] = text.parse_int(post_id) post["count"] = len(files) post["date"] = text.parse_datetime(post["datePublished"]) try: + post["author"]["id"] = text.parse_int(author_id) del post["publisher"] del post["sameAs"] except Exception: diff --git a/test/results/cien.py b/test/results/cien.py index ef797216..ae888ae4 100644 --- a/test/results/cien.py +++ b/test/results/cien.py @@ -16,6 +16,7 @@ __tests__ = ( "author": { "@type" : "Person", + "id" : 7491, "image" : "https://media.ci-en.jp/public/icon/creator/00007491/9601a2a224245156335aaa839fa408d52c32c87dae5787fc03f455b7fd1d3488/image-200-c.jpg", "name" : "やかろ", "url" : "https://ci-en.net/creator/7491",