Leshuguita / PotPlayer-SponsorBlock

Modified version of the default PotPlayer YouTube extension that adds SponsorBlock support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

solution: low bitrate

djl987645 opened this issue · comments

i don't know how write issue on github but i found solution of low bitrate while playing with this

reason of low bitrate is this using old nX-YouTube-Client-Version so i just swaped string GetVideoJson of this to original mediaPlayparse's string GetVideoJson

then low bitrate problem is solved

and this is original mediaPlayparse's string GetVideoJson

string GetVideoJson(string videoId, bool passAge)
{
string Headers = "X-YouTube-Client-Name: 3\r\nX-YouTube-Client-Version: 17.31.35\r\nOrigin: https://www.youtube.com\r\ncontent-type: application/json\r\n";
string postData = "{\"context\": {\"client\": {\"clientName\": \"ANDROID\", \"clientVersion\": \"17.31.35\", \"hl\": \"" + HostIso639LangName() + "\"}}, \"videoId\": \"" + videoId + "\", \"params\": \"CgIQBg==\", \"playbackContext\": {\"contentPlaybackContext\": {\"html5Preference\": \"HTML5_PREF_WANTS\"}}, \"contentCheckOk\": true, \"racyCheckOk\": true}";
string postData2 = "{\"context\": {\"client\": {\"clientName\": \"ANDROID\", \"clientVersion\": \"17.31.35\", \"clientScreen\": \"EMBED\"}, \"thirdParty\": {\"embedUrl\": \"https://google.com\"}}, \"videoId\": \"" + videoId + "\", \"params\": \"CgIQBg==\", \"contentCheckOk\": true, \"racyCheckOk\": true}";

return HostUrlGetStringWithAPI("https://www.youtube.com/youtubei/v1/player", "com.google.android.youtube/17.31.35 (Linux; U; Android 11) gzip", Headers, passAge ? postData2 : postData, true);
}

Hi, thank you!
I switched to Linux some time ago and stopped using PotPlayer, so I can't really test your solution. Still, I'll put it on the README so it's easier to find for anyone else.