From: Philipp Spitzer Date: Sun, 22 May 2022 14:37:39 +0000 (+0200) Subject: Don't add video URLs only consisting of whitespace. X-Git-Url: https://git.toastfreeware.priv.at/philipp/winterrodeln/wrpylib.git/commitdiff_plain/98c2d6969da8f3586efbff0c4fda83ecf7cd2840 Don't add video URLs only consisting of whitespace. --- diff --git a/bots/sledrun_wikitext_to_json.py b/bots/sledrun_wikitext_to_json.py index b41840c..7ee83ca 100644 --- a/bots/sledrun_wikitext_to_json.py +++ b/bots/sledrun_wikitext_to_json.py @@ -226,8 +226,8 @@ class SledrunWikiTextToJsonBot( bb = next(bb_iter, None) if bb is not None: video = bb.get('video', None) - if isinstance(video, Parameter) and video.value != "": - sledrun_json['videos'] = [{'url': str(video.value)}] + if isinstance(video, Parameter) and video.value.strip() != "": + sledrun_json['videos'] = [{'url': str(video.value.strip())}] _button_bar() def _public_transport():