tamland / python-tidal

Python API for TIDAL music streaming service
GNU Lesser General Public License v3.0
413 stars 110 forks source link

default requests user agent #217

Closed scratchmex closed 9 months ago

scratchmex commented 10 months ago

the library is using the default requests user agent which is something like python-requests/x.y.z which could expose that we are using an unofficial api

is this something you have considered and something to be concerned of?

exislow commented 10 months ago

+1 This library should send the respective user agent of the used client_id.

@tamland: What do you think?

tehkillerbee commented 10 months ago

@exislow @scratchmex Probably a good idea to change it to match the correct response used by tidal, at least to make sure the unofficial api closely resembles the official one.

Not sure exactly what the correct response should be and currently do not have much time to look into it atm.

exislow commented 10 months ago

Let's at least use this one: 'Mozilla/5.0 (Linux; Android 12; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/91.0.4472.114 Safari/537.36' (https://github.com/arnesongit/plugin.audio.tidal2/blob/e9429d601d0c303d775d05a19a66415b57479d87/resources/lib/tidal2/tidalapi/models.py#L39)

tehkillerbee commented 10 months ago

@exislow Well we could just use that one, but it would be nice to know exactly how to obtain that string and add it as a comment. Perhaps we can get it by monitoring the traffic from the official android app.

exislow commented 10 months ago

If the real TIDAL Android app really uses this user agent, this means that they use the system's user agent. A list of different Android user agents can be found here, for instance, https://user-agents.net/browsers/android