Browse Source

[postprocessor/metadatafromtitle] Fix missing optional meta fields (closes #13408)

tags/2017.06.18
Sergey M․ 7 years ago
parent
commit
be80986ed9
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      youtube_dl/postprocessor/metadatafromtitle.py

+ 6
- 3
youtube_dl/postprocessor/metadatafromtitle.py View File

@@ -35,11 +35,14 @@ class MetadataFromTitlePP(PostProcessor):
title = info['title']
match = re.match(self._titleregex, title)
if match is None:
self._downloader.to_screen('[fromtitle] 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
self._downloader.to_screen('[fromtitle] parsed ' + attribute + ': ' + value)
self._downloader.to_screen(
'[fromtitle] parsed %s: %s'
% (attribute, value if value is not None else 'NA'))

return [], info

Loading…
Cancel
Save