Spaces:
Paused
Paused
Update YukkiMusic/platforms/YoutubeAPI/InnertubeAPI.py
Browse files
YukkiMusic/platforms/YoutubeAPI/InnertubeAPI.py
CHANGED
|
@@ -166,15 +166,55 @@ async def search_player_data_with_post_api(query):
|
|
| 166 |
|
| 167 |
|
| 168 |
final_query={
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
async with aiohttp.ClientSession() as session:
|
| 179 |
async with session.post(
|
| 180 |
'https://youtubei.googleapis.com/youtubei/v1/player',
|
|
@@ -189,53 +229,6 @@ async def search_player_data_with_post_api(query):
|
|
| 189 |
all_adaptive_formats_video = json_data.get('streamingData', {}).get(
|
| 190 |
'adaptiveFormats',
|
| 191 |
[])
|
| 192 |
-
''' video details content JSON DATA {} with key:value
|
| 193 |
-
demo data
|
| 194 |
-
{
|
| 195 |
-
"videoId": "k3g_WjLCsXM",
|
| 196 |
-
"title": "Sajni (Song): Arijit Singh, Ram Sampath | Laapataa Ladies | Aamir Khan Productions",
|
| 197 |
-
"lengthSeconds": "146",
|
| 198 |
-
"keywords": [
|
| 199 |
-
"sajni laapata ladies",
|
| 200 |
-
"sajni laapataa ladies",
|
| 201 |
-
"sajni"
|
| 202 |
-
],
|
| 203 |
-
"channelId": "UCq-Fj5jknLsUf-MWSy4_brA",
|
| 204 |
-
"isOwnerViewing": false,
|
| 205 |
-
"shortDescription": "Presenting the Song \"Sajni\" from the upcoming film Laapataa Ladies. Sung by Arijit Singh, Composed by Ram Sampath and Penned by Prashant Pandey.\n\n#LaapataaLadies #Sajni #ArijitSingh #RamSampath\n\nJio Studios Presents \nAamir Khan Productions \"LAAPATAA LADIES\" \n\n♪Full Song Available on♪ \nJioSaavn: https://bit.ly/3SV0n0w\nSpotify: https://bit.ly/3wgICzV\nHungama: https://bit.ly/499FkNy\nApple Music: https://bit.ly/3SEqRlL\nAmazon Prime Music: https://bit.ly/3Uxi1Zv\nWynk: https://bit.ly/3uwyX7O\nYouTube Music: https://bit.ly/4bzkV5R\n\nSong Credits:\nSong Name: Sajni\nComposed By : Ram Sampath\nLyricist : Prashant Pandey\nSinger : Arijit Singh\nMusic Arranged & Produced by : Ram Sampath\nMusic Supervisor : Vrashal Chavan\nRecorded & Mixed at Omgrown Music, Mumbai by Amey Wadibhasme\nMastered by Gethin John at Hafod Mastering\nVocal Recordist : Sukanto Singha\nVocal Editor : Prithviraj Sarkar\nMusic Label: T-Series\n\nFilm Credits: \nDirected by Kiran Rao \nProduced by Aamir Khan, Kiran Rao & Jyoti Deshpande\nStarring : Nitanshi Goel, Pratibha Ranta, Sparsh Shrivastava, Ravi Kishan and Chhaya Kadam\nCo Stars : Bhaskar Jha, Durgesh Kumar, Geeta Aggarwal, Pankaj Sharma, Rachna Gupta, Abeer Jain, Kirti Jain, Daood Hussain, Pranjal Pateriya, Samarth Mohar, Satendra Soni, Ravi Kapadiya, Kishore Soni. \nOriginal Story : Biplab Goswami \nScreenplay & Dialogues : Sneha Desai \nAdditional Dialogues : Divyanidhi Sharma \nMusic : Ram Sampath \nLyricists : Swanand Kirkire, Prashant Pandey, Divyanidhi Sharma \nSingers: Shreya Ghoshal, Arijit Singh, Sukhwinder Singh, Sona Mohapatra\nDirector of Photography : Vikash Nowlakha\nEditor : Jabeen Merchant \nProduction Designer : Vikram Singh \nCostume Designer : Darshan Jalan \nCasting : Romil Jain \nSound Designer : Ayush Ahuja \nProduction Sound Mixer : Ravi Dev Singh \nMake Up Designer : Kamlesh Shinde \nHair Designer : Joyce Fernandez \n1st Assistant Director : Rakesh E. Nair \nLine Producer : Jaspal Dogra \nScript Supervisor : Mandira Roy \nDialect Coach : Sonu Anand \nDirector's Assistant : Pooja Kumar \nColorist : Michele Ricossa \nVisual Effects Studio : SM Rolling \nVFX DI Studio : Prasad Labs \nVisual Promotions : Just Right Studioz NX \nAKP Finance Team : Sharada Harihar, Aditya Shah, Huzvak Batliwala, Pankti Mehta, Tejasvi Gurav, Manisha Abhyankar\nFinancial Advisor : Bimal Parekh & Co \nExecutive Producers : Antara Banerjee & Naved Farooqui \nCo-Producers : B. Shrinivas Rao & Tanaji Dasgupta \n\nDownload Song Beat: https://bit.ly/3Cjh24R \n\n___________________________________\nEnjoy & stay connected with us!\n👉 Subscribe to T-Series: https://youtube.com/tseries\n👉 Like us on Facebook: https://www.facebook.com/tseriesmusic\n👉 Follow us on X: https://twitter.com/tseries\n👉 Follow us on Instagram: https://instagram.com/tseries.official",
|
| 206 |
-
"isCrawlable": true,
|
| 207 |
-
"thumbnail": {
|
| 208 |
-
"thumbnails": [
|
| 209 |
-
{
|
| 210 |
-
"url": "https://i.ytimg.com/vi/k3g_WjLCsXM/default.jpg",
|
| 211 |
-
"width": 120,
|
| 212 |
-
"height": 90
|
| 213 |
-
},
|
| 214 |
-
{
|
| 215 |
-
"url": "https://i.ytimg.com/vi/k3g_WjLCsXM/mqdefault.jpg",
|
| 216 |
-
"width": 320,
|
| 217 |
-
"height": 180
|
| 218 |
-
},
|
| 219 |
-
{
|
| 220 |
-
"url": "https://i.ytimg.com/vi/k3g_WjLCsXM/hqdefault.jpg",
|
| 221 |
-
"width": 480,
|
| 222 |
-
"height": 360
|
| 223 |
-
},
|
| 224 |
-
{
|
| 225 |
-
"url": "https://i.ytimg.com/vi/k3g_WjLCsXM/sddefault.jpg",
|
| 226 |
-
"width": 640,
|
| 227 |
-
"height": 480
|
| 228 |
-
}
|
| 229 |
-
]
|
| 230 |
-
},
|
| 231 |
-
"allowRatings": true,
|
| 232 |
-
"viewCount": "70761818",
|
| 233 |
-
"author": "T-Series",
|
| 234 |
-
"isPrivate": false,
|
| 235 |
-
"isUnpluggedCorpus": false,
|
| 236 |
-
"isLiveContent": false
|
| 237 |
-
}'''
|
| 238 |
-
|
| 239 |
videodetails = json_data.get('videoDetails', {})
|
| 240 |
|
| 241 |
|
|
@@ -246,5 +239,5 @@ async def search_player_data_with_post_api(query):
|
|
| 246 |
|
| 247 |
searchresult_list.append(video)
|
| 248 |
|
| 249 |
-
#print(
|
| 250 |
-
return searchresult_list, videodetails
|
|
|
|
| 166 |
|
| 167 |
|
| 168 |
final_query={
|
| 169 |
+
"context":{
|
| 170 |
+
"client":{"hl":"en",
|
| 171 |
+
"gl":"IN",
|
| 172 |
+
"deviceMake":"",
|
| 173 |
+
"deviceModel":"",
|
| 174 |
+
"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:132.0) Gecko/20100101 Firefox/132.0,gzip(gfe)",
|
| 175 |
+
"clientName":"IOS",
|
| 176 |
+
"clientVersion":"19.16.3",
|
| 177 |
+
"screenPixelDensity":1,
|
| 178 |
+
"timeZone":"Asia/Kolkata",
|
| 179 |
+
"browserName":"Firefox",
|
| 180 |
+
"browserVersion":"132.0",
|
| 181 |
+
"acceptHeader":"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
| 182 |
+
"deviceExperimentId":"ChxOelF6TkRNNU1UTTJPRE01T0RrNE9EZzVNQT09EI-HsbkGGI-HsbkG",
|
| 183 |
+
"screenWidthPoints":1534,
|
| 184 |
+
"screenHeightPoints":334,
|
| 185 |
+
"utcOffsetMinutes":330,
|
| 186 |
+
"clientScreen":"WATCH",
|
| 187 |
+
"mainAppWebInfo":{
|
| 188 |
+
"pwaInstallabilityStatus":"PWA_INSTALLABILITY_STATUS_UNKNOWN",
|
| 189 |
+
"webDisplayMode":"WEB_DISPLAY_MODE_BROWSER","isWebNativeShareAvailable":"false"
|
| 190 |
+
}
|
| 191 |
+
},
|
| 192 |
+
"user":{"lockedSafetyMode":"false"},
|
| 193 |
+
"request":{"useSsl":"true","internalExperimentFlags":[],"consistencyTokenJars":[]},
|
| 194 |
+
"clickTracking":{"clickTrackingParams":"CNQCENwwIhMI1emaz7LJiQMVN-lMAh3IOCkMMgpnLWhpZ2gtcmVjWg9GRXdoYXRfdG9fd2F0Y2iaAQYQjh4YngE="}
|
| 195 |
+
},
|
| 196 |
+
"videoId":query,
|
| 197 |
+
"params":"YAHIAQE%3D",
|
| 198 |
+
"playbackContext":{
|
| 199 |
+
"contentPlaybackContext":{
|
| 200 |
+
"vis":5,
|
| 201 |
+
"splay":"false",
|
| 202 |
+
"autoCaptionsDefaultOn":"false",
|
| 203 |
+
"autonavState":"STATE_NONE",
|
| 204 |
+
"html5Preference":"HTML5_PREF_WANTS",
|
| 205 |
+
"signatureTimestamp":20032,
|
| 206 |
+
"autoplay":"true",
|
| 207 |
+
"autonav":"true",
|
| 208 |
+
"referer":"https://www.youtube.com/",
|
| 209 |
+
"lactMilliseconds":"-1",
|
| 210 |
+
"watchAmbientModeContext":{
|
| 211 |
+
"hasShownAmbientMode":"true","watchAmbientModeEnabled":"true"}
|
| 212 |
+
}
|
| 213 |
+
},
|
| 214 |
+
"racyCheckOk":"false",
|
| 215 |
+
"contentCheckOk":"false"
|
| 216 |
+
}
|
| 217 |
+
|
| 218 |
async with aiohttp.ClientSession() as session:
|
| 219 |
async with session.post(
|
| 220 |
'https://youtubei.googleapis.com/youtubei/v1/player',
|
|
|
|
| 229 |
all_adaptive_formats_video = json_data.get('streamingData', {}).get(
|
| 230 |
'adaptiveFormats',
|
| 231 |
[])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 232 |
videodetails = json_data.get('videoDetails', {})
|
| 233 |
|
| 234 |
|
|
|
|
| 239 |
|
| 240 |
searchresult_list.append(video)
|
| 241 |
|
| 242 |
+
#print(searchresult_list, videodetails)
|
| 243 |
+
return searchresult_list, videodetails
|