YoutubeDL.post_process: simplify keep_video handling
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 17 Apr 2015 20:38:14 +0000 (22:38 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 17 Apr 2015 20:38:14 +0000 (22:38 +0200)
Since keep_video started as None we always set it to keep_video_wish unless it was None, so in the end keep_video == keep_video_wish. This should have been changed in f3ff1a3696c4080468e2cc5810c34273b148bd3e, but I didn't notice it.

youtube_dl/YoutubeDL.py

index a68b24ab485d6ef8e064ee7533a4a15379eb87cf..6ac85f4e7ecd505499d91b9f51759281287c3a1c 100755 (executable)
@@ -1486,16 +1486,9 @@ class YoutubeDL(object):
             pps_chain.extend(ie_info['__postprocessors'])
         pps_chain.extend(self._pps)
         for pp in pps_chain:
-            keep_video = None
             old_filename = info['filepath']
             try:
-                keep_video_wish, info = pp.run(info)
-                if keep_video_wish is not None:
-                    if keep_video_wish:
-                        keep_video = keep_video_wish
-                    elif keep_video is None:
-                        # No clear decision yet, let IE decide
-                        keep_video = keep_video_wish
+                keep_video, info = pp.run(info)
             except PostProcessingError as e:
                 self.report_error(e.msg)
             if keep_video is False and not self.params.get('keepvideo', False):