summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/deviantart.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2022-11-22 04:28:38 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2022-11-22 04:28:38 -0500
commit7af5cc29d1c02d20a6890b7b7ba78ab41532a763 (patch)
tree4f0366e5653074c7eb31ac7ca59a1ee55f2d736e /gallery_dl/extractor/deviantart.py
parente59d46ecda74190381b1d2725b0bd9df5c0be8d8 (diff)
New upstream version 1.24.0.upstream/1.24.0
Diffstat (limited to 'gallery_dl/extractor/deviantart.py')
-rw-r--r--gallery_dl/extractor/deviantart.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py
index cb2aa24..45beddf 100644
--- a/gallery_dl/extractor/deviantart.py
+++ b/gallery_dl/extractor/deviantart.py
@@ -603,22 +603,22 @@ class DeviantartStashExtractor(DeviantartExtractor):
page = self._limited_request(url).text
if stash_id[0] == "0":
- uuid = text.extract(page, '//deviation/', '"')[0]
+ uuid = text.extr(page, '//deviation/', '"')
if uuid:
deviation = self.api.deviation(uuid)
- deviation["index"] = text.parse_int(text.extract(
- page, 'gmi-deviationid="', '"')[0])
+ deviation["index"] = text.parse_int(text.extr(
+ page, 'gmi-deviationid="', '"'))
yield deviation
return
for item in text.extract_iter(
page, 'class="stash-thumb-container', '</div>'):
- url = text.extract(item, '<a href="', '"')[0]
+ url = text.extr(item, '<a href="', '"')
if url:
stash_id = url.rpartition("/")[2]
else:
- stash_id = text.extract(item, 'gmi-stashid="', '"')[0]
+ stash_id = text.extr(item, 'gmi-stashid="', '"')
stash_id = "2" + util.bencode(text.parse_int(
stash_id), "0123456789abcdefghijklmnopqrstuvwxyz")
@@ -960,9 +960,15 @@ class DeviantartScrapsExtractor(DeviantartExtractor):
)
cookiedomain = ".deviantart.com"
cookienames = ("auth", "auth_secure", "userinfo")
+ _warning = True
def deviations(self):
eclipse_api = DeviantartEclipseAPI(self)
+ if self._warning:
+ DeviantartScrapsExtractor._warning = False
+ if not self._check_cookies(self.cookienames):
+ self.log.warning(
+ "No session cookies set: Unable to fetch mature scraps.")
for obj in eclipse_api.gallery_scraps(self.user, self.offset):
deviation = obj["deviation"]
@@ -1478,8 +1484,8 @@ class DeviantartEclipseAPI():
def _fetch_csrf_token(self, page=None):
if page is None:
page = self.request(self.extractor.root + "/").text
- self.csrf_token = token = text.extract(
- page, "window.__CSRF_TOKEN__ = '", "'")[0]
+ self.csrf_token = token = text.extr(
+ page, "window.__CSRF_TOKEN__ = '", "'")
return token