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

Errors on login-restricted images after removal of Sankaku login support. #1182

Closed
Nanoka opened this issue Dec 17, 2020 · 5 comments
Closed

Comments

@Nanoka
Copy link

Nanoka commented Dec 17, 2020

After sankaku login was removed, images restricted to logged in accounts can't be downloaded anymore.
Not sure why it would be removed, because it was working before updating and the old exe still works fine.
It just gives me the same error as when not logged in on the previous version:

[gallery-dl][debug] Version 1.16.0
[gallery-dl][debug] Python 3.8.1 - Windows-7-6.1.7601-SP1
[gallery-dl][debug] requests 2.24.0 - urllib3 1.22
[gallery-dl][debug] Starting DownloadJob for 'https://chan.sankakucomplex.com/post/show/6311018'
[sankaku][debug] Using SankakuPostExtractor for 'https://chan.sankakucomplex.com/post/show/6311018'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): capi-v2.sankakucomplex.com
[urllib3.connectionpool][debug] https://capi-v2.sankakucomplex.com:443 "GET /posts/keyset?tags=id%3A6311018&lang=en&limit=100 HTTP/1.1" 200 12023
[sankaku][error] An unexpected error occurred: TypeError - 'NoneType' object is not subscriptable. Please run gallery-dl again with the --verbose flag, copy its output and report this issue on https://github.com/mikf/gallery-dl/issues .
[sankaku][debug] 
Traceback (most recent call last):
  File "gallery_dl\job.py", line 68, in run
    for msg in self.extractor:
  File "gallery_dl\extractor\booru.py", line 32, in items
    url = self._prepare_post(post, extended_tags)
  File "gallery_dl\extractor\sankaku.py", line 41, in _prepare_post
    if url[0] == "/":
TypeError: 'NoneType' object is not subscriptable

@mikf
Copy link
Owner

mikf commented Dec 17, 2020

Fixed in commit 8d2e4e5 and 465015f.

Not sure why it would be removed

There was a switch to the beta.sankakucomplex.com API in version 1.16.0 (ecdea79), so now

  1. the old login method on chan.sankakucomplex.com didn't work anymore for the new site and
  2. at the time it was still possible to download restricted content without login.

Sankaku "fixed" that mistake some time after commit b2c55f0 landed, which led to the error you posted.

@mikf mikf closed this as completed Dec 17, 2020
@mikf mikf pinned this issue Dec 17, 2020
@mikf
Copy link
Owner

mikf commented Dec 22, 2020

Sankaku seems to have undone that change. It is again possible to download contentious_content posts without login:

$ gallery-dl https://chan.sankakucomplex.com/post/show/6311018
/tmp/sankaku/sankaku_6311018_21ebd691212adbc9e48e872a7e973567.png

@mikf mikf unpinned this issue Dec 22, 2020
@Nanoka
Copy link
Author

Nanoka commented Dec 22, 2020

I can't access it without login with either post url or the direct image url and still get the "You lack the access rights required to view this content." visiting the post page.

@mikf
Copy link
Owner

mikf commented Dec 22, 2020

I'm getting the same error when visiting https://chan.sankakucomplex.com/post/show/6311018 in a browser, but the capi-v2.sankakucomplex.com interface provides a working download URL as file_url entry on

and that's what gallery-dl is using, even on v1.16.0.

Or maybe this is location specific, but I wouldn't expect that from a site who sends Accept-Language: [object Object] as HTTP header.

@Nanoka
Copy link
Author

Nanoka commented Dec 22, 2020

For some reason, after using the login credentials once, it's working without them now.
Could be coincidence, since I tried first with login then without.
But even though this works, I still think login support is necessary - that is the only way to download your own favorites if they are set to private.
And this can suddenly stop working again in case that is not intentional from the site devs.

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

No branches or pull requests

2 participants