]> ToastFreeware Gitweb - philipp/winterrodeln/wrpylib.git/commitdiff
Don't add video URLs only consisting of whitespace.
authorPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 22 May 2022 14:37:39 +0000 (16:37 +0200)
committerPhilipp Spitzer <philipp@spitzer.priv.at>
Sun, 22 May 2022 14:37:39 +0000 (16:37 +0200)
bots/sledrun_wikitext_to_json.py

index b41840c17006f24501007e88810b104a37efa913..7ee83ca5a6047fcf8788339d76ade23163f0ae20 100644 (file)
@@ -226,8 +226,8 @@ class SledrunWikiTextToJsonBot(
             bb = next(bb_iter, None)
             if bb is not None:
                 video = bb.get('video', None)
             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():
         _button_bar()
 
         def _public_transport():