Dmn this api is gone. Basically u can get a
client- credentials.json from api console
Allow mail IDs u want to allow.
Use this code for logging in and getting user access token.
If u search u will be able get REST methods to do this as well.
Code- https://github.com/Underemployed/Google-Photos-Downloader/blob/main/Google.py