@@ -146,7 +146,12 @@
|
|||||||
--mtime NAME Set file modification times according to
|
--mtime NAME Set file modification times according to
|
||||||
metadata selected by NAME. Examples: 'date' or
|
metadata selected by NAME. Examples: 'date' or
|
||||||
'status[date]'
|
'status[date]'
|
||||||
--ugoira FORMAT Convert Pixiv Ugoira to FORMAT using FFmpeg.
|
--rename FORMAT Rename previously downloaded files from FORMAT
|
||||||
|
to the current filename format
|
||||||
|
--rename-to FORMAT Rename previously downloaded files from the
|
||||||
|
current filename format to FORMAT (disables
|
||||||
|
downloads)
|
||||||
|
--ugoira FMT Convert Pixiv Ugoira to FMT using FFmpeg.
|
||||||
Supported formats are 'webm', 'mp4', 'gif',
|
Supported formats are 'webm', 'mp4', 'gif',
|
||||||
'vp8', 'vp9', 'vp9-lossless', 'copy'.
|
'vp8', 'vp9', 'vp9-lossless', 'copy'.
|
||||||
--exec CMD Execute CMD for each downloaded file. Supported
|
--exec CMD Execute CMD for each downloaded file. Supported
|
||||||
|
|||||||
@@ -74,6 +74,22 @@ class MtimeAction(argparse.Action):
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
class RenameAction(argparse.Action):
|
||||||
|
"""Configure rename post processors"""
|
||||||
|
def __call__(self, parser, namespace, value, option_string=None):
|
||||||
|
if self.const:
|
||||||
|
namespace.options.append(((), "download", False))
|
||||||
|
namespace.postprocessors.append({
|
||||||
|
"name": "rename",
|
||||||
|
"to" : value,
|
||||||
|
})
|
||||||
|
else:
|
||||||
|
namespace.postprocessors.append({
|
||||||
|
"name": "rename",
|
||||||
|
"from": value,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
class UgoiraAction(argparse.Action):
|
class UgoiraAction(argparse.Action):
|
||||||
"""Configure ugoira post processors"""
|
"""Configure ugoira post processors"""
|
||||||
def __call__(self, parser, namespace, value, option_string=None):
|
def __call__(self, parser, namespace, value, option_string=None):
|
||||||
@@ -661,10 +677,22 @@ def build_parser():
|
|||||||
const="date|status[date]",
|
const="date|status[date]",
|
||||||
help=argparse.SUPPRESS,
|
help=argparse.SUPPRESS,
|
||||||
)
|
)
|
||||||
|
postprocessor.add_argument(
|
||||||
|
"--rename",
|
||||||
|
dest="postprocessors", metavar="FORMAT", action=RenameAction, const=0,
|
||||||
|
help=("Rename previously downloaded files from FORMAT "
|
||||||
|
"to the current filename format"),
|
||||||
|
)
|
||||||
|
postprocessor.add_argument(
|
||||||
|
"--rename-to",
|
||||||
|
dest="postprocessors", metavar="FORMAT", action=RenameAction, const=1,
|
||||||
|
help=("Rename previously downloaded files from the current filename "
|
||||||
|
"format to FORMAT (disables downloads)"),
|
||||||
|
)
|
||||||
postprocessor.add_argument(
|
postprocessor.add_argument(
|
||||||
"--ugoira",
|
"--ugoira",
|
||||||
dest="postprocessors", metavar="FORMAT", action=UgoiraAction,
|
dest="postprocessors", metavar="FMT", action=UgoiraAction,
|
||||||
help=("Convert Pixiv Ugoira to FORMAT using FFmpeg. "
|
help=("Convert Pixiv Ugoira to FMT using FFmpeg. "
|
||||||
"Supported formats are 'webm', 'mp4', 'gif', "
|
"Supported formats are 'webm', 'mp4', 'gif', "
|
||||||
"'vp8', 'vp9', 'vp9-lossless', 'copy'."),
|
"'vp8', 'vp9', 'vp9-lossless', 'copy'."),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user