mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-26 03:44:56 +08:00
add 404 with redirect countdown
This commit is contained in:
11
web/404.html
vendored
11
web/404.html
vendored
@@ -1,5 +1,5 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||||
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap" rel="stylesheet">
|
||||||
@@ -29,13 +29,20 @@
|
|||||||
width: 75%;
|
width: 75%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>人人影视下载分享 404</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="centered">
|
<div class="centered">
|
||||||
<h1>404 Not Found</h1>
|
<h1>404 Not Found</h1>
|
||||||
<h2>Oh dang! We couldn't find that page.</h2>
|
<h2>你访问的页面不存在,将会在三秒钟内跳转回首页哦!</h2>
|
||||||
<img id="ferris" alt="a sad crab is unable to unable to lasso a paper airplane. 404 not found."
|
<img id="ferris" alt="a sad crab is unable to unable to lasso a paper airplane. 404 not found."
|
||||||
src="img/404-wrangler-ferris.gif">
|
src="img/404-wrangler-ferris.gif">
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
<script>
|
||||||
|
setTimeout(function () {
|
||||||
|
window.location.href = '/';
|
||||||
|
}, 3000);
|
||||||
|
</script>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -386,6 +386,11 @@ class BlacklistHandler(BaseHandler):
|
|||||||
self.write(resp)
|
self.write(resp)
|
||||||
|
|
||||||
|
|
||||||
|
class NotFoundHandler(BaseHandler):
|
||||||
|
def prepare(self): # for all methods
|
||||||
|
self.render("404.html")
|
||||||
|
|
||||||
|
|
||||||
class RunServer:
|
class RunServer:
|
||||||
root_path = os.path.dirname(__file__)
|
root_path = os.path.dirname(__file__)
|
||||||
static_path = os.path.join(root_path, '')
|
static_path = os.path.join(root_path, '')
|
||||||
@@ -403,7 +408,7 @@ class RunServer:
|
|||||||
{'path': static_path}),
|
{'path': static_path}),
|
||||||
]
|
]
|
||||||
|
|
||||||
application = web.Application(handlers, xheaders=True)
|
application = web.Application(handlers, xheaders=True, default_handler_class=NotFoundHandler)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def run_server(port, host, **kwargs):
|
def run_server(port, host, **kwargs):
|
||||||
|
|||||||
Reference in New Issue
Block a user