From 713d1d81cfce154dc4a7bcefc271b23d2854e4a5 Mon Sep 17 00:00:00 2001 From: Robin Universe Date: Thu, 2 Dec 2021 20:14:01 -0600 Subject: [PATCH] FINALLY fixed the /info/ endpoint --- twitfix.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/twitfix.py b/twitfix.py index ff3bfff..d5dc42f 100644 --- a/twitfix.py +++ b/twitfix.py @@ -94,13 +94,17 @@ def twitfix(sub_path): @app.route('/other/') # Show all info that Youtube-DL can get about a video as a json def other(sub_path): - res = embed_video(sub_path) + otherurl = request.url.split("/other/", 1)[1].replace(":/","://") + print("[ OTHER ] Other URL embed attempted: " + otherurl) + res = embed_video(otherurl) return res @app.route('/info/') # Show all info that Youtube-DL can get about a video as a json def info(sub_path): + infourl = request.url.split("/info/", 1)[1].replace(":/","://") + print("[ INFO ] Info data requested: " + infourl) with youtube_dl.YoutubeDL({'outtmpl': '%(id)s.%(ext)s'}) as ydl: - result = ydl.extract_info(sub_path, download=False) + result = ydl.extract_info(infourl, download=False) return result