FINALLY fixed the /info/ endpoint
This commit is contained in:
parent
5c809729fd
commit
713d1d81cf
1 changed files with 6 additions and 2 deletions
|
@ -94,13 +94,17 @@ def twitfix(sub_path):
|
||||||
|
|
||||||
@app.route('/other/<path:sub_path>') # Show all info that Youtube-DL can get about a video as a json
|
@app.route('/other/<path:sub_path>') # Show all info that Youtube-DL can get about a video as a json
|
||||||
def other(sub_path):
|
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
|
return res
|
||||||
|
|
||||||
@app.route('/info/<path:sub_path>') # Show all info that Youtube-DL can get about a video as a json
|
@app.route('/info/<path:sub_path>') # Show all info that Youtube-DL can get about a video as a json
|
||||||
def info(sub_path):
|
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:
|
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
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue