aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-11-05 01:27:01 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-11-05 01:27:01 -0800
commit8784070e75685086b2c1db2973e2082743da6296 (patch)
tree0ebd444140e1bd2103238fe7e463b1abf8949d54
parent2f76eafbd6a7bbecc10c028ef2d47b24129b24d4 (diff)
downloadyt-local-8784070e75685086b2c1db2973e2082743da6296.tar.lz
yt-local-8784070e75685086b2c1db2973e2082743da6296.tar.xz
yt-local-8784070e75685086b2c1db2973e2082743da6296.zip
Server-side handling of local playlist thumbnails (forgot to include in last commit)
-rw-r--r--youtube/youtube.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py
index 925bcab..1a97b6c 100644
--- a/youtube/youtube.py
+++ b/youtube/youtube.py
@@ -48,6 +48,11 @@ def youtube(env, start_response):
start_response('200 OK', (('Content-type','text/html'),) )
return local_playlist.get_playlist_page(path[10:], query_string=query_string).encode()
+ elif path.startswith("/data/playlist_thumbnails/"):
+ with open(path[1:], 'rb') as f:
+ start_response('200 OK', (('Content-type', "image/jpeg"),) )
+ return f.read()
+
elif path.startswith("/api/"):
start_response('200 OK', () )
result = common.fetch_url('https://www.youtube.com' + path + ('?' + query_string if query_string else ''))