diff options
| author | 2021-06-22 22:30:36 -0400 | |
|---|---|---|
| committer | 2021-06-22 22:30:36 -0400 | |
| commit | 32de2b06db501c7de81678bce8e3e0c3e63d340c (patch) | |
| tree | fd58a26618a73de0faaf3e9c435a806aed7eced3 /gallery_dl/extractor/oauth.py | |
| parent | 8a644b7a06c504263a478d3681eed10b4161b5be (diff) | |
New upstream version 1.18.0.upstream/1.18.0
Diffstat (limited to 'gallery_dl/extractor/oauth.py')
| -rw-r--r-- | gallery_dl/extractor/oauth.py | 9 |
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("_", "-") |
