Initial commit
Signed-off-by: hidden service <hiddenservice@airmail.cc>
This commit is contained in:
30
m2t/__main__.py
Normal file
30
m2t/__main__.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from argparse import ArgumentParser
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from . import magnet2torrent
|
||||
|
||||
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s - %(levelname)s - %(name)s - %(message)s",
|
||||
level=logging.INFO,
|
||||
)
|
||||
|
||||
|
||||
parser = ArgumentParser(description="Create a torrent file from a magnet link.")
|
||||
parser.add_argument(
|
||||
"MAGNET",
|
||||
help="The magnet link itself.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-o",
|
||||
"--out",
|
||||
help="The path to write the file to. May be a directory.",
|
||||
default=".",
|
||||
type=Path,
|
||||
required=False,
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
magnet2torrent(args.MAGNET, args.out)
|
||||
Reference in New Issue
Block a user