Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement /proxy/ requests for YouTube 1.4.20 support #106

Open
gohoski opened this issue Jul 10, 2024 · 7 comments
Open

Implement /proxy/ requests for YouTube 1.4.20 support #106

gohoski opened this issue Jul 10, 2024 · 7 comments

Comments

@gohoski
Copy link

gohoski commented Jul 10, 2024

I have successfully set up yt2009 on my server and tried to patch the latest YouTube APK for Android 1.5/1.6, which is 1.4.20.
On the homepage, it makes a POST request to /proxy/ytbt, which isn't currently implemented. In the body, it seems to be merging multiple requests into one.

 POST /proxy/ytbt?ver=3 HTTP/1.1
X-GData-Client: mvapp-android-htc
Content-Length: 720
Connection: Keep-Alive
User-Agent: Android-YouTube/1.1 (bahamas DRC79)

[{'url':'http://****/feeds/api/standardfeeds/most_viewed?format=2&time=today&start-index=1&max-results=3','token':'device-id="z49lc", data="iaq3lunip6zotHC7IKn7aIiKVmI="'},{'url':'http://****/feeds/api/standardfeeds/most_discussed?format=2&time=today&start-index=1&max-results=3','token':'device-id="z49lc", data="Zl2ram9I7k/Bxeh16Iz/mL1eYeM="'},{'url':'http://****/feeds/api/standardfeeds/most_recent?format=2&start-index=1&max-results=3','token':'device-id="z49lc", data="x19ozlUHUvH3Y0uOzxrwxu32Imk="'},{'url':'http://****/feeds/api/standardfeeds/top_rated?format=2&time=today&start-index=1&max-results=3','token':'device-id="z49lc", data="G+Hjv3JWAOiOI6L52+qNLwZsSx4="'},]
HTTP/1.1 404 Not Found
X-Powered-By: Express
Content-Security-Policy: default-src 'none'
X-Content-Type-Options: nosniff
Content-Type: text/html; charset=utf-8
Content-Length: 150
Date: Wed, 10 Jul 2024 17:38:07 GMT
Connection: keep-alive
Keep-Alive: timeout=5

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /proxy/ytbt</pre>
</body>
</html>

There is also mentions of /proxy/feeds/api/ endpoints in the APK code. Maybe we can further decompile the APK and see what data it is expecting to get.

@gohoski gohoski changed the title Add /proxy/ requests for YouTube 1.4.20 support Implement /proxy/ requests for YouTube 1.4.20 support Jul 10, 2024
@mrkrabs206
Copy link

Can i see photo for post request on home?

@ftde0
Copy link
Owner

ftde0 commented Jul 18, 2024

what android version are you using to test this apk? if below 2.3, is it virtualized?

in the meanwhile, in the 1.4.20 apk there seem to be a lot of references to a useProxy, which - if set to false - hints that requests should go directly to gdata with a higher chance of working.

snippet from FeedConnectionManager from 1.4.20:

if (!useProxyServer || !isProxyServerEnabled()) {
  YtLog.m4d(YtLog.Component.HTTP, "getHttpData going directly to server");
  if (url == null) {
    YtLog.m4d(YtLog.Component.HTTP, "getHttpData null url - bailing");
    return null;
  }
  HttpGet get = new HttpGet(url.toString());
  if (partnerAuth != null) {
    get.setHeader("X-GData-Device", partnerAuth);
  }
  httpGet = get;
} 

@gohoski
Copy link
Author

gohoski commented Jul 19, 2024

what android version are you using to test this apk? if below 2.3, is it virtualized?

1.6. I am testing this on the HTC Tattoo.

@mrkrabs206
Copy link

what android version are you using to test this apk? if below 2.3, is it virtualized?

1.6. I am testing this on the HTC Tattoo.

I need a photo for proof

@breakgimme
Copy link
Collaborator

breakgimme commented Jul 22, 2024

I need a photo for proof

you obviously want it only to post it somewhere else, please stop spamming the repo with this stuff

@mrkrabs206
Copy link

I need a photo for proof

you obviously want it only to post it somewhere else, please stop spamming the repo with this stuff

Im sorry

@ftde0
Copy link
Owner

ftde0 commented Jul 24, 2024

what android version are you using to test this apk? if below 2.3, is it virtualized?

1.6. I am testing this on the HTC Tattoo.

that makes more sense. i'm sorry, but as of now, i don't have any android 1.6 (and below) devices to test old apks with, and the first version of youtube to work on newer android versions is 1.6.21. emulators have proven problematic in such old android versions, as i have tried going that route too.

i can't say that there is no hope, but probably nothing too high priority as long as i don't have a setup to test those apks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants