Skip to content

Commit

Permalink
changed local video constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnekaunisto committed May 21, 2019
1 parent 38f3f97 commit 39fad04
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
14 changes: 8 additions & 6 deletions examples/example_youtube_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
channel.login("client_secret.json", "credentials.storage")

video = LocalVideo(file_path="test_vid.mp4")

print(video.default_language)
#snippet
video.set_title("My Title")
video.set_description("This is a description")
video.set_tags(["this", "tag"])
video.set_category("gaming")
video.set_default_language("english")
#video.set_default_language("english")

#status
video.set_embeddable(True)
video.set_license("creativeCommon")
video.set_privacy_status("private")
video.set_public_stats_viewable(True)
#video.set_embeddable(True)
#video.set_license("creativeCommon")
#video.set_privacy_status("private")
#video.set_public_stats_viewable(True)

print(video.default_language)


channel.upload_video(video)
5 changes: 3 additions & 2 deletions simple_youtube_api/LocalVideo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ class LocalVideo(Video):


def __init__(self, file_path, title="", description="", tags=[],
category=1, default_language="english"):
category=1, default_language=None):
Video.__init__(self)

self.set_file_path(file_path)
self.set_title(title)
self.set_description(description)
self.set_tags(tags)
self.set_category(category)
self.set_default_language(default_language)
if not default_language is None:
self.set_default_language(default_language)

def set_file_path(self, file_path):
if file_path is not None and os.path.isfile(file_path):
Expand Down
2 changes: 1 addition & 1 deletion simple_youtube_api/Video.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(self):
self.description = ""
self.tags = []
self.category = 1
self.default_language = "English" #implement
self.default_language = None
self.snippet_set = True

#status
Expand Down
2 changes: 2 additions & 0 deletions simple_youtube_api/youtube_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def generate_upload_body(video):
if not video.publish_at is None:
status.update({"publishAt": video.embeddable})
body.update({"status": status})

print(body)

return body

Expand Down

0 comments on commit 39fad04

Please sign in to comment.