-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload.py
30 lines (24 loc) · 808 Bytes
/
upload.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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="output/test.mp4")
# setting snippet
video.set_title("My Title")
video.set_description("This is a description")
video.set_tags(["this", "tag"])
video.set_category("music")
video.set_default_language("en-US")
video.set_made_for_kids(True)
# setting status
video.set_embeddable(True)
video.set_license("creativeCommon")
video.set_privacy_status("private")
video.set_public_stats_viewable(True)
# uploading video and printing the results
video = channel.upload_video(video)
print(video.id)
print(video)
print(video.url)