From 0d0115652d40c0cf9f40a2bd0b2f573f6f1e29b3 Mon Sep 17 00:00:00 2001 From: Ryu18 Date: Sat, 18 Dec 2021 22:46:11 +0100 Subject: [PATCH] add master url to file --- twspace_dl/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/twspace_dl/__main__.py b/twspace_dl/__main__.py index 499340a..7c2fe8b 100644 --- a/twspace_dl/__main__.py +++ b/twspace_dl/__main__.py @@ -45,7 +45,6 @@ def get_args() -> argparse.Namespace: "audio-space/dynamic_playlist.m3u8?type=live" ), ) - input_group.add_argument( "-f", "--from-master-url", @@ -84,6 +83,9 @@ def get_args() -> argparse.Namespace: output_group.add_argument( "-u", "--url", action="store_true", help="display the master url" ) + output_group.add_argument( + "--write-url", type=str, metavar="URL_OUTPUT", help="write master url to file" + ) if len(sys.argv) == 1: parser.print_help(sys.stderr) @@ -129,6 +131,9 @@ def main() -> None: metadata_io.write(metadata) if args.url: print(twspace_dl.master_url) + if args.write_url: + with open(args.write_url, "w", encoding="utf-8") as url_output: + url_output.write(twspace_dl.master_url) if args.write_playlist: twspace_dl.write_playlist()