@@ -72,14 +72,17 @@ def _get_api_playinfo(self, room_id):
72
72
{
73
73
"code" : 0 ,
74
74
"data" : {
75
- "playurl_info" : {
76
- "playurl" : {
77
- "stream" : self ._schema_streams (),
75
+ "playurl_info" : validate .none_or_all (
76
+ {
77
+ "playurl" : {
78
+ "stream" : self ._schema_streams (),
79
+ },
78
80
},
79
- },
81
+ validate .get (("playurl" , "stream" )),
82
+ ),
80
83
},
81
84
},
82
- validate .get (("data" , "playurl_info" , "playurl" , "stream" )),
85
+ validate .get (("data" , "playurl_info" )),
83
86
),
84
87
)
85
88
@@ -96,11 +99,14 @@ def _get_page_playinfo(self):
96
99
"roomInitRes" : {
97
100
"data" : {
98
101
"live_status" : int ,
99
- "playurl_info" : {
100
- "playurl" : {
101
- "stream" : self ._schema_streams (),
102
+ "playurl_info" : validate .none_or_all (
103
+ {
104
+ "playurl" : {
105
+ "stream" : self ._schema_streams (),
106
+ },
102
107
},
103
- },
108
+ validate .get (("playurl" , "stream" )),
109
+ ),
104
110
},
105
111
},
106
112
"roomInfoRes" : {
@@ -124,7 +130,7 @@ def _get_page_playinfo(self):
124
130
("roomInfoRes" , "data" , "room_info" , "area_name" ),
125
131
("roomInfoRes" , "data" , "room_info" , "title" ),
126
132
("roomInitRes" , "data" , "live_status" ),
127
- ("roomInitRes" , "data" , "playurl_info" , "playurl" , "stream" ),
133
+ ("roomInitRes" , "data" , "playurl_info" ),
128
134
),
129
135
),
130
136
),
0 commit comments