Skip to content

Commit

Permalink
add master url to file
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryu1845 committed Dec 18, 2021
1 parent a9f4400 commit 0d01156
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion twspace_dl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def get_args() -> argparse.Namespace:
"audio-space/dynamic_playlist.m3u8?type=live"
),
)

input_group.add_argument(
"-f",
"--from-master-url",
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 0d01156

Please sign in to comment.