From c7edcff93a165a9e0d9a335f95310d7db54bae96 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 10 Jul 2018 01:49:55 -0700 Subject: add subtitles support --- youtube/youtube.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'youtube/youtube.py') 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' -- cgit v1.2.3