diff --git a/CHANGELOG.md b/CHANGELOG.md index 4501f2b..f3ad7a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## v0.6.4 + +### Fixes + - Fix #33, no more trying to add a video into a playlist when the playlist does not exist on Youtube + - fix #39, patch the playlist name check when playlist contains special chars + ## v0.6.3 ### Fixes diff --git a/lib/yt_upload.py b/lib/yt_upload.py index 0dfbc57..8c726c3 100644 --- a/lib/yt_upload.py +++ b/lib/yt_upload.py @@ -156,8 +156,8 @@ def initialize_upload(youtube, options): if video_id and options.get('--thumbnail'): set_thumbnail(youtube, options.get('--thumbnail'), videoId=video_id) - # If we get a video_id, upload is successful and we are able to set playlist - if video_id and options.get('--playlist'): + # 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 != "": set_playlist(youtube, playlist_id, video_id) @@ -168,7 +168,7 @@ def get_playlist_by_name(youtube, playlist_name): maxResults=50 ).execute() for playlist in response["items"]: - if playlist["snippet"]['title'] == playlist_name: + if playlist["snippet"]['title'].encode('utf8') == str(playlist_name): return playlist['id'] @@ -252,8 +252,10 @@ def set_playlist(youtube, playlist_id, video_id): except Exception as e: if hasattr(e, 'message'): logging.error("Youtube: Error: " + str(e.message)) + exit(1) else: logging.error("Youtube: Error: " + str(e)) + exit(1) logging.info('Youtube: Video is correctly added to the playlist.') diff --git a/prismedia_upload.py b/prismedia_upload.py index 6e4159c..8346f56 100755 --- a/prismedia_upload.py +++ b/prismedia_upload.py @@ -92,7 +92,7 @@ except ImportError: 'see https://github.com/ahupp/python-magic\n') exit(1) -VERSION = "prismedia v0.6.3" +VERSION = "prismedia v0.6.4" VALID_PRIVACY_STATUSES = ('public', 'private', 'unlisted') VALID_CATEGORIES = (