Skip to content

Commit cdc5fff

Browse files
authored
revert for test >
1 parent 218c552 commit cdc5fff

1 file changed

Lines changed: 123 additions & 52 deletions

File tree

Lines changed: 123 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,148 @@
1-
RequestPayload = {
1+
from enum import Enum
2+
3+
4+
requestPayload = {
25
"context": {
36
"client": {
47
"clientName": "WEB",
58
"clientVersion": "2.20241210.01.00",
69
"newVisitorCookie": True,
7-
"utcOffsetMinutes": 0,
810
},
911
"user": {
1012
"lockedSafetyMode": False,
11-
}
13+
},
1214
}
1315
}
1416

15-
userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
16-
17-
videoElementKey = 'videoRenderer'
18-
channelElementKey = 'channelRenderer'
19-
playlistElementKey = 'playlistRenderer'
20-
shelfElementKey = 'shelfRenderer'
21-
itemSectionKey = 'itemSectionRenderer'
22-
continuationItemKey = 'continuationItemRenderer'
23-
playerResponseKey = 'playerResponse'
24-
richItemKey = 'richItemRenderer'
25-
hashtagElementKey = 'hashtagTileRenderer'
26-
hashtagBrowseKey = 'FEhashtag'
27-
28-
hashtagVideosPath = ['contents', 'twoColumnBrowseResultsRenderer', 'tabs', 0, 'tabRenderer', 'content', 'richGridRenderer', 'contents']
29-
hashtagContinuationVideosPath = ['onResponseReceivedActions', 0, 'appendContinuationItemsAction', 'continuationItems']
30-
searchKey = 'AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8'
31-
contentPath = ['contents', 'twoColumnSearchResultsRenderer', 'primaryContents', 'sectionListRenderer', 'contents']
32-
fallbackContentPath = ['contents', 'twoColumnSearchResultsRenderer', 'primaryContents', 'richGridRenderer', 'contents']
33-
continuationContentPath = ['onResponseReceivedCommands', 0, 'appendContinuationItemsAction', 'continuationItems']
34-
continuationKeyPath = ['continuationItemRenderer', 'continuationEndpoint', 'continuationCommand', 'token']
35-
playlistInfoPath = ['response', 'sidebar', 'playlistSidebarRenderer', 'items']
36-
playlistVideosPath = ['response', 'contents', 'twoColumnBrowseResultsRenderer', 'tabs', 0, 'tabRenderer', 'content', 'sectionListRenderer', 'contents', 0, 'itemSectionRenderer', 'contents', 0, 'playlistVideoListRenderer', 'contents']
37-
38-
playlistPrimaryInfoKey = 'playlistSidebarPrimaryInfoRenderer'
39-
playlistSecondaryInfoKey = 'playlistSidebarSecondaryInfoRenderer'
40-
playlistVideoKey = 'playlistVideoRenderer'
41-
42-
43-
class ResultMode:
17+
userAgent = (
18+
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
19+
"AppleWebKit/537.36 (KHTML, like Gecko) "
20+
"Chrome/122.0.0.0 Safari/537.36"
21+
)
22+
23+
videoElementKey = "videoRenderer"
24+
channelElementKey = "channelRenderer"
25+
playlistElementKey = "playlistRenderer"
26+
shelfElementKey = "shelfRenderer"
27+
itemSectionKey = "itemSectionRenderer"
28+
continuationItemKey = "continuationItemRenderer"
29+
playerResponseKey = "playerResponse"
30+
richItemKey = "richItemRenderer"
31+
hashtagElementKey = "hashtagTileRenderer"
32+
hashtagBrowseKey = "FEhashtag"
33+
34+
hashtagVideosPath = [
35+
"contents",
36+
"twoColumnBrowseResultsRenderer",
37+
"tabs",
38+
0,
39+
"tabRenderer",
40+
"content",
41+
"richGridRenderer",
42+
"contents",
43+
]
44+
45+
hashtagContinuationVideosPath = [
46+
"onResponseReceivedActions",
47+
0,
48+
"appendContinuationItemsAction",
49+
"continuationItems",
50+
]
51+
52+
searchKey = "AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8"
53+
54+
contentPath = [
55+
"contents",
56+
"twoColumnSearchResultsRenderer",
57+
"primaryContents",
58+
"sectionListRenderer",
59+
"contents",
60+
]
61+
62+
fallbackContentPath = [
63+
"contents",
64+
"twoColumnSearchResultsRenderer",
65+
"primaryContents",
66+
"richGridRenderer",
67+
"contents",
68+
]
69+
70+
continuationContentPath = [
71+
"onResponseReceivedCommands",
72+
0,
73+
"appendContinuationItemsAction",
74+
"continuationItems",
75+
]
76+
77+
continuationKeyPath = [
78+
"continuationItemRenderer",
79+
"continuationEndpoint",
80+
"continuationCommand",
81+
"token",
82+
]
83+
84+
playlistInfoPath = [
85+
"response",
86+
"sidebar",
87+
"playlistSidebarRenderer",
88+
"items",
89+
]
90+
91+
playlistVideosPath = [
92+
"response",
93+
"contents",
94+
"twoColumnBrowseResultsRenderer",
95+
"tabs",
96+
0,
97+
"tabRenderer",
98+
"content",
99+
"sectionListRenderer",
100+
"contents",
101+
0,
102+
"itemSectionRenderer",
103+
"contents",
104+
0,
105+
"playlistVideoListRenderer",
106+
"contents",
107+
]
108+
109+
playlistPrimaryInfoKey = "playlistSidebarPrimaryInfoRenderer"
110+
playlistSecondaryInfoKey = "playlistSidebarSecondaryInfoRenderer"
111+
playlistVideoKey = "playlistVideoRenderer"
112+
113+
114+
class ResultMode(int, Enum):
44115
json = 0
45116
dict = 1
46117

47118

48-
class SearchMode:
49-
videos = 'EgIQAQ%3D%3D'
50-
channels = 'EgIQAg%3D%3D'
51-
playlists = 'EgIQAw%3D%3D'
52-
livestreams = 'EgJAAQ%3D%3D'
119+
class SearchMode(str, Enum):
120+
videos = "EgIQAQ%3D%3D"
121+
channels = "EgIQAg%3D%3D"
122+
playlists = "EgIQAw%3D%3D"
123+
livestreams = "EgJAAQ%3D%3D"
53124

54125

55-
class VideoUploadDateFilter:
56-
lastHour = 'EgQIARAB'
57-
today = 'EgQIAhAB'
58-
thisWeek = 'EgQIAxAB'
59-
thisMonth = 'EgQIBBAB'
60-
thisYear = 'EgQIBRAB'
126+
class VideoUploadDateFilter(str, Enum):
127+
lastHour = "EgQIARAB"
128+
today = "EgQIAhAB"
129+
thisWeek = "EgQIAxAB"
130+
thisMonth = "EgQIBBAB"
131+
thisYear = "EgQIBRAB"
61132

62133

63-
class VideoDurationFilter:
64-
short = 'EgQQARgB'
65-
long = 'EgQQARgC'
134+
class VideoDurationFilter(str, Enum):
135+
short = "EgQQARgB"
136+
long = "EgQQARgC"
66137

67138

68-
class VideoSortOrder:
69-
relevance = 'CAASAhAB'
70-
uploadDate = 'CAISAhAB'
71-
viewCount = 'CAMSAhAB'
72-
rating = 'CAESAhAB'
139+
class VideoSortOrder(str, Enum):
140+
relevance = "CAASAhAB"
141+
uploadDate = "CAISAhAB"
142+
viewCount = "CAMSAhAB"
143+
rating = "CAESAhAB"
73144

74145

75-
class ChannelRequestType:
146+
class ChannelRequestType(str, Enum):
76147
info = "EgVhYm91dA%3D%3D"
77148
playlists = "EglwbGF5bGlzdHMYAyABcAA%3D"

0 commit comments

Comments
 (0)