aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-07-21 22:16:38 -0700
committerJames Taylor <user234683@users.noreply.github.com>2019-07-21 22:16:38 -0700
commit2837d9db2b757b1ca54c4523e2644cee6b3798f2 (patch)
tree7f09d1a1b3ce4fdb5c84544930b771e961b820bf /youtube
parent8eff0bb9e23690bb8a87453a4a6d4d415b9e1a95 (diff)
downloadyt-local-2837d9db2b757b1ca54c4523e2644cee6b3798f2.tar.lz
yt-local-2837d9db2b757b1ca54c4523e2644cee6b3798f2.tar.xz
yt-local-2837d9db2b757b1ca54c4523e2644cee6b3798f2.zip
Convert captioning to flask
Diffstat (limited to 'youtube')
-rw-r--r--youtube/watch.py11
1 files changed, 11 insertions, 0 deletions
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/<path:dummy>')
+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
+
+
+
+