[Bilibili] Fix HTTP 412 extraction and expose DASH audio formats - #3057
Open
zgxkbtl wants to merge 1 commit into
Open
[Bilibili] Fix HTTP 412 extraction and expose DASH audio formats#3057zgxkbtl wants to merge 1 commit into
zgxkbtl wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ordinary Bilibili
av/BVextraction relied on the page's embedded__INITIAL_STATE__. The initial page request can now return HTTP 412, leavingthe state empty and eventually failing with:
This can be reproduced with:
you-get -i https://www.bilibili.com/video/BV1nmRcBrEzv/In addition, DASH audio tracks were only associated with video formats. They
could not be listed or selected directly with
-F, and selecting an audio-onlyformat still triggered irrelevant video URL size probes.
Changes
av/BVvideos from/x/web-interface/view, while preserving the existing bangumi and specialURL flows.
cidfor multipart videos.Bilibili requests.
30280,30232, and30216as standalonedash-audio-*formats and preserve their.m4aextension.and close HTTP size-probe requests.
cookie handling, audio stream selection, and extension handling.
Tests
The related unit tests pass (8 tests), the fatal flake8 check reports 0 errors,
and both the sdist and wheel build successfully. Live checks also confirmed that
format listing works for the reproducer and that a selected
dash-audio-*format downloads as an audio-only M4A file.
This change is