Quantcast
Channel: Active questions tagged youtube-api - Stack Overflow
Viewing all articles
Browse latest Browse all 3831

How exactly does uploading a video with youtubes api work?

$
0
0

I was reading the example code on how to upload a video to youtube using youtubes api and I wasn't sure what certain parts of the code did.

From https://developers.google.com/youtube/v3/guides/uploading_a_video

def get_authenticated_service(args):  flow = flow_from_clientsecrets(CLIENT_SECRETS_FILE,    scope=YOUTUBE_UPLOAD_SCOPE,    message=MISSING_CLIENT_SECRETS_MESSAGE)  storage = Storage("%s-oauth2.json" % sys.argv[0])  credentials = storage.get()  if credentials is None or credentials.invalid:    credentials = run_flow(flow, storage, args)  return build(YOUTUBE_API_SERVICE_NAME, YOUTUBE_API_VERSION,    http=credentials.authorize(httplib2.Http()))

I've read the docs for oauth2client https://oauth2client.readthedocs.io/I'm still unsure if I really understand what's going on but I have some guesses.

So for flow_from_clientsecrets, it returns a "Flow" object. Is this Flow object like instructions/information on the specific api you're trying to interact with?

And then if you pass said Flow object into run_flow my guess is that it goes through whatever process is needed to get the authorization grant and then the access token for whatever api is defined by the Flow object (given that your client secret and id in CLIENT_SECRETS_FILE are valid).

If there's anything wrong with the assumptions ive, made please lemme know. Thanks


Viewing all articles
Browse latest Browse all 3831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>