From 2837d9db2b757b1ca54c4523e2644cee6b3798f2 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Sun, 21 Jul 2019 22:16:38 -0700 Subject: Convert captioning to flask --- youtube/watch.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'youtube/watch.py') diff --git a/youtube/watch.py b/youtube/watch.py index 3b71e75..e324115 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -214,3 +214,14 @@ def get_watch_page(): description = info['description'], unlisted = info['unlisted'], ) + + +@yt_app.route('/api/') +def get_captions(dummy): + result = util.fetch_url('https://www.youtube.com' + request.full_path) + result = result.replace(b"align:start position:0%", b"") + return result + + + + -- cgit v1.2.3