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: support for higher stream qualities #5700
Comments
Not exactly sure what you're trying to say here, but this is probably in regards to your comment here: No, we won't hardcode any cookie data, and I myself certainly won't use my own phone number on any Chinese sites in order to test logins. I am aware that you have posted some code in the Go language in #5693 which you have copied from somewhere else and which sets different parameters on the API request compared to the old implementation, but I haven't had a look at this yet. |
Do I mean that there is a way to obtain the highest picture quality without using Cookie? The code of the Go language is tested and can get 720P without using cookies |
If you can't get the highest quality quality without using Cookie, then I have to look at other methods |
The v1 API can still get high quality without cookie, refer here |
Can this code be integrated? |
This comment was marked as duplicate.
This comment was marked as duplicate.
That is not true. And apart from that, the v1 API only returns FLV container served via progressive HTTP streams instead of TS or fMP4 containers served via HLS or DASH. Example with room ID 7777: streamlink \
--stdout \
--loglevel=none \
"$(curl -sSL \
'https://api.live.bilibili.com/xlive/web-room/v1/playUrl/playUrl?https_url_req=1&cid=7777&qn=1&platform=web&ptype=16' \
| jq -r '"httpstream://" + .data.durl[0].url' \
)" \
best \
2>/dev/null \
| ffprobe -v error -show_format -show_streams -print_format json - {
"streams": [
{
"index": 0,
"codec_name": "aac",
"codec_long_name": "AAC (Advanced Audio Coding)",
"profile": "LC",
"codec_type": "audio",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"sample_fmt": "fltp",
"sample_rate": "48000",
"channels": 2,
"channel_layout": "stereo",
"bits_per_sample": 0,
"initial_padding": 0,
"missing_streams": "0",
"r_frame_rate": "0/0",
"avg_frame_rate": "0/0",
"time_base": "1/1000",
"start_pts": 0,
"start_time": "0.000000",
"bit_rate": "262144",
"extradata_size": 5,
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
}
},
{
"index": 1,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "[0][0][0][0]",
"codec_tag": "0x0000",
"width": 854,
"height": 480,
"coded_width": 854,
"coded_height": 480,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"pix_fmt": "yuv420p",
"level": 31,
"color_range": "tv",
"color_space": "bt709",
"color_transfer": "bt709",
"color_primaries": "bt709",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"missing_streams": "0",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/1000",
"start_pts": 68,
"start_time": "0.068000",
"bits_per_raw_sample": "8",
"extradata_size": 48,
"disposition": {
"default": 0,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0,
"timed_thumbnails": 0,
"non_diegetic": 0,
"captions": 0,
"descriptions": 0,
"metadata": 0,
"dependent": 0,
"still_image": 0
}
}
],
"format": {
"filename": "fd:",
"nb_streams": 2,
"nb_programs": 0,
"format_name": "flv",
"format_long_name": "FLV (Flash Video)",
"start_time": "0.000000",
"duration": "0.000000",
"size": "0",
"probe_score": 100,
"tags": {
"displayHeight": "480",
"level": "",
"cdn_ip": "10.12.13.22",
"profile": "",
"displayWidth": "854",
"Rawdata": "",
"encoder": "libobs/28.1.2 LiveHime/4.52.0 (Windows),BILIAVC.1.6.6",
"fps": "30"
}
}
} |
can only return to low quality? I see the buddy above said |
it seems like the older version of streamlink can still record high quality. I use the streamlink 5.2.1 on Debian 11. when I upgrade to newer 6.5.0-1~bpo12+1. The record is low quality with 854x480 resolution. then I switch back to 5.2.1. the record is 1920x1080. |
according to 直播间信息流 获取秘钥需要Cookie, I set |
The plugin implementation prior to Streamlink's I have no idea about the status of this v1 API and whether it's deprecated and will be shut down in the future. As you can see in my last post, I had checked the claims of the stream quality, but the results showed low-quality streams. Apparently, this was the wrong v1 URL. The old plugin implementation used a different one. Please have a look at #5782. I've added back progressive HTTP streams from the previously used v1 API response, which are indeed high quality streams. I decided to not remove the HLS streams. Please check a couple of streams and see if there are any issues. I won't merge #5782 until I have confirmation that this new plugin implementation is working on all streams. |
Checklist
Streamlink version
6.4.2
Description
You can only get a fixed cookie if you can only get 480P without Cookie. Even if the user does not enter the cookie, it can still be used. This can ensure anonymity
Debug log
The text was updated successfully, but these errors were encountered: