@@ -1184,11 +1184,6 @@ class DeviantartSearchExtractor(DeviantartExtractor):
|
|||||||
|
|
||||||
def _search_html(self, params):
|
def _search_html(self, params):
|
||||||
url = self.root + "/search"
|
url = self.root + "/search"
|
||||||
deviation = {
|
|
||||||
"deviationId": None,
|
|
||||||
"author": {"username": "u"},
|
|
||||||
"isJournal": False,
|
|
||||||
}
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
response = self.request(url, params=params)
|
response = self.request(url, params=params)
|
||||||
@@ -1197,13 +1192,15 @@ class DeviantartSearchExtractor(DeviantartExtractor):
|
|||||||
raise exception.StopExtraction("HTTP redirect to login page")
|
raise exception.StopExtraction("HTTP redirect to login page")
|
||||||
page = response.text
|
page = response.text
|
||||||
|
|
||||||
items , pos = text.rextract(page, r'\"items\":[', ']')
|
for dev in DeviantartDeviationExtractor.pattern.findall(
|
||||||
cursor, pos = text.extract(page, r'\"cursor\":\"', '\\', pos)
|
page)[2::3]:
|
||||||
|
yield {
|
||||||
for deviation_id in items.split(","):
|
"deviationId": dev[3],
|
||||||
deviation["deviationId"] = deviation_id
|
"author": {"username": dev[0]},
|
||||||
yield deviation
|
"isJournal": dev[2] == "journal",
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor = text.extr(page, r'\"cursor\":\"', '\\',)
|
||||||
if not cursor:
|
if not cursor:
|
||||||
return
|
return
|
||||||
params["cursor"] = cursor
|
params["cursor"] = cursor
|
||||||
@@ -1722,7 +1719,7 @@ class DeviantartEclipseAPI():
|
|||||||
self.request = self.extractor._limited_request
|
self.request = self.extractor._limited_request
|
||||||
self.csrf_token = None
|
self.csrf_token = None
|
||||||
|
|
||||||
def deviation_extended_fetch(self, deviation_id, user=None, kind=None):
|
def deviation_extended_fetch(self, deviation_id, user, kind=None):
|
||||||
endpoint = "/da-browse/shared_api/deviation/extended_fetch"
|
endpoint = "/da-browse/shared_api/deviation/extended_fetch"
|
||||||
params = {
|
params = {
|
||||||
"deviationid" : deviation_id,
|
"deviationid" : deviation_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user