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

[ie/BilibiliSpace] better error message #9839

Merged
merged 2 commits into from
May 8, 2024
Merged

Conversation

fireattack
Copy link
Contributor

@fireattack fireattack commented May 2, 2024

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Fixes #9528.

When not using cookies, this request at

def fetch_page(page_idx):
query = {
'keyword': '',
'mid': playlist_id,
'order': 'pubdate',
'order_avoided': 'true',
'platform': 'web',
'pn': page_idx + 1,
'ps': 30,
'tid': 0,
'web_location': 1550101,
'wts': int(time.time()),
}
query['w_rid'] = hashlib.md5(f'{urllib.parse.urlencode(query)}{signature}'.encode()).hexdigest()
try:
response = self._download_json('https://api.bilibili.com/x/space/wbi/arc/search',
playlist_id, note=f'Downloading page {page_idx}', query=query)
except ExtractorError as e:

returns something like

{'code': -352, 'message': '风控校验失败', 'ttl': 1, 'data': {'v_voucher': 'voucher_45ccfacf-4359-4103-**************'}}

where the message means something like "Risk control verification failed", i.e. they suspect you're a bot.
So raise an error similar to code -401 above and ask the user to use cookies.

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

@fireattack fireattack marked this pull request as ready for review May 2, 2024 10:06
@pukkandan pukkandan added the site-enhancement Feature request for some website label May 2, 2024
@bashonly bashonly merged commit 06d52c8 into yt-dlp:master May 8, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-enhancement Feature request for some website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yt-dlp cannot fetch video list information in a channel of bilibili
4 participants