mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-05-29 00:19:32 +00:00
Added the Trim command line arg
When the --trim command line arg is used, the file will download into a different folder called "trimmed_video"
This commit is contained in:
parent
aaed4884ed
commit
6cab71147e
|
@ -1950,6 +1950,10 @@ class YoutubeDL(object):
|
|||
if filename is None:
|
||||
return
|
||||
|
||||
# ETHAN
|
||||
if self.params.get('usetrim', False):
|
||||
filename = "/trimmed_video/" + filename
|
||||
|
||||
def ensure_dir_exists(path):
|
||||
try:
|
||||
dn = os.path.dirname(path)
|
||||
|
|
|
@ -432,6 +432,7 @@ def _real_main(argv=None):
|
|||
'geo_bypass': opts.geo_bypass,
|
||||
'geo_bypass_country': opts.geo_bypass_country,
|
||||
'geo_bypass_ip_block': opts.geo_bypass_ip_block,
|
||||
'usetrim': opts.usetrim,
|
||||
# just for deprecation check
|
||||
'autonumber': opts.autonumber if opts.autonumber is True else None,
|
||||
'usetitle': opts.usetitle if opts.usetitle is True else None,
|
||||
|
|
|
@ -713,6 +713,10 @@ def parseOpts(overrideArguments=None):
|
|||
'-t', '--title',
|
||||
action='store_true', dest='usetitle', default=False,
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
filesystem.add_option(
|
||||
'--trim',
|
||||
action='store_true', dest='usetrim', default=False,
|
||||
help=optparse.SUPPRESS_HELP)
|
||||
filesystem.add_option(
|
||||
'-l', '--literal', default=False,
|
||||
action='store_true', dest='usetitle',
|
||||
|
|
Loading…
Reference in a new issue