Fix issue with video playing

This commit is contained in:
pluja 2020-08-17 11:18:00 +02:00
parent 661520b689
commit c9e7d64ef0

View File

@ -290,7 +290,7 @@ def ytunfollow(channelId):
def watch():
id = request.args.get('v', None)
ydl = YoutubeDL()
data = ydl.extract_info("{id}".format(id=id), download=False, quiet=True)
data = ydl.extract_info("{id}".format(id=id), download=False)
if data['formats'][-1]['url'].find("manifest.googlevideo") > 0:
flash("Livestreams are not yet supported!")
return redirect(url_for('youtube'))
@ -313,7 +313,7 @@ def stream():
id = request.args.get('v', None)
if(id):
ydl = YoutubeDL()
data = ydl.extract_info("{id}".format(id=id), download=False, quiet=True)
data = ydl.extract_info("{id}".format(id=id), download=False)
req = requests.get(data['formats'][-1]['url'], stream = True)
return Response(stream_with_context(req.iter_content(chunk_size=1024)), content_type = req.headers['content-type'])
else: