GoodGame/youtube_upload.py
nadeemsadiq 16fa81d5af feat: Intial POC of GoodGames
Includes basic Video editing, OBS intergration, game detecting and clip editor
2023-07-20 19:41:09 +01:00

35 lines
1.1 KiB
Python

from simple_youtube_api.Channel import Channel
from simple_youtube_api.LocalVideo import LocalVideo
def upload_video(file_path):
# loggin into the channel
channel = Channel()
channel.login("client_secret_6793728376-alv7pcqjm3psoibm3rd0cvuhu9uomolr.apps.googleusercontent.com.json", "credentials.storage")
# setting up the video that is going to be uploaded
video = LocalVideo(file_path=file_path)
# setting snippet
video.set_title("Testing link sharing")
video.set_description("This is a description")
video.set_tags(["this", "tag"])
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('86106086e9594672ad7408913b5a3a24.jpg')
# uploading video and printing the results
video = channel.upload_video(video)
print(video.id)
print(video)
# liking video
# video.like()