summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/oauth.py
diff options
context:
space:
mode:
Diffstat (limited to 'gallery_dl/extractor/oauth.py')
-rw-r--r--gallery_dl/extractor/oauth.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/gallery_dl/extractor/oauth.py b/gallery_dl/extractor/oauth.py
index 483c657..c798ad0 100644
--- a/gallery_dl/extractor/oauth.py
+++ b/gallery_dl/extractor/oauth.py
@@ -73,6 +73,9 @@ class OAuthBase(Extractor):
print(url, end="\n\n", flush=True)
return (recv or self.recv)()
+ def error(self, msg):
+ return self.send("Remote server reported an error:\n\n" + str(msg))
+
def _oauth1_authorization_flow(
self, request_token_url, authorize_url, access_token_url):
"""Perform the OAuth 1.0a authorization flow"""
@@ -135,8 +138,7 @@ class OAuthBase(Extractor):
))
return
if "error" in params:
- self.send(params["error"])
- return
+ return self.error(params)
# exchange the authorization code for a token
data = {
@@ -156,8 +158,7 @@ class OAuthBase(Extractor):
# check token response
if "error" in data:
- self.send(data["error"])
- return
+ return self.error(data)
token = data[key]
token_name = key.replace("_", "-")