diff options
Diffstat (limited to 'youtube/youtube.py')
-rw-r--r-- | youtube/youtube.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube/youtube.py b/youtube/youtube.py index 3b0e845..d2bffed 100644 --- a/youtube/youtube.py +++ b/youtube/youtube.py @@ -1,6 +1,6 @@ import mimetypes import urllib.parse -from youtube import local_playlist, watch, search, playlist, channel, comments +from youtube import local_playlist, watch, search, playlist, channel, comments, common YOUTUBE_FILES = ( "/shared.css", "/opensearch.xml", @@ -43,7 +43,9 @@ def youtube(env, start_response): elif path.startswith("/playlists"): start_response('200 OK', (('Content-type','text/html'),) ) return local_playlist.get_playlist_page(path[10:], query_string=query_string).encode() - + elif path.startswith("/api/"): + start_response('200 OK', () ) + return common.fetch_url('https://www.youtube.com' + path + ('?' + query_string if query_string else '')) else: start_response('404 Not Found', () ) return b'404 Not Found' |