]> jfr.im git - yt-dlp.git/commitdiff
Minor bugfixes
authorpukkandan <redacted>
Fri, 12 Feb 2021 04:40:31 +0000 (10:10 +0530)
committerpukkandan <redacted>
Fri, 12 Feb 2021 14:59:29 +0000 (20:29 +0530)
* `__real_download` should be false when ffmpeg unavailable and no download
* Mistakes in #70
* `allow_playlist_files` was not correctly pass through

youtube_dlc/YoutubeDL.py
youtube_dlc/__init__.py
youtube_dlc/extractor/brightcove.py
youtube_dlc/extractor/rtbf.py

index 922cf269bc1c177b334b7a66e313f8bcd3044378..7c370efba2116d061f1a958d819e00496d943ede 100644 (file)
@@ -2340,6 +2340,7 @@ def correct_ext(filename):
                     full_filename = correct_ext(full_filename)
                     temp_filename = correct_ext(temp_filename)
                     dl_filename = existing_file(full_filename, temp_filename)
+                    info_dict['__real_download'] = False
                     if dl_filename is None:
                         for f in requested_formats:
                             new_info = dict(info_dict)
@@ -2351,12 +2352,13 @@ def correct_ext(filename):
                                 return
                             downloaded.append(fname)
                             partial_success, real_download = dl(fname, new_info)
+                            info_dict['__real_download'] = info_dict['__real_download'] or real_download
                             success = success and partial_success
                         if merger.available and not self.params.get('allow_unplayable_formats'):
                             info_dict['__postprocessors'].append(merger)
-                        info_dict['__files_to_merge'] = downloaded
-                        # Even if there were no downloads, it is being merged only now
-                        info_dict['__real_download'] = True
+                            info_dict['__files_to_merge'] = downloaded
+                            # Even if there were no downloads, it is being merged only now
+                            info_dict['__real_download'] = True
                 else:
                     # Just a single file
                     dl_filename = existing_file(full_filename, temp_filename)
index 7b2e63fd3cb2553be3f3a895cebd279841b72e97..c681c8edbc4fc6511fdcee41c75ccc3e2b6fee02 100644 (file)
@@ -463,6 +463,7 @@ def report_conflict(arg1, arg2):
         'writedescription': opts.writedescription,
         'writeannotations': opts.writeannotations,
         'writeinfojson': opts.writeinfojson or opts.getcomments,
+        'allow_playlist_files': opts.allow_playlist_files,
         'getcomments': opts.getcomments,
         'writethumbnail': opts.writethumbnail,
         'write_all_thumbnails': opts.write_all_thumbnails,
index 901bfa5851c16d4eeb84a043777260d2b25d5b49..091992ebd3c60fad5fe394bc40624f6c35dafd8d 100644 (file)
@@ -482,7 +482,7 @@ def _parse_brightcove_metadata(self, json_data, video_id, headers={}):
             if not self._downloader.params.get('allow_unplayable_formats') and (container == 'WVM' or source.get('key_systems')):
                 num_drm_sources += 1
                 continue
-            elif ext == 'ism' and self._downloader.params.get('allow_unplayable_formats'):
+            elif ext == 'ism' and not self._downloader.params.get('allow_unplayable_formats'):
                 continue
             elif ext == 'm3u8' or container == 'M2TS':
                 if not src:
index 3c6c656eab65cb236318e16e4038ae23d44a6ea9..2bb0acd5a59f0fb09c3c32736943f4c7f8d248dd 100644 (file)
@@ -125,7 +125,7 @@ def _real_extract(self, url):
                 })
 
         mpd_url = data.get('urlDash')
-        if (not self._downloader.params.get('allow_unplayable_formats') and not data.get('drm')) and mpd_url:
+        if mpd_url and (self._downloader.params.get('allow_unplayable_formats') or not data.get('drm')):
             formats.extend(self._extract_mpd_formats(
                 mpd_url, media_id, mpd_id='dash', fatal=False))