LuanRT / googlevideo

A set of utilities for working with Google Video APIs.
MIT License
16 stars 0 forks source link

Can't get response with Android/Ios player client #3

Open luthfipun opened 1 week ago

luthfipun commented 1 week ago

Question

I am trying to get a response with the serverAbrStreamingUrlURL from the Android/iOS player client, which doesn't require deciphering.

Then I set the client info like this in the request body :

clientInfo: {
      clientName: 1,
      clientVersion: '19.30.36',
      osName: 'Android',
      osVersion: '14',
      androidSdkVersion: 34
}

However, the response always returns STREAM_PROTECTION_STATUS: Attestation required. I realized that in the serverAbrStreamingUrlURL, the Android/iOS player client query does not include the n and ns query parameters. Is the request body for the Android/iOS player client different?

Other details

No response

Checklist

LuanRT commented 1 week ago

It's expecting you to pass in a potoken. But that's quite interesting... The Android client's server abr stream usually returns 403 after a while if it wants a potoken, I've only seen web based clients using the STREAM_PROTECTION_STATUS UMP part for that purpose.

For example, here's what I currently get if I change the client to Android and try to download anything using the abr stream:

Title: Night in the Woods - Astral Train (Buildup)
  Duration: 288
  Views: 221925
  Author: hoontee
  Video ID: mzqO7oKTJKI

video (247) [■■■■■■■■                                ] 18% | ETA: 177s
audio (251) [■■■■■■                                  ] 15% | ETA: 221s
Error: Received an invalid response from the server: 403
    at ServerAbrStream.fetchMedia (file:///C:/Users/luanl/code/codeberg/googlevideo/dist/src/core/ServerAbrStream.js:113:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ServerAbrStream.init (file:///C:/Users/luanl/code/codeberg/googlevideo/dist/src/core/ServerAbrStream.js:64:30)
    at <anonymous> (c:\Users\luanl\code\codeberg\googlevideo\examples\downloader\main.ts:129:1)

Either way, I recommend using the web client's server abr streams, as they don't require PoTokens yet.

luthfipun commented 1 week ago

It turns out that for the Android client, after a while, all URLs in the adaptive formats return 403. For now, I will use the web client. Thank you