Commit 90341942 authored by TheTechRobo's avatar TheTechRobo
Browse files

Properly handle when an invalid id is passed in the noscript version

parent 21f5efa4
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -79,10 +79,18 @@ async def noscript_load():
    if not request.args.get("d"):
        return "No d param provided - It should be the video id or url", 400
    id = coerce_to_id(request.args['d'])
    if not id:
        return """
        <!DOCTYPE html>
        <html><body style="text-align:center;align-items:center;">
          <p style="color:red">Could not parse your input as a video ID or URL.<br />Your input was:<br /><code>%s</code></p>
          <br />IF the video ID or URL is valid, please file an issue on github!
        </body></html>
        """ % request.args['d'], 400
    response = Response("""
    <!DOCTYPE html>
    <html>
    <head><meta http-equiv="refresh" content="0; url=/noscript_load_thing.html?id=%s" />
    <head><meta http-equiv="refresh" content="0; url=/noscript_load_thing.html?id=%s" /></head>
    <body>
    <img src="/static/ab79a231234507.564a1d23814ef.gif" width="25" height="25" />Loading could take up to 45 seconds.</img>
    </body>
+1 −1
Original line number Diff line number Diff line
@@ -187,7 +187,7 @@ button[disabled] {
          let newVid = coerceToVid(vid);
          console.log(newVid);
          if (!newVid) {
            document.getElementById("data").innerHTML = `<span style="color:red;">That doesn't look like a valid video ID.</span>`;
                  document.getElementById("data").innerHTML = `<span style="color:red;">That doesn't look like a valid video ID.<br />If it is valid, please report the bug on github!</span>`;
            document.getElementById("but").disabled = false;
            document.getElementById("but").innerHTML = "Search for Captures";
            return false;