jonnekaunisto / simple-youtube-api

Object-oriented Wrapper for Youtube API in Python
https://simple-youtube-api.rtfd.io
Other
74 stars 16 forks source link

oauth2client.clientsecrets.InvalidClientSecretsError: Missing property "client_secret" in a client type of "web" #53

Open BlueSchnabeltier opened 2 years ago

BlueSchnabeltier commented 2 years ago

Code:

from simple_youtube_api.Channel import Channel
from simple_youtube_api.LocalVideo import LocalVideo

# loggin into the channel
channel = Channel()
channel.login("client_secret.json", "credentials.storage")

# setting up the video that is going to be uploaded
video = LocalVideo(file_path="video.mp4")

# setting snippet
video.set_title("My Title")
video.set_description("This is a description")
video.set_tags(["shorts"])
video.set_category("gaming")
video.set_default_language("en-US")

# setting status
video.set_embeddable(True)
video.set_license("creativeCommon")
video.set_privacy_status("private")
video.set_public_stats_viewable(True)

# setting thumbnail
video.set_thumbnail_path('thumb.png')

# uploading video and printing the results
video = channel.upload_video(video)
print(video.id)
print(video)

# liking video
video.like()

Client Secret:

{"web":{"client_id":"(hidden)apps.googleusercontent.com","project_id":"aerial-handbook-340311","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","redirect_uris":["http://localhost:8080/oauth2callback/"]}}

Pls help me And if you can pls dm me the answer on discord BlueSchnabeltier#3746

pavelzbornik commented 2 years ago

Hey @BlueSchnabeltier ,

had the same issue, what you need to select in Google Cloud console Credentials is the application type Desktop app which has client id and client secret. image

What you should also do if not done already add yourself as a test user to OAuth consent screen so you can make the request to the API.

Also when running the login for the first time, don't use Jupyter notebook, it generated a problem for the authentication process, running the script in the terminal made the flow run fine and could authenticate.

I hope it helps.

BlueSchnabeltier commented 2 years ago

Hey @BlueSchnabeltier ,

had the same issue, what you need to select in Google Cloud console Credentials is the application type Desktop app which has client id and client secret.

image

What you should also do if not done already add yourself as a test user to OAuth consent screen so you can make the request to the API.

Also when running the login for the first time, don't use Jupyter notebook, it generated a problem for the authentication process, running the script in the terminal made the flow run fine and could authenticate.

I hope it helps.

Thank you very much! 😄