Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smugmug strange error #2881

Closed
Devicetron opened this issue Aug 31, 2022 · 7 comments
Closed

Smugmug strange error #2881

Devicetron opened this issue Aug 31, 2022 · 7 comments

Comments

@Devicetron
Copy link

Devicetron commented Aug 31, 2022

Good evening, been using gallery-dl for a while but today I got this message:

PS E:> gallery-dl https://ronaldtaylor.smugmug.com/
[smugmug][error] API request failed

so here's the verbose

PS E:> gallery-dl -v https://ronaldtaylor.smugmug.com/
[gallery-dl][debug] Version 1.23.0
[gallery-dl][debug] Python 3.10.6 - Windows-10-10.0.22000-SP0
[gallery-dl][debug] requests 2.28.1 - urllib3 1.26.11
[gallery-dl][debug] Starting DownloadJob for 'https://ronaldtaylor.smugmug.com/'
[smugmug][debug] Using default api_key authentication
[smugmug][debug] Using SmugmugPathExtractor for 'https://ronaldtaylor.smugmug.com/'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.smugmug.com:443
[urllib3.connectionpool][debug] https://api.smugmug.com:443 "GET /api/v2/user/ronaldtaylor!albums?start=1&count=100&APIKey=DFqxg4jf7GrtsQ5PnbNB8899zKfnDrdK&_verbosity=1 HTTP/1.1" 401 132
[smugmug][debug] {'Code': 401, 'Message': 'API key lacks v2 access; please accept the terms of service at https://api.smugmug.com/api/developer/accept'}
[smugmug][error] API request failed
PS E:>

visited the https://api.smugmug.com/api/developer/accept and accepted again got "Thank you! You now have access to API 2.0."
(It does have a message saying "Note: API versions 1.3.0 and earlier are deprecated and will be taken offline at a future date." and some people in the smugmug forum say it already happened, maybe this is the problem?)

I tried redoing the oauth and got this:

PS E:> gallery-dl -v oauth:smugmug
[gallery-dl][debug] Version 1.23.0
[gallery-dl][debug] Python 3.10.6 - Windows-10-10.0.22000-SP0
[gallery-dl][debug] requests 2.28.1 - urllib3 1.26.11
[gallery-dl][debug] Starting DownloadJob for 'oauth:smugmug'
[oauth][debug] Using OAuthSmugmug for 'oauth:smugmug'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): api.smugmug.com:443
[urllib3.connectionpool][debug] https://api.smugmug.com:443 "GET /services/oauth/1.0a/getRequestToken?oauth_callback=http%3A%2F%2Flocalhost%3A6414%2F HTTP/1.1" 401 34
[oauth][error] An unexpected error occurred: KeyError - 'oauth_token_secret'. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[oauth][debug]
Traceback (most recent call last):
File "C:\Users\Rene\AppData\Local\Programs\Python\Python310\lib\site-packages\gallery_dl\job.py", line 82, in run
for msg in extractor:
File "C:\Users\Rene\AppData\Local\Programs\Python\Python310\lib\site-packages\gallery_dl\extractor\oauth.py", line 285, in items
self._oauth1_authorization_flow(
File "C:\Users\Rene\AppData\Local\Programs\Python\Python310\lib\site-packages\gallery_dl\extractor\oauth.py", line 90, in _oauth1_authorization_flow
self.session.auth.token_secret = data["oauth_token_secret"]
KeyError: 'oauth_token_secret'

IF I do the url I get the same first response... what should I do to get it working again?

mikf added a commit that referenced this issue Aug 31, 2022
The old key lacked v2 access and I'm unable to accept
the new terms of service since my old account got deleted
@mikf
Copy link
Owner

mikf commented Aug 31, 2022

The account used for the default API credentials used by gallery-dl apparently never got APIv2 access, which is now required it seems.

I still have email and password for that account, but it doesn't seem to exist anymore, meaning I can no longer login and accept the v2 terms of service.

I've opted to apply for new API credentials with a different account (daef91c).
You can either use those or apply for your own.

        "smugmug": {
            "api-key": "RCVHDGjcbc4Fhzq4qzqLdZmvwmwB6LM2",
            "api-secret": "jGrdndvJqhTx8XSNs7TFTSSthhZHq92ddMpbpDpkDVNM7TDgnvLFMtfB5Mg5kH73"
        },

@Hrxn
Copy link
Contributor

Hrxn commented Aug 31, 2022

@mikf Just to be sure, if one already has the OAuth tokens for smugmug ("access-token" and "access-token-secret"), are they ignored when using one's own "api-key" and "api-secret" in the config, or is it better to remove them from the config file?

@mikf
Copy link
Owner

mikf commented Sep 1, 2022

@Hrxn any old access-token and access-token-secret from the old api-key and api-secret pair will likely cause an error. You will probably have to redo the oauth:smugmug step.

@Hrxn
Copy link
Contributor

Hrxn commented Sep 1, 2022

Yes, I was on the wrong track here (like user credentials stored in the config file that are ignored when also setting values for "cookies"), so I guess it's the same for all sites using OAuth here (I think I remember it from using the tumblr extactor?), i.e. that for "full" API access you need all four values, right?

@mikf
Copy link
Owner

mikf commented Sep 2, 2022

Yes, "full" authentication requires 4 values in total, but 2 of them - api-key and api-secret - might come from gallery-dl's defaults. In this case you only need access-token and access-token-secret in your config / cache.

@mc743vr
Copy link

mc743vr commented Sep 9, 2022

Please can you assist how to use these credentials you provided?

"smugmug": {
"api-key": "RCVHDGjcbc4Fhzq4qzqLdZmvwmwB6LM2",
"api-secret": "jGrdndvJqhTx8XSNs7TFTSSthhZHq92ddMpbpDpkDVNM7TDgnvLFMtfB5Mg5kH73"
},

@mikf mikf closed this as completed Sep 18, 2022
@mikf
Copy link
Owner

mikf commented Sep 18, 2022

@mc743vr config file or -o, but now you can just grab the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants