From 80146d9a5ec772a8dc6fc036bac252ee89b8cbb4 Mon Sep 17 00:00:00 2001 From: girst Date: Sun, 9 Aug 2020 12:19:15 +0200 Subject: [PATCH] Revert "secondary channel format" useless if it doesn't work all the time This reverts commit 4e3b56b967570b9498651cf758a5ca3c56640689. --- app/dangerous/protobuf.py | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) diff --git a/app/dangerous/protobuf.py b/app/dangerous/protobuf.py index 03fdda5..314f679 100644 --- a/app/dangerous/protobuf.py +++ b/app/dangerous/protobuf.py @@ -69,31 +69,13 @@ class Subparams: page: Optional[str] = field(15) sort: Optional[int64] = field(3, default=None) unknown_const1: int64 = field(7, default=1) - #unknown_const2: int64 = field(23, default=0) + unknown_const2: int64 = field(23, default=0) # usually returns gridResponses. to switch to listResponses (cargo-culting # invidious, playlist continuations (not yet supported) require list): list_or_grid: Optional[int64] = field(6,default=2) # 2=list, None/1=grid # invidious sets those, but no idea why: #field12:int64 = field(12,default=1) #field13:str = field(13,default="") # playlists in list mode don't work without this - field61: Optional[str] = field(61, default=None) # base64 channelData -@message -@dataclass -class ChannelSubSubSubData: - offset: int = field(1) -@message -@dataclass -class ChannelSubSubData: - params: str = field(1) # base64 channelSubSubSubData -@message -@dataclass -class ChannelSubData: - const1: int64 = field(1, default=6307666885028338688) - params: ChannelSubSubData = field(2, default=None) -@message -@dataclass -class ChannelData: - params: ChannelSubData = field(1) @message @dataclass class Params: @@ -107,7 +89,7 @@ class Continuation: def make_channel_params(subject, typ="videos", page=1, sort=None, query=None): typestr = dict(videos="videos", playlists="playlists", search="search") typeint = dict(videos=0, playlists=1, search=None) # not supporting autogen'd - sortorder = dict(newest=3, popular=1, oldest=2) # otherform: newest=3 + sortorder = dict(newest=None, popular=1, oldest=2) if typ == "playlists": sortorder = dict(oldest=2, newest=3, modified=4) elif typ == "search": @@ -120,20 +102,7 @@ def make_channel_params(subject, typ="videos", page=1, sort=None, query=None): type_s=typestr.get(typ), type_i=typeint.get(typ), sort=sortorder.get(sort), - page=str(page) if page else None, # Note: ucid/playlists doesn't support pagination - #page=None, # depending on the channel, one has to set either page or field61. there seems no indication on which one is required, but page-channels ignore field61, and field61-channels are confused by page and fail to return results sometimes :( example field61-channel: UC6Om9kAkl32dWlDSNlDS9Iw example page-channel: UCXuqSBlHAE6Xw-yeJA0Tunw - list_or_grid=1, # field61-channels must have this set! - field61=b64e( - ChannelData( - params=ChannelSubData( - params=ChannelSubSubData( - params=b64e( - ChannelSubSubSubData(offset=(page-1)*30).dumps() - ,padding=False) - ) - ) - ).dumps() - ,padding=False), + page=str(page) if page else None # Note: ucid/playlists doesn't support pagination ).dumps()), query=query, ), -- 2.39.3