summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor')
-rw-r--r--gallery_dl/extractor/civitai.py20
-rw-r--r--gallery_dl/extractor/kemono.py9
-rw-r--r--gallery_dl/extractor/newgrounds.py4
3 files changed, 27 insertions, 6 deletions
diff --git a/gallery_dl/extractor/civitai.py b/gallery_dl/extractor/civitai.py
index fe3b7ed..00400ba 100644
--- a/gallery_dl/extractor/civitai.py
+++ b/gallery_dl/extractor/civitai.py
@@ -459,6 +459,18 @@ class CivitaiImagesExtractor(CivitaiExtractor):
def images(self):
params = self._parse_query(self.groups[0])
+ params["types"] = ("image",)
+ return self.api.images(params)
+
+
+class CivitaiVideosExtractor(CivitaiExtractor):
+ subcategory = "videos"
+ pattern = BASE_PATTERN + r"/videos(?:/?\?([^#]+))?(?:$|#)"
+ example = "https://civitai.com/videos"
+
+ def images(self):
+ params = self._parse_query(self.groups[0])
+ params["types"] = ("video",)
return self.api.images(params)
@@ -521,6 +533,7 @@ class CivitaiUserImagesExtractor(CivitaiExtractor):
def __init__(self, match):
user, query = match.groups()
self.params = self._parse_query(query)
+ self.params["types"] = ("image",)
if self.params.get("section") == "reactions":
self.subcategory = "reactions-images"
self.images = self._image_reactions
@@ -708,7 +721,6 @@ class CivitaiTrpcAPI():
"useIndex" : True,
"period" : "AllTime",
"sort" : "Newest",
- "types" : ("image",),
"withMeta" : False, # Metadata Only
"fromPlatform" : False, # Made On-Site
"browsingLevel": self.nsfw,
@@ -899,10 +911,10 @@ class CivitaiSearchAPI():
def __init__(self, extractor):
self.extractor = extractor
- self.root = "https://search.civitai.com"
+ self.root = "https://search-new.civitai.com"
self.headers = {
- "Authorization": "Bearer ab8565e5ab8dc2d8f0d4256d204781cb63fe8b031"
- "eb3779cbbed38a7b5308e5c",
+ "Authorization": "Bearer 8c46eb2508e21db1e9828a97968d91ab1ca1caa5f"
+ "70a00e88a2ba1e286603b61",
"Content-Type": "application/json",
"X-Meilisearch-Client": "Meilisearch instant-meilisearch (v0.13.5)"
" ; Meilisearch JavaScript (v0.34.0)",
diff --git a/gallery_dl/extractor/kemono.py b/gallery_dl/extractor/kemono.py
index 46139bc..a5e1f6d 100644
--- a/gallery_dl/extractor/kemono.py
+++ b/gallery_dl/extractor/kemono.py
@@ -562,6 +562,7 @@ class KemonoAPI():
def __init__(self, extractor):
self.extractor = extractor
self.root = extractor.root + "/api/v1"
+ self.headers = {"Accept": "text/css"}
def posts(self, offset=0, query=None, tags=None):
endpoint = "/posts"
@@ -574,8 +575,7 @@ class KemonoAPI():
def creators(self):
endpoint = "/creators"
- headers = {"Accept": "text/css"}
- return self._call(endpoint, headers=headers)
+ return self._call(endpoint)
def creator_posts(self, service, creator_id,
offset=0, query=None, tags=None):
@@ -644,6 +644,11 @@ class KemonoAPI():
return self._call(endpoint, params)
def _call(self, endpoint, params=None, headers=None, fatal=True):
+ if headers is None:
+ headers = self.headers
+ else:
+ headers = {**self.headers, **headers}
+
return self.extractor.request_json(
f"{self.root}{endpoint}", params=params, headers=headers,
encoding="utf-8", fatal=fatal)
diff --git a/gallery_dl/extractor/newgrounds.py b/gallery_dl/extractor/newgrounds.py
index de96aa0..c42453f 100644
--- a/gallery_dl/extractor/newgrounds.py
+++ b/gallery_dl/extractor/newgrounds.py
@@ -224,6 +224,10 @@ class NewgroundsExtractor(Extractor):
"width" : text.parse_int(full('width="', '"')),
"height" : text.parse_int(full('height="', '"')),
}
+
+ if not data["url"]:
+ data["url"] = extr('<a href="', '"')
+
index = data["url"].rpartition("/")[2].partition("_")[0]
data["index"] = text.parse_int(index)
data["_index"] = index