diff options
author | James Taylor <user234683@users.noreply.github.com> | 2018-07-31 17:03:47 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2018-07-31 17:03:47 -0700 |
commit | 1dc2cb0ab6025af4d5e4c705eb0134108c53c024 (patch) | |
tree | 225ac6c05e67e60b78c8a3a700e05a0376f3f87a /youtube/youtube.py | |
parent | dcc3183411e3173c570ceab0b7a5d9534b3b284b (diff) | |
download | yt-local-1dc2cb0ab6025af4d5e4c705eb0134108c53c024.tar.lz yt-local-1dc2cb0ab6025af4d5e4c705eb0134108c53c024.tar.xz yt-local-1dc2cb0ab6025af4d5e4c705eb0134108c53c024.zip |
Return blank page for searching when visiting just localhost/youtube.com
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r-- | youtube/youtube.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py index 93b947f..03956b6 100644 --- a/youtube/youtube.py +++ b/youtube/youtube.py @@ -15,6 +15,9 @@ def youtube(env, start_response): mime_type = mimetypes.guess_type(path)[0] or 'application/octet-stream' start_response('200 OK', (('Content-type',mime_type),) ) return f.read() + elif path.lstrip('/') == "": + start_response('200 OK', (('Content-type','text/html'),) ) + return search.get_search_page(query_string).encode() elif path == "/comments": start_response('200 OK', (('Content-type','text/html'),) ) |