From 717bf210937c757595624348db9389969be9654f Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sat, 10 Nov 2018 00:27:43 -0800 Subject: Can now store settings&data in ~/.youtube-local, keeping program files separate --- youtube/youtube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'youtube/youtube.py') diff --git a/youtube/youtube.py b/youtube/youtube.py index 1a97b6c..5451254 100644 --- a/youtube/youtube.py +++ b/youtube/youtube.py @@ -1,5 +1,6 @@ import mimetypes import urllib.parse +import os from youtube import local_playlist, watch, search, playlist, channel, comments, common, account_functions import settings YOUTUBE_FILES = ( @@ -49,7 +50,7 @@ def youtube(env, start_response): 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: + with open(os.path.join(settings.data_dir, os.path.normpath(path[6:])), 'rb') as f: start_response('200 OK', (('Content-type', "image/jpeg"),) ) return f.read() -- cgit v1.2.3