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"
pull/32648/head
Ethan Muir 6 months ago
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…
Cancel
Save