From f8d1fb8e331d879f1794ef981f7273874a72e56b Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sat, 20 Oct 2018 20:27:15 +0200 Subject: [PATCH 1/2] fix unicode comparison in pt_upload --- lib/pt_upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pt_upload.py b/lib/pt_upload.py index 25b9e0c..2d4fbdf 100644 --- a/lib/pt_upload.py +++ b/lib/pt_upload.py @@ -57,7 +57,7 @@ def get_default_playlist(user_info): def get_playlist_by_name(user_info, options): for playlist in user_info["videoChannels"]: - if playlist['displayName'] == options.get('--playlist'): + if playlist['displayName'].encode('utf8') == str(options.get('--playlist')): return playlist['id'] From 90d998a64ac9fe02e4b9aa2e1a423f26d6b66865 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Sat, 20 Oct 2018 20:51:43 +0200 Subject: [PATCH 2/2] Patch error on Peertube when playlist name contains non letter characters surrounded by space. fix #19 --- lib/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/utils.py b/lib/utils.py index 4234116..772ff6b 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -193,6 +193,7 @@ def parseNFO(options): def upcaseFirstLetter(s): return s[0].upper() + s[1:] + def cleanString(toclean): toclean = toclean.split(' ') cleaned = '' @@ -201,6 +202,8 @@ def cleanString(toclean): continue strtoclean = unicodedata.normalize('NFKD', unicode (s, 'utf-8')).encode('ASCII', 'ignore') strtoclean = ''.join(e for e in strtoclean if e.isalnum()) + if strtoclean == '': + continue strtoclean = upcaseFirstLetter(strtoclean) cleaned = cleaned + strtoclean