Browse Source

[InfoExtractor] Fix merging subtitles to empty target

dirkf 5 months ago
parent
commit
67dbfa65f2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      youtube_dl/extractor/common.py

+ 5 - 1
youtube_dl/extractor/common.py

@@ -3295,7 +3295,11 @@ class InfoExtractor(object):
         """ Merge subtitle dictionaries, language by language. """
         """ Merge subtitle dictionaries, language by language. """
 
 
         # ..., * , target=None
         # ..., * , target=None
-        target = kwargs.get('target') or dict(subtitle_dict1)
+        target = kwargs.get('target')
+        if target is None:
+            target = dict(subtitle_dict1)
+        else:
+            subtitle_dicts = (subtitle_dict1,) + subtitle_dicts
 
 
         for subtitle_dict in subtitle_dicts:
         for subtitle_dict in subtitle_dicts:
             for lang in subtitle_dict:
             for lang in subtitle_dict: