string GetVideoJson(string videoId, bool isLive) { string userAgent, headers, postData; if (true) { userAgent = "com.google.android.apps.youtube.vr.oculus/1.60.19 (Linux; U; Android 12L; eureka-user Build/SQ3A.220605.009.A1) gzip"; headers = "X-YouTube-Client-Name: 28\r\n" "X-YouTube-Client-Version: 1.60.19\r\n" "Origin: https://www.youtube.com\r\n" "content-type: application/json\r\n"; if (isLive) { postData = "{\"context\": {\"client\": {\"clientName\": \"ANDROID_VR\", \"clientVersion\": \"1.60.19\", \"deviceMake\": \"Oculus\", \"deviceModel\": \"Quest 3\", \"clientScreen\": \"EMBED\"}, " "\"thirdParty\": {\"embedUrl\": \"https://google.com\"}}, \"videoId\": \"" + videoId + "\", \"params\": \"wgYCCAA=\", \"contentCheckOk\": true, \"racyCheckOk\": true}"; } else { postData = "{\"context\": {\"client\": {\"clientName\": \"ANDROID_VR\", \"clientVersion\": \"1.60.19\", \"deviceMake\": \"Oculus\", \"deviceModel\": \"Quest 3\", \"hl\": \"" + HostIso639LangName() + "\"}}, " "\"videoId\": \"" + videoId + "\", \"params\": \"wgYCCAA=\", \"playbackContext\": {\"contentPlaybackContext\": {\"html5Preference\": \"HTML5_PREF_WANTS\"}}, \"contentCheckOk\": true, \"racyCheckOk\": true}"; } } else { if (isLive) { postData = "{\"contentCheckOk\": true, \"context\": {\"client\": {\"clientName\": \"MWEB\", \"clientVersion\": \"2.20240726.01.00\", " "\"hl\": \"" + HostIso639LangName() + "\", \"timeZone\": \"UTC\", \"utcOffsetMinutes\": 0}}, \"playbackContext\": {\"contentPlaybackContext\": {\"html5Preference\": \"HTML5_PREF_WANTS\"}}, " "\"racyCheckOk\": true, \"videoId\": \"" + videoId + "\"}"; headers = "X-YouTube-Client-Name: 2\r\n" "X-YouTube-Client-Version: 2.20240726.01.00\r\n" "Origin: https://www.youtube.com\r\n" "content-type: application/json\r\n"; } else { postData = "{\"contentCheckOk\": true, \"context\": {\"client\": {\"clientName\": \"IOS\", \"clientVersion\": \"19.45.4\", " "\"deviceMake\": \"Apple\", \"deviceModel\": \"iPhone16,2\", \"hl\": \"" + HostIso639LangName() + "\", \"osName\": \"iPhone\", \"osVersion\": \"18.1.0.22B83\", " "\"timeZone\": \"UTC\", \"utcOffsetMinutes\": 0}}, \"playbackContext\": {\"contentPlaybackContext\": {\"html5Preference\": \"HTML5_PREF_WANTS\"}}, \"racyCheckOk\" : true, \"videoId\" : \"" + videoId + "\"}"; headers = "X-YouTube-Client-Name: 5\r\n" "X-YouTube-Client-Version: 19.45.4\r\n" "Origin: https://www.youtube.com\r\n" "content-type: application/json\r\n"; userAgent = "com.google.ios.youtube/19.45.4 (iPhone16,2; U; CPU iOS 18_1_0 like Mac OS X;)"; } } return GetVideoJson(userAgent, headers, postData); } string PlayitemParse(const string &in path, dictionary &MetaData, array<dictionary> &QualityList) { |