Added '--xattrs' option which writes metadata to the file's extended attributes using a youtube-dl postprocessor.

Works on Linux, OSX, and Windows.
This commit is contained in:
epitron 2014-01-02 07:47:28 -05:00
parent 1b969041d7
commit e63fc1bed4
4 changed files with 139 additions and 2 deletions

View file

@ -38,6 +38,7 @@ __authors__ = (
'Takuya Tsuchida',
'Sergey M.',
'Michael Orlitzky',
'Chris Gahan',
)
__license__ = 'Public Domain'
@ -78,6 +79,7 @@ from .PostProcessor import (
FFmpegVideoConvertor,
FFmpegExtractAudioPP,
FFmpegEmbedSubtitlePP,
XAttrMetadataPP,
)
@ -412,7 +414,9 @@ def parseOpts(overrideArguments=None):
postproc.add_option('--embed-subs', action='store_true', dest='embedsubtitles', default=False,
help='embed subtitles in the video (only for mp4 videos)')
postproc.add_option('--add-metadata', action='store_true', dest='addmetadata', default=False,
help='add metadata to the files')
help='write metadata to the video file')
postproc.add_option('--xattrs', action='store_true', dest='xattrs', default=False,
help='write metadata to the video file\'s xattrs (using dublin core and xdg standards)')
parser.add_option_group(general)
@ -709,6 +713,8 @@ def _real_main(argv=None):
ydl.add_post_processor(FFmpegVideoConvertor(preferedformat=opts.recodevideo))
if opts.embedsubtitles:
ydl.add_post_processor(FFmpegEmbedSubtitlePP(subtitlesformat=opts.subtitlesformat))
if opts.xattrs:
ydl.add_post_processor(XAttrMetadataPP())
# Update version
if opts.update_self: