ソースを参照

Make --metadata-from-title non fatal

Output a warning if the metadata can't be parsed from the title (and don't write any metadata) instead of raising a critical error.
nyorain 9 年 前
コミット
5e42f8a0ad
1 ファイル変更2 行追加1 行削除
  1. 2 1
      youtube_dl/postprocessor/metadatafromtitle.py

+ 2 - 1
youtube_dl/postprocessor/metadatafromtitle.py

@@ -38,7 +38,8 @@ class MetadataFromTitlePP(PostProcessor):
         title = info['title']
         match = re.match(self._titleregex, title)
         if match is None:
-            raise MetadataFromTitlePPError('Could not interpret title of video as "%s"' % self._titleformat)
+            self._downloader.to_screen('[fromtitle] Could not interpret title of video as "%s"' % self._titleformat)
+            return [], info
         for attribute, value in match.groupdict().items():
             value = match.group(attribute)
             info[attribute] = value