-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathtest_upload.py
54 lines (40 loc) · 1.33 KB
/
test_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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
"""Test upload to YouTube."""
import os
from simple_youtube_api.Channel import Channel
from simple_youtube_api.LocalVideo import LocalVideo
directory = os.getcwd()
print(directory)
class Video:
"""Video metdata."""
video = f"{directory}\\videos\\\
ylg9ls_Does_anyone_know_how_a_loss_curve_like_this_can_ha\\\
final.mp4"
title = "What city will you NEVER visit based on it's reputation? \
(r\\AskReddit)"
thumbnail = f"{directory}\\videos\\\
ylg9ls_Does_anyone_know_how_a_loss_curve_like_this_can_ha\
\\thumbnail_0.png"
description = "TTSVibeLounge"
v = Video()
# 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=v.video)
# setting snippet
video.set_title(v.title)
video.set_description(v.description)
video.set_tags(["reddit", "tts"])
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(v.thumbnail)
# uploading video and printing the results
video = channel.upload_video(video)
print(video.id)
print(video)