aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/watch.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2019-12-20 19:23:15 -0800
committerJames Taylor <user234683@users.noreply.github.com>2019-12-20 19:23:15 -0800
commit80de90b1bbccdfc8bc3f8f48b8059125f14f0945 (patch)
tree7bb1ee6f46a30672dcd95aec45509ff88344fcba /youtube/watch.py
parent310585ae9e1482709f0a35fbaba3548bafb4581f (diff)
downloadyt-local-80de90b1bbccdfc8bc3f8f48b8059125f14f0945.tar.lz
yt-local-80de90b1bbccdfc8bc3f8f48b8059125f14f0945.tar.xz
yt-local-80de90b1bbccdfc8bc3f8f48b8059125f14f0945.zip
Add support for /embed urls
Diffstat (limited to 'youtube/watch.py')
-rw-r--r--youtube/watch.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/youtube/watch.py b/youtube/watch.py
index 429f272..75ee7e9 100644
--- a/youtube/watch.py
+++ b/youtube/watch.py
@@ -272,8 +272,9 @@ def format_bytes(bytes):
@yt_app.route('/watch')
-def get_watch_page():
- video_id = request.args['v']
+@yt_app.route('/embed/<video_id>')
+def get_watch_page(video_id=None):
+ video_id = request.args.get('v') or video_id
if len(video_id) < 11:
flask.abort(404)
flask.abort(flask.Response('Incomplete video id (too short): ' + video_id))