From 320c3b1a0bc85e1563c268f9e3828afe17312d9a Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Wed, 16 Sep 2020 07:47:06 +0200 Subject: [PATCH 1/2] Fix bug introduced by v0.10.0 breaking thumbnail on youtube --- prismedia/yt_upload.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/prismedia/yt_upload.py b/prismedia/yt_upload.py index b96df94..524ef56 100644 --- a/prismedia/yt_upload.py +++ b/prismedia/yt_upload.py @@ -158,7 +158,7 @@ def initialize_upload(youtube, options): # If we get a video_id, upload is successful and we are able to set thumbnail if video_id and options.get('--thumbnail'): - set_thumbnail(youtube, options.get('--thumbnail'), videoId=video_id) + set_thumbnail(options, youtube, options.get('--thumbnail'), videoId=video_id) # If we get a video_id and a playlist_id, upload is successful and we are able to set playlist if video_id and playlist_id != "": @@ -229,7 +229,7 @@ def build_resource(properties): return resource -def set_thumbnail(youtube, media_file, **kwargs): +def set_thumbnail(options, youtube, media_file, **kwargs): kwargs = utils.remove_empty_kwargs(**kwargs) request = youtube.thumbnails().set( media_body=MediaFileUpload(media_file, chunksize=-1, @@ -237,8 +237,7 @@ def set_thumbnail(youtube, media_file, **kwargs): **kwargs ) - # See full sample for function - return resumable_upload(request, 'thumbnail', 'set') + return resumable_upload(request, 'thumbnail', 'set', options) def set_playlist(youtube, playlist_id, video_id): From 28a7541fa869b7a6f6c905baae75199fe2665b48 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Wed, 16 Sep 2020 07:48:38 +0200 Subject: [PATCH 2/2] Bump version to v0.10.1 --- CHANGELOG.md | 9 +++++++-- prismedia/upload.py | 2 +- pyproject.toml | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f6de9e..460be62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,18 @@ # Changelog +## v0.10.1 + +### Fix + - fix a bug introduced with v0.10.0 that broke thumbnail on youtube upload. + ## v0.10.0 -## Features +### Features - Add the possibility to specify strict checks option to never forgot parameters when uploading (see #36) - Improve logging system, add options for batch upload and print url-only in the stdout (see #29) - --debug option is now deprecated in favor of --log=debug -## Fixes +### Fixes - Workaround against the Youtube API breakdown while adding video in playlist. See #47 for details. Should be removed once Google fix their bugs. diff --git a/prismedia/upload.py b/prismedia/upload.py index 9e59637..3d6d6db 100755 --- a/prismedia/upload.py +++ b/prismedia/upload.py @@ -130,7 +130,7 @@ except ImportError: 'see https://github.com/ahupp/python-magic\n') exit(1) -VERSION = "prismedia v0.10.0" +VERSION = "prismedia v0.10.1" VALID_PRIVACY_STATUSES = ('public', 'private', 'unlisted') VALID_CATEGORIES = ( diff --git a/pyproject.toml b/pyproject.toml index 529da70..ab8c307 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "prismedia" -version = "0.10.0" +version = "0.10.1" description = "scripting your way to upload videos on peertube and youtube" authors = [ "LecygneNoir ",