Open suryajanaki opened 3 years ago
Hi, I noticed that the video that I'm playing is always HTTP ERROR 403, but when I checked the logs we have the same issue.
I think that the error 403 is because youtube detects multiple calls from your IP and block your access for some time
Do the same test with a VPN to see if the same error happend (with same video)
I tried with the same but the same issue. At last i decrypted the sign and added to the end of the URL, then its working. I think the signature is not in the correct format. seems it's appending with "\u0026" and some other characters at the end of the signature where we get after matcher.
From @suryajanaki example this is what I did and its working.
Matcher mat2 = patCipherUrl.matcher(cipher); if (mat2.find()) { url = URLDecoder.decode(mat2.group(1), "UTF-8"); mat2 = patEncSig.matcher(cipher); if (mat2.find()) { sig = URLDecoder.decode(mat2.group(1), "UTF-8"); sig = sig.replace("\u0026", "&"); String[] test = sig.split("&"); sig = test[0]; Log.d(LOG_TAG, "SIG:"+sig); } else { continue; } } else { continue; }
@lortspogi I did what you did but not working.
Now it can fetch video urls but those urls give http 403 error. is it normal?
From what I experienced, you get 403 because of the wrong signature. If you follow the solution of #163 at and the code above I think it will work. All private videos is still playing on my end.
it's working now. Thank you!
hi @lortspogi if it is not a problem for you, I would like to add your solution to my PR #163. Thanks
I don't mind at all.
Now let's hope that @HaarigerHarald is going to merge that soon.
From @suryajanaki example this is what I did and its working.
Matcher mat2 = patCipherUrl.matcher(cipher); if (mat2.find()) { url = URLDecoder.decode(mat2.group(1), "UTF-8"); mat2 = patEncSig.matcher(cipher); if (mat2.find()) { sig = URLDecoder.decode(mat2.group(1), "UTF-8"); sig = sig.replace("\u0026", "&"); String[] test = sig.split("&"); sig = test[0]; Log.d(LOG_TAG, "SIG:"+sig); } else { continue; } } else { continue; }
Yes, Instead, we can change the pattern like below private static final Pattern patEncSig = Pattern.compile("s=(.{10,}?)(&|\\u0026)");
hi @lortspogi if it is not a problem for you, I would like to add your solution to my PR #163. Thanks
Simply changing the Pattern will fix this, private static final Pattern patEncSig = Pattern.compile("s=(.{10,}?)(&|\\u0026)");
Oh thanks, my bad I'm not good at regex. :D
Hi,
I found a defect while reading/getting cipher signature from matcher group. Pattern patEncSig = Pattern.compile("s=(.{10,}?)(\\\\u0026|\z)");
mat2 = patEncSig.matcher(cipher); if (mat2.find()) { sig = URLDecoder.decode(mat2.group(1), "UTF-8"); Qlog.d(TAG,"The final signature is : "+sig); } else {
Here the "sig" value always containing with like" s=AAOq0QJ8wRQIhAPZdMBlmj8ukXEvNmGhFK_KPU_zC0xOEu8FyR2AK%3DyvQAiAF67RVeMm3x7GqcD7WnUGE37aAbIk0mxgXsAqYFnwF3w%3D%3Dw%3Dw%3D\u0026sp=sig\u0026url=https://r3---sn-ci5gup-itqs.googlevideo.com/........"
Actually we have to get sig= "s=AAOq0QJ8wRQIhAPZdMBlmj8ukXEvNmGhFK_KPU_zC0xOEu8FyR2AK%3DyvQAiAF67RVeMm3x7GqcD7WnUGE37aAbIk0mxgXsAqYFnwF3w%3D%3Dw%3D_w%3D"
Due this we can't able to decry pt the signature. And eventually the videos is not panel. Could you suggest me in this!
Thank You