Skip to content

[Weibo] HTTPS 400 Bad Request #7939

@MegrezPines

Description

@MegrezPines

So, I was working with a bunch of Weibo links of posts from my favorite artists, trying to download the images. 95 links, all downloaded perfectly, except this one: 'https://weibo.com/1689776111/Cs0Kkz4kM'

When I run it with the verbose, I got the following message:

PS C:\Users\Kaze Naito\Desktop\Dragon & Basement> gallery-dl -K -v https://weibo.com/1689776111/Cs0Kkz4kM
[gallery-dl][debug] Version 1.30.2 - Executable (stable/windows)
[gallery-dl][debug] Python 3.13.5 - Windows-11-10.0.26100-SP0
[gallery-dl][debug] requests 2.32.4 - urllib3 2.5.0
[gallery-dl][debug] Configuration Files ['C:\\Users\\Kaze Naito\\scoop\\apps\\gallery-dl\\current\\gallery-dl.conf']
[gallery-dl][debug] Starting DownloadJob for 'https://weibo.com/1689776111/Cs0Kkz4kM'
[weibo][debug] Using WeiboStatusExtractor for 'https://weibo.com/1689776111/Cs0Kkz4kM'
[urllib3.connectionpool][debug] Starting new HTTPS connection (1): weibo.com:443
[urllib3.connectionpool][debug] https://weibo.com:443 "GET /ajax/statuses/show?id=Cs0Kkz4kM HTTP/1.1" 400 24
[weibo][error] HttpError: '400 Bad Request' for 'https://weibo.com/ajax/statuses/show?id=Cs0Kkz4kM'
[weibo][debug]
Traceback (most recent call last):
  File "gallery_dl\job.py", line 152, in run
  File "gallery_dl\extractor\weibo.py", line 61, in items
  File "gallery_dl\extractor\weibo.py", line 356, in statuses
  File "gallery_dl\extractor\weibo.py", line 153, in _status_by_id
  File "gallery_dl\extractor\common.py", line 267, in request_json
  File "gallery_dl\extractor\weibo.py", line 45, in request
  File "gallery_dl\extractor\common.py", line 259, in request
gallery_dl.exception.HttpError: '400 Bad Request' for 'https://weibo.com/ajax/statuses/show?id=Cs0Kkz4kM'

I struggled with this for a while, because apart from getting the image, I also want to get the status['created_at'] timestamp for archival purposes too. Luckily, when I finally clicked the "error" 'https://weibo.com/ajax/statuses/show?id=Cs0Kkz4kM' link, I can see the "created_at" timestamp in the provided JSON file on the browser, so that's good.

But still, for whatever reason, despite the post in that link (and 94 others) open perfectly in Chrome with my Weibo account when logged in, the moment I pasted the link into Incognito mode, that post just... doesn't show. It just doesn't show, doesn't even try to pop up the 'passport.weibo.com' for log in. If I used the mobile link in Incognito instead, 'https://m.weibo.cn/status/Cs0Kkz4kM', then at least the web said that "hey, you need to log in".

So yea, it's kinda weird behavior from Weibo side but I would love to have a way out for this. I was wondering how to pass my Weibo credential into gallery-dl to avoid this problem potentially showing its face again, because I will need to process a lot more posts later on.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions