]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/YoutubeDL.py
[cleanup, docs] Minor fixes
[yt-dlp.git] / yt_dlp / YoutubeDL.py
index aa7905fc762bcb196988ead8674ebe00a367a002..71369bc44c3a3558ef24c1f8b9de59328c1a7a15 100644 (file)
@@ -1637,7 +1637,7 @@ def iter_playlistitems(format):
 
         ie_entries = ie_result['entries']
         if isinstance(ie_entries, list):
-            playlist_count = len(ie_result)
+            playlist_count = len(ie_entries)
             msg = f'Collected {playlist_count} videos; downloading %d of them'
             ie_result['playlist_count'] = ie_result.get('playlist_count') or playlist_count
 
@@ -2392,15 +2392,15 @@ def sanitize_numeric_fields(info):
         if not self.params.get('allow_unplayable_formats'):
             formats = [f for f in formats if not f.get('has_drm')]
 
+        # backward compatibility
+        info_dict['fulltitle'] = info_dict['title']
+
         if info_dict.get('is_live'):
             get_from_start = bool(self.params.get('live_from_start'))
             formats = [f for f in formats if bool(f.get('is_from_start')) == get_from_start]
             if not get_from_start:
                 info_dict['title'] += ' ' + datetime.datetime.now().strftime('%Y-%m-%d %H:%M')
 
-        # backward compatibility
-        info_dict['fulltitle'] = info_dict['title']
-
         if not formats:
             self.raise_no_formats(info_dict)