@@ -61,12 +61,14 @@ pub struct StreamerContext {
6161 pub playback_cookie : Option < Vec < u8 > > ,
6262 #[ prost( bytes = "vec" , optional, tag = "4" ) ]
6363 pub gp : Option < Vec < u8 > > ,
64- #[ prost( bytes = "vec" , repeated, tag = "5" ) ]
65- pub field5 : Vec < Vec < u8 > > ,
64+ #[ prost( message , repeated, tag = "5" ) ]
65+ pub field5 : Vec < Fqa > ,
6666 #[ prost( int32, repeated, tag = "6" ) ]
6767 pub field6 : Vec < i32 > ,
6868 #[ prost( string, optional, tag = "7" ) ]
6969 pub field7 : Option < String > ,
70+ #[ prost( message, optional, tag = "8" ) ]
71+ pub field8 : Option < Gqa > ,
7072}
7173
7274#[ derive( Clone , PartialEq , Message ) ]
@@ -197,12 +199,16 @@ pub struct VideoPlaybackAbrRequest {
197199 pub player_time_ms : Option < i64 > ,
198200 #[ prost( bytes = "vec" , optional, tag = "5" ) ]
199201 pub video_playback_ustreamer_config : Option < Vec < u8 > > ,
202+ #[ prost( message, optional, tag = "6" ) ]
203+ pub lo : Option < Lo > ,
200204 #[ prost( message, repeated, tag = "16" ) ]
201205 pub selected_audio_format_ids : Vec < FormatId > ,
202206 #[ prost( message, repeated, tag = "17" ) ]
203207 pub selected_video_format_ids : Vec < FormatId > ,
204208 #[ prost( message, optional, tag = "19" ) ]
205209 pub streamer_context : Option < StreamerContext > ,
210+ #[ prost( message, optional, tag = "21" ) ]
211+ pub field21 : Option < OQa > ,
206212 #[ prost( int32, optional, tag = "22" ) ]
207213 pub field22 : Option < i32 > ,
208214 #[ prost( int32, optional, tag = "23" ) ]
@@ -251,6 +257,11 @@ impl SabrRequestBuilder {
251257 streamer_context : StreamerContext {
252258 field5 : Vec :: new ( ) ,
253259 field6 : Vec :: new ( ) ,
260+ field7 : None ,
261+ field8 : None ,
262+ gp : None ,
263+ playback_cookie : None ,
264+ po_token : None ,
254265 // Basic client info matching googlevideo
255266 client_info : Some ( ClientInfo {
256267 client_name : Some ( 1 ) ,
@@ -259,7 +270,6 @@ impl SabrRequestBuilder {
259270 os_version : Some ( "10.0" . to_string ( ) ) ,
260271 ..Default :: default ( )
261272 } ) ,
262- ..Default :: default ( )
263273 } ,
264274 video_playback_ustreamer_config : None ,
265275 selected_audio_format_ids : Vec :: new ( ) ,
@@ -341,10 +351,9 @@ impl SabrRequestBuilder {
341351 }
342352
343353 pub fn build ( self ) -> VideoPlaybackAbrRequest {
344- // selectedFormatIds should contain all format IDs (both audio and video)
345- let mut selected_format_ids = Vec :: new ( ) ;
346- selected_format_ids. extend ( self . selected_audio_format_ids . clone ( ) ) ;
347- selected_format_ids. extend ( self . selected_video_format_ids . clone ( ) ) ;
354+ // For initial requests, selectedFormatIds should be empty
355+ // It represents previously initialized formats, which don't exist yet
356+ let selected_format_ids = Vec :: new ( ) ;
348357
349358 VideoPlaybackAbrRequest {
350359 client_abr_state : Some ( self . client_abr_state ) ,
@@ -358,6 +367,8 @@ impl SabrRequestBuilder {
358367 field22 : Some ( 0 ) ,
359368 field23 : Some ( 0 ) ,
360369 field1000 : Vec :: new ( ) ,
370+ lo : None ,
371+ field21 : None ,
361372 }
362373 }
363374
@@ -399,6 +410,70 @@ pub fn create_buffered_range(
399410 }
400411}
401412
413+ #[ derive( Clone , PartialEq , Message ) ]
414+ pub struct LoField4 {
415+ #[ prost( int32, optional, tag = "1" ) ]
416+ pub field1 : Option < i32 > ,
417+ #[ prost( int32, optional, tag = "2" ) ]
418+ pub field2 : Option < i32 > ,
419+ #[ prost( int32, optional, tag = "3" ) ]
420+ pub field3 : Option < i32 > ,
421+ }
422+
423+ #[ derive( Clone , PartialEq , Message ) ]
424+ pub struct Lo {
425+ #[ prost( message, optional, tag = "1" ) ]
426+ pub format_id : Option < FormatId > ,
427+ #[ prost( int32, optional, tag = "2" ) ]
428+ pub lj : Option < i32 > ,
429+ #[ prost( int32, optional, tag = "3" ) ]
430+ pub sequence_number : Option < i32 > ,
431+ #[ prost( message, optional, tag = "4" ) ]
432+ pub field4 : Option < LoField4 > ,
433+ #[ prost( int32, optional, tag = "5" ) ]
434+ pub mz : Option < i32 > ,
435+ }
436+
437+ #[ derive( Clone , PartialEq , Message ) ]
438+ pub struct OQa {
439+ #[ prost( string, repeated, tag = "1" ) ]
440+ pub field1 : Vec < String > ,
441+ #[ prost( bytes = "vec" , optional, tag = "2" ) ]
442+ pub field2 : Option < Vec < u8 > > ,
443+ #[ prost( string, optional, tag = "3" ) ]
444+ pub field3 : Option < String > ,
445+ #[ prost( int32, optional, tag = "4" ) ]
446+ pub field4 : Option < i32 > ,
447+ #[ prost( int32, optional, tag = "5" ) ]
448+ pub field5 : Option < i32 > ,
449+ #[ prost( string, optional, tag = "6" ) ]
450+ pub field6 : Option < String > ,
451+ }
452+
453+ #[ derive( Clone , PartialEq , Message ) ]
454+ pub struct Hqa {
455+ #[ prost( int32, optional, tag = "1" ) ]
456+ pub code : Option < i32 > ,
457+ #[ prost( string, optional, tag = "2" ) ]
458+ pub message : Option < String > ,
459+ }
460+
461+ #[ derive( Clone , PartialEq , Message ) ]
462+ pub struct Gqa {
463+ #[ prost( bytes = "vec" , optional, tag = "1" ) ]
464+ pub field1 : Option < Vec < u8 > > ,
465+ #[ prost( message, optional, tag = "2" ) ]
466+ pub field2 : Option < Hqa > ,
467+ }
468+
469+ #[ derive( Clone , PartialEq , Message ) ]
470+ pub struct Fqa {
471+ #[ prost( int32, optional, tag = "1" ) ]
472+ pub r#type : Option < i32 > ,
473+ #[ prost( bytes = "vec" , optional, tag = "2" ) ]
474+ pub value : Option < Vec < u8 > > ,
475+ }
476+
402477#[ cfg( test) ]
403478mod tests {
404479 use super :: * ;
0 commit comments