diff options
| -rw-r--r-- | app.py | 13 | ||||
| -rw-r--r-- | static/style.css | 9 | ||||
| -rw-r--r-- | templates/nhdl.html | 12 | 
3 files changed, 34 insertions, 0 deletions
| @@ -141,6 +141,19 @@ def serve_image(filename):      else:          flask.abort(404) +@app.route("/nhdl") +def serve_nhdl(): +    with database.Database() as db: +        return flask.render_template( +            "nhdl.html", +            **get_template_items("Hentai Downloader", db) +        ) + +@app.route("/nhdlredirect", methods = ["POST"]) +def redirect_nhdl(): +    if flask.request.form["domain"] == "nhentai": +         +  @app.route("/random")  def serve_random():      try: diff --git a/static/style.css b/static/style.css index 45b9459..be25a8e 100644 --- a/static/style.css +++ b/static/style.css @@ -132,6 +132,15 @@ header img {      max-height: 110px;  } +form #number_input { +    width: 50px; +    margin-left: 10px; +} + +form #url_input { +    margin-left: 10px; +} +  body div div {      padding-left: 10px;      padding-right: 10px; diff --git a/templates/nhdl.html b/templates/nhdl.html new file mode 100644 index 0000000..9b619ef --- /dev/null +++ b/templates/nhdl.html @@ -0,0 +1,12 @@ +{% extends "template.html" %} +{% block content %} +    <form action="/nhdlredirect" method="POST"> +        <input type="radio" name="domain" value="nhentai" id="nhentai"> +        <label for="nhentai">nHentai.net number:</label> +        <input type="text" id="number_input" name="number_input"><br> +        <input type="radio" name="domain" value="other" id="other"> +        <label for="other">Use full URL:</label> +        <input type="text" id="url_input" name="url_input"><br><br> +        <input type="submit" value="Download"> +    </form> +{% endblock %}
\ No newline at end of file | 
