aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/postprocessor
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-05-14 00:03:15 +0700
committerSergey M․ <dstftw@gmail.com>2017-05-14 00:03:15 +0700
commitfa26734e0760549b7b727017106e9d649bb695ff (patch)
treecafcf88ea865a3bb417fa815a7516a71a40fa105 /youtube_dl/postprocessor
parent12f01118b0bd621e3e3df813a774fa0a9c1cfd73 (diff)
[postprocessor/metadatafromtitle] Add support regex syntax for --metadata-from-title (closes #13065)
Diffstat (limited to 'youtube_dl/postprocessor')
-rw-r--r--youtube_dl/postprocessor/metadatafromtitle.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/postprocessor/metadatafromtitle.py b/youtube_dl/postprocessor/metadatafromtitle.py
index a7d637a3c..c73f02447 100644
--- a/youtube_dl/postprocessor/metadatafromtitle.py
+++ b/youtube_dl/postprocessor/metadatafromtitle.py
@@ -9,7 +9,9 @@ class MetadataFromTitlePP(PostProcessor):
def __init__(self, downloader, titleformat):
super(MetadataFromTitlePP, self).__init__(downloader)
self._titleformat = titleformat
- self._titleregex = self.format_to_regex(titleformat)
+ self._titleregex = (self.format_to_regex(titleformat)
+ if re.search(r'%\(\w+\)s', titleformat)
+ else titleformat)
def format_to_regex(self, fmt):
r"""