From 9426ca465c750aa0c9abc386f7df63374f5e5e99 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sun, 28 Oct 2018 09:53:45 +0100 Subject: [PATCH] Fix 409 conflict in Peertube when a playlist with same name already exists (#20) --- lib/pt_upload.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/pt_upload.py b/lib/pt_upload.py index 2d4fbdf..d852e00 100644 --- a/lib/pt_upload.py +++ b/lib/pt_upload.py @@ -88,6 +88,11 @@ def create_playlist(oauth, url, options): jresponse = response.json() jresponse = jresponse['videoChannel'] return jresponse['id'] + if response.status_code == 409: + logging.error('Peertube: Error: It seems there is a conflict with an existing playlist, please beware ' + 'Peertube internal name is compiled from 20 firsts characters of playlist name.' + ' Please check your playlist name an retry.') + exit(1) else: logging.error(('Peertube: The upload failed with an unexpected response: ' '%s') % response)