Browse Source

youtubedl_wrapper: only append non-empty strings to the video list

Helmut Pozimski 5 years ago
parent
commit
9d60987bbd
1 changed files with 3 additions and 2 deletions
  1. 3 2
      lib_stov/youtubedl_wrapper.py

+ 3 - 2
lib_stov/youtubedl_wrapper.py

@@ -1,5 +1,5 @@
 #
-#        This file is part of stov, written by Helmut Pozimski 2012-2017.
+#        This file is part of stov, written by Helmut Pozimski 2012-2018.
 #
 #       stov is free software: you can redistribute it and/or modify
 #       it under the terms of the GNU General Public License as published by
@@ -63,7 +63,8 @@ def get_ids(url, reverse=False):
         video_ids = error_message.output
     video_ids = video_ids.decode(sys.stdout.encoding).strip()
     for video in video_ids.split("\n"):
-        videos_list.append(video)
+        if video:
+            videos_list.append(video)
     LOGGER.debug("generated list: %s", videos_list)
     return videos_list