diff options
author | James Taylor <user234683@users.noreply.github.com> | 2018-07-10 01:49:55 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2018-07-10 01:49:55 -0700 |
commit | c7edcff93a165a9e0d9a335f95310d7db54bae96 (patch) | |
tree | 8b2b5200c5e74a0f009d9c6e162552cc8357fdfe /youtube/youtube.py | |
parent | 1134efed496e9bf056948212b24ee85d0cbfdf3b (diff) | |
download | yt-local-c7edcff93a165a9e0d9a335f95310d7db54bae96.tar.lz yt-local-c7edcff93a165a9e0d9a335f95310d7db54bae96.tar.xz yt-local-c7edcff93a165a9e0d9a335f95310d7db54bae96.zip |
add subtitles support
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' |