summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/cien.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/cien.py')
-rw-r--r--gallery_dl/extractor/cien.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/gallery_dl/extractor/cien.py b/gallery_dl/extractor/cien.py
index 27d50e7..7dfe6b6 100644
--- a/gallery_dl/extractor/cien.py
+++ b/gallery_dl/extractor/cien.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright 2024 Mike Fährmann
+# Copyright 2024-2025 Mike Fährmann
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
@@ -20,7 +20,7 @@ class CienExtractor(Extractor):
request_interval = (1.0, 2.0)
def __init__(self, match):
- self.root = text.root_from_url(match.group(0))
+ self.root = text.root_from_url(match[0])
Extractor.__init__(self, match)
def _init(self):
@@ -52,8 +52,7 @@ class CienArticleExtractor(CienExtractor):
example = "https://ci-en.net/creator/123/article/12345"
def items(self):
- url = "{}/creator/{}/article/{}".format(
- self.root, self.groups[0], self.groups[1])
+ url = f"{self.root}/creator/{self.groups[0]}/article/{self.groups[1]}"
page = self.request(url, notfound="article").text
files = self._extract_files(page)
@@ -121,7 +120,7 @@ class CienArticleExtractor(CienExtractor):
auth = text.extr(video, ' auth-key="', '"')
file = text.nameext_from_url(name)
- file["url"] = "{}video-web.mp4?{}".format(path, auth)
+ file["url"] = f"{path}video-web.mp4?{auth}"
file["type"] = "video"
files.append(file)
@@ -145,12 +144,12 @@ class CienArticleExtractor(CienExtractor):
"gallery_id": text.extr(gallery, ' gallery-id="', '"'),
"time" : text.extr(gallery, ' time="', '"'),
}
- data = self.request(url, params=params).json()
+ data = self.request_json(url, params=params)
url = self.root + "/api/creator/gallery/imagePath"
for params["page"], params["file_id"] in enumerate(
data["imgList"]):
- path = self.request(url, params=params).json()["path"]
+ path = self.request_json(url, params=params)["path"]
file = params.copy()
file["url"] = path
@@ -163,7 +162,7 @@ class CienCreatorExtractor(CienExtractor):
example = "https://ci-en.net/creator/123"
def items(self):
- url = "{}/creator/{}/article".format(self.root, self.groups[0])
+ url = f"{self.root}/creator/{self.groups[0]}/article"
params = text.parse_query(self.groups[1])
params["mode"] = "list"
return self._pagination_articles(url, params)