diff options
author | James Taylor <user234683@users.noreply.github.com> | 2018-11-10 00:27:43 -0800 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2018-11-10 00:27:43 -0800 |
commit | 717bf210937c757595624348db9389969be9654f (patch) | |
tree | 7814a81f5c0de1084ab46f3a88b6186798932dfa /youtube/youtube.py | |
parent | 9dd8308cf23de69c741f0304ace102718b844e16 (diff) | |
download | yt-local-717bf210937c757595624348db9389969be9654f.tar.lz yt-local-717bf210937c757595624348db9389969be9654f.tar.xz yt-local-717bf210937c757595624348db9389969be9654f.zip |
Can now store settings&data in ~/.youtube-local, keeping program files separate
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r-- | youtube/youtube.py | 3 |
1 files changed, 2 insertions, 1 deletions
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() |