Add robots.txt

This commit is contained in:
Cadence Ember 2021-04-03 14:00:05 +13:00
parent 0f877b06bc
commit ccd3513c46
No known key found for this signature in database
GPG Key ID: BC1C2C61CF521B17
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
import cherrypy
import json
import pathlib
import requests
import youtube_dlc
from extractors.video import extract_video
@ -129,10 +130,14 @@ class NewLeaf(object):
bind_port = getattr(configuration, "bind_port", 3000)
bind_host = getattr(configuration, "bind_host", "0.0.0.0")
server_root = pathlib.Path(__file__).parent.joinpath("root")
cherrypy.config.update({"server.socket_port": bind_port, "server.socket_host": bind_host})
cherrypy.quickstart(NewLeaf(), "/", {
"/": {
"tools.custom_headers.on": True
"tools.custom_headers.on": True,
"tools.staticdir.on": True,
"tools.staticdir.dir": str(server_root.absolute()),
"tools.staticdir.index": "index.html"
}
})

2
root/robots.txt Normal file
View File

@ -0,0 +1,2 @@
User-Agent: *
Disallow: /