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

How to upload multiple videos at once with python YouTube Api

$
0
0

I automated a youtube channel that sends memes from different social media platforms

Now , as I upload the videos , I need to authorise my app multiple times.

Is there a way, so I can upload 4,5 videos at once

It doesn't matter if the title and description are same

Thx in advance

Here's my code for upload

import datetimefrom googleapiclient.http import MediaFileUploadfrom googleapiclient.discovery import buildfrom google_auth_oauthlib.flow import InstalledAppFlowfrom apikey import apikeyCLIENT_SECRET_FILE = 'client_secret.json'SCOPES = ['https://www.googleapis.com/auth/youtube.force-ssl']flow = InstalledAppFlow.from_client_secrets_file(CLIENT_SECRET_FILE, SCOPES)credentials = flow.run_console()youtube = build('youtube', 'v3', credentials=credentials)upload_date_time = datetime.datetime(2020, 8, 25, 12, 30, 0).isoformat() +'.000Z'request_body = {'snippet': {'categoryI': 19,'title': 'funny memes compilation 2022','description': 'Upload TEsting This is Private Video','tags': ['Python', 'Youtube API', 'Google']    },'status': {'privacyStatus': 'private','publishAt': upload_date_time,'selfDeclaredMadeForKids': False,     },'notifySubscribers': False}mediaFile = MediaFileUpload('1.avi')response_upload = youtube.videos().insert(    part='snippet,status',    body=request_body,    media_body=mediaFile).execute()"""youtube.thumbnails().set(    videoId=response_upload.get('id'),    media_body=MediaFileUpload('thumbnail.png')).execute()""" ```

Viewing all articles
Browse latest Browse all 3831

Trending Articles



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