#! python3

import requests, os
from lxml import html
from urllib.parse import urljoin

from comic import Comic

supported_comics = {
    "xkcd": ("http://xkcd.com/1/", "//a[@rel='next']/@href", "//div[@id='comic']//img/@src")
}

misc = ["quit/exit: Leaves the program", "custom: User-defined comic"]

while True:
    user_input = input("Which comic do you want to download?\n")

    if user_input.upper() == "HELP":
        # Print all of the comics supported and gives a link to their website
        comics_header = "\n_Comic_ \n"
        comics_content = ["{}: {}".format(key, value[0]) for key, value in supported_comics.items()]
        misc_header = "\n_Misc_ \n"

        print(comics_header + "\n".join(comics_content))
        print(misc_header + "\n".join(misc) + "\n")

    elif user_input in list(supported_comics.keys()):
        comic = Comic(*supported_comics[user_input])
        comic.download()
        break

    elif user_input.upper() in ["QUIT", "EXIT"]:
        break

    else:
        print("This command does not exist. Use HELP for a list of available choices.\n")

@@ -918,24 +918,611 @@
      break%0A%0A
+    elif user_input.upper() == %22CUSTOM%22:%0A        first_url = input(%22URL of the first image of the comic: %22)%0A        next_page_xpath = input(%22XPath selector giving the link to the next page: %22)%0A        image_xpath = input(%22XPath selector giving the link of the image: %22)%0A        comic = Comic(first_url, next_page_xpath, image_xpath)%0A        confirmation = input(%22Are you sure you want to proceed?(y/n) %22)%0A        if confirmation.upper() in %5B%22YES%22, %22Y%22%5D:%0A            comic.download()%0A        elif confirmation.upper() in %5B%22NO%22, %22N%22%5D:%0A            continue%0A        else:%0A            break%0A%0A
     elif use

Implement the User-defined comic logic