aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/YoutubeDL.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-01-24 21:01:17 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-01-24 21:04:38 +0530
commitfc08bdd6ab2abb92d7814d035b34c15cb7006597 (patch)
tree33995d727ece9655bd189ece183c11d6129214ac /yt_dlp/YoutubeDL.py
parent2568d41f70d656bb5429463d49bce88a50871b1f (diff)
downloadhypervideo-pre-fc08bdd6ab2abb92d7814d035b34c15cb7006597.tar.lz
hypervideo-pre-fc08bdd6ab2abb92d7814d035b34c15cb7006597.tar.xz
hypervideo-pre-fc08bdd6ab2abb92d7814d035b34c15cb7006597.zip
[extractor] Allow non-fatal `title` extraction
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r--yt_dlp/YoutubeDL.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py
index 4af77cae2..24843c775 100644
--- a/yt_dlp/YoutubeDL.py
+++ b/yt_dlp/YoutubeDL.py
@@ -2299,10 +2299,15 @@ class YoutubeDL(object):
self._num_videos += 1
if 'id' not in info_dict:
- raise ExtractorError('Missing "id" field in extractor result')
+ raise ExtractorError('Missing "id" field in extractor result', ie=info_dict['extractor'])
+ elif not info_dict.get('id'):
+ raise ExtractorError('Extractor failed to obtain "id"', ie=info_dict['extractor'])
if 'title' not in info_dict:
raise ExtractorError('Missing "title" field in extractor result',
video_id=info_dict['id'], ie=info_dict['extractor'])
+ elif not info_dict.get('title'):
+ self.report_warning('Extractor failed to obtain "title". Creating a generic title instead')
+ info_dict['title'] = f'{info_dict["extractor"]} video #{info_dict["id"]}'
def report_force_conversion(field, field_not, conversion):
self.report_warning(