From 80de90b1bbccdfc8bc3f8f48b8059125f14f0945 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Fri, 20 Dec 2019 19:23:15 -0800 Subject: Add support for /embed urls --- youtube/watch.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'youtube/watch.py') 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/') +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)) -- cgit v1.2.3