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

plugins.bilibili: add back HTTPStream from v1 API #5782

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastimeyer
Copy link
Member

Resolves #5700

This adds back the v1 API request and the progressive HTTP streams. Those streams have a higher quality compared to their HLS streams for some reason. The plugin therefore treats them with a higher priority, so that --stream-types=http doesn't have to be set (its default value is hls,http,*). (This will be cleaned up eventually with the new stream selection stuff though)


Getting some channel IDs from their /all page:

>>> Array.from(document.body.querySelectorAll("a#card")).slice(0, 10).map(a=>new URL(a.href).pathname.substring(1)).join(" ")
'26807102 30048568 31602877 31561419 31142202 24660442 31773868 30844372 11484134 27768132'

Testing the progressive HTTP streams from the v1 API:

for channel in 26807102 30048568 31602877 31561419 31142202 24660442 31773868 30844372 11484134 27768132; do
    ./script/test-plugin-urls.py bilibili -r CHANNEL $channel
    streamlink --stdout -l none "https://live.bilibili.com/$channel?live_from=78001" best 2>/dev/null \
      | ffprobe -v error -of json -show_streams - \
      | jq -r '.streams[] | select(.codec_name == "h264") | "\(.width)x\(.height)"'
done
:: Finding streams for URL: https://live.bilibili.com/26807102?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1920x1080
:: Finding streams for URL: https://live.bilibili.com/30048568?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1280x720
:: Finding streams for URL: https://live.bilibili.com/31602877?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1920x1080
:: Finding streams for URL: https://live.bilibili.com/31561419?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
720x1280
:: Finding streams for URL: https://live.bilibili.com/31142202?live_from=78001
:: Found streams: httpstream_alt, httpstream, worst, best
720x1280
:: Finding streams for URL: https://live.bilibili.com/24660442?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1200x900
:: Finding streams for URL: https://live.bilibili.com/31773868?live_from=78001
:: Found streams: httpstream_alt, httpstream, worst, best
1920x1080
:: Finding streams for URL: https://live.bilibili.com/30844372?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1920x1080
:: Finding streams for URL: https://live.bilibili.com/11484134?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1920x1080
:: Finding streams for URL: https://live.bilibili.com/27768132?live_from=78001
:: Found streams: hls_alt, hls, httpstream_alt, httpstream, worst, best
1918x886

@bastimeyer bastimeyer added the plugin issue A Plugin does not work correctly label Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin issue A Plugin does not work correctly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugins.bilibili: support for higher stream qualities
2 participants