37 lines
1.1 KiB
Python
37 lines
1.1 KiB
Python
import argparse
|
|
|
|
|
|
def main():
|
|
"""Read the arguments from the command line and initialize commands."""
|
|
parser = argparse.ArgumentParser()
|
|
|
|
parser.add_argument("domain", help="The domain of the webcomic you want to fetch")
|
|
parser.add_argument(
|
|
"--output", default="result", help="The directory where the comic is stored"
|
|
)
|
|
|
|
parser.add_argument(
|
|
"--img", default=None, help="html 'id' tag of the comic's img element(s)"
|
|
)
|
|
parser.add_argument(
|
|
"--first", default=None, help="html 'id' tag of the 'first comic' button"
|
|
)
|
|
parser.add_argument(
|
|
"--next", default=None, help="html 'id' tag of the 'next comic' button"
|
|
)
|
|
|
|
parser.add_argument("--limit", default=None, help="Maximum of images to download")
|
|
parser.add_argument(
|
|
"--start", default=None, help="At which page to start with downloading"
|
|
)
|
|
parser.add_argument(
|
|
"--end", default=None, help="At which page to stop with downloading"
|
|
)
|
|
|
|
args = parser.parse_args()
|
|
print(f"Fetching {args.domain}...")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|