mirror of
https://github.com/l1ving/youtube-dl
synced 2025-01-24 00:52:55 +08:00
Add files via upload
This commit is contained in:
parent
785ff4196b
commit
03ba06e3cf
@ -1,7 +1,7 @@
|
|||||||
"""
|
|
||||||
Created on Fri Feb 9 16:23:16 2018
|
|
||||||
"""
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
# Created on Fri Feb 9 16:23:16 2018
|
||||||
|
|
||||||
from .common import PostProcessor
|
from .common import PostProcessor
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -11,7 +11,6 @@ class MetadataFromUserPP(PostProcessor):
|
|||||||
super(MetadataFromUserPP, self).__init__(downloader)
|
super(MetadataFromUserPP, self).__init__(downloader)
|
||||||
self._metadata = metadata
|
self._metadata = metadata
|
||||||
|
|
||||||
|
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
lastpos = 0
|
lastpos = 0
|
||||||
attribute = None
|
attribute = None
|
||||||
@ -33,8 +32,7 @@ class MetadataFromUserPP(PostProcessor):
|
|||||||
# Add the last key
|
# Add the last key
|
||||||
value = self._metadata[lastpos:].strip()
|
value = self._metadata[lastpos:].strip()
|
||||||
self._downloader.to_screen(
|
self._downloader.to_screen(
|
||||||
'[fromuser] %s: %s'
|
'[fromuser] %s: %s' % (attribute, value if value else 'NA'))
|
||||||
%(attribute, value if value else 'NA'))
|
|
||||||
info[attribute] = value
|
info[attribute] = value
|
||||||
|
|
||||||
# If nothing specified for artist, extract from comments/description
|
# If nothing specified for artist, extract from comments/description
|
||||||
@ -42,7 +40,6 @@ class MetadataFromUserPP(PostProcessor):
|
|||||||
artist = re.findall('music(?![ia]).*$', info['description'], re.MULTILINE | re.IGNORECASE)
|
artist = re.findall('music(?![ia]).*$', info['description'], re.MULTILINE | re.IGNORECASE)
|
||||||
artist = artist + re.findall('sing.*$', info['description'], re.MULTILINE | re.IGNORECASE)
|
artist = artist + re.findall('sing.*$', info['description'], re.MULTILINE | re.IGNORECASE)
|
||||||
artist = ', '.join(artist).title().strip()
|
artist = ', '.join(artist).title().strip()
|
||||||
|
|
||||||
self._downloader.to_screen(
|
self._downloader.to_screen(
|
||||||
'[artist] : %s : parsed from description' % (artist if artist else 'NA'))
|
'[artist] : %s : parsed from description' % (artist if artist else 'NA'))
|
||||||
info['artist'] = artist
|
info['artist'] = artist
|
||||||
|
Loading…
Reference in New Issue
Block a user