Skip to content

plugins.bilibili: fix schema for offline channels #6032

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
plugins.bilibili: fix schema for offline channels
  • Loading branch information
bastimeyer committed Jun 13, 2024
commit 3bf1219200087782f0ac21d69442f913e20770bf
26 changes: 16 additions & 10 deletions src/streamlink/plugins/bilibili.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ def _get_api_playinfo(self, room_id):
{
"code": 0,
"data": {
"playurl_info": {
"playurl": {
"stream": self._schema_streams(),
"playurl_info": validate.none_or_all(
{
"playurl": {
"stream": self._schema_streams(),
},
},
},
validate.get(("playurl", "stream")),
),
},
},
validate.get(("data", "playurl_info", "playurl", "stream")),
validate.get(("data", "playurl_info")),
),
)

Expand All @@ -96,11 +99,14 @@ def _get_page_playinfo(self):
"roomInitRes": {
"data": {
"live_status": int,
"playurl_info": {
"playurl": {
"stream": self._schema_streams(),
"playurl_info": validate.none_or_all(
{
"playurl": {
"stream": self._schema_streams(),
},
},
},
validate.get(("playurl", "stream")),
),
},
},
"roomInfoRes": {
Expand All @@ -124,7 +130,7 @@ def _get_page_playinfo(self):
("roomInfoRes", "data", "room_info", "area_name"),
("roomInfoRes", "data", "room_info", "title"),
("roomInitRes", "data", "live_status"),
("roomInitRes", "data", "playurl_info", "playurl", "stream"),
("roomInitRes", "data", "playurl_info"),
),
),
),
Expand Down