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

Problem downloading from 8chan.moe #6318

Closed
Alex-0099 opened this issue Oct 13, 2024 · 4 comments
Closed

Problem downloading from 8chan.moe #6318

Alex-0099 opened this issue Oct 13, 2024 · 4 comments

Comments

@Alex-0099
Copy link

Whenever I try to download from 8chan.moe I get this error saying "Unsupported URL "

Screenshot 2024-10-13 164508
Screenshot 2024-10-13 165117

@kattjevfel
Copy link
Contributor

https://github.com/mikf/gallery-dl/blob/master/docs/supportedsites.md only lists Boards, Threads, which neither of those are.

That said, downloading from 8chan seems broken atm either way.

katt@main ~ » gallery-dl https://8chan.moe/teyvat/res/3213.html        
[8chan][error] Unable to download data:  JSONDecodeError: Expecting value: line 1 column 1 (char 0)

@Alex-0099
Copy link
Author

https://github.com/mikf/gallery-dl/blob/master/docs/supportedsites.md only lists Boards, Threads, which neither of those are.

Oh I understand now.

That said, downloading from 8chan seems broken atm either way.

katt@main ~ » gallery-dl https://8chan.moe/teyvat/res/3213.html        
[8chan][error] Unable to download data:  JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Yes I got the same error messages .

@ghbook
Copy link

ghbook commented Oct 13, 2024

@mikf can you look into it,

8chan handling cookies looks very weird and my cookie extension can not find any cookies on website but i can see them in devtoools.

latest gallery-dl version with recent 8chan changes redirecting to disclaimer page.

D:\>gallery-dl -v https://8chan.moe/v/res/1008222.html
[gallery-dl][debug] Version 1.27.6
[gallery-dl][debug] Python 3.11.4 - Windows-10-10.0.19045-SP0
[gallery-dl][debug] requests 2.32.3 - urllib3 2.2.1
[gallery-dl][debug] Configuration Files ['%APPDATA%\\gallery-dl\\config.json']
[gallery-dl][debug] Starting DownloadJob for 'https://8chan.moe/v/res/1008222.html'
[8chan][debug] Using _8chanThreadExtractor for 'https://8chan.moe/v/res/1008222.html'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): 8chan.moe:443
[urllib3.connectionpool][debug] https://8chan.moe:443 "GET /v/res/1008222.json HTTP/1.1" 302 0
[urllib3.connectionpool][debug] https://8chan.moe:443 "GET /.static/pages/disclaimer.html HTTP/1.1" 200 1689
[8chan][error] Unable to download data:  JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[8chan][debug]
Traceback (most recent call last):
  File "C:\Python3\Lib\site-packages\requests\models.py", line 974, in json
    return complexjson.loads(self.text, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python3\Lib\site-packages\gallery_dl\job.py", line 151, in run
    for msg in extractor:
  File "C:\Python3\Lib\site-packages\gallery_dl\extractor\8chan.py", line 78, in items
    thread = self.request(url + "json").json()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python3\Lib\site-packages\requests\models.py", line 978, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

even the captcha is behind disclaimer page.

[urllib3.connectionpool][debug] https://8chan.moe:443 "GET /captcha.js?d=Sun+Oct+13+2024+17%3A00%3A25+GMT%2B0000+%28UTC%29 HTTP/1.1" 302 0
[urllib3.connectionpool][debug] https://8chan.moe:443 "GET /.static/pages/disclaimer.html HTTP/1.1" 200 1689

@mikf
Copy link
Owner

mikf commented Oct 13, 2024

For now, you can set the required TOS cookie with

-o cookies.TOS20241009=y

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