diff --git a/app/routes.py b/app/routes.py index aa17784..58763b1 100644 --- a/app/routes.py +++ b/app/routes.py @@ -329,11 +329,10 @@ def stream(): ydl = YoutubeDL() data = ydl.extract_info("{id}".format(id=id), download=False) req = requests.get(data['formats'][-1]['url'], stream = True) - return Response(req.iter_content(chunk_size=10*1024), content_type = req.headers['Content-Type']) + return Response(req.iter_content(chunk_size=10*1024), mimetype=req.headers['Content-Type'], direct_passthrough=True, content_type=req.headers['Content-Type']) else: flash("Something went wrong loading the video... Try again.") return redirect(url_for('youtube')) - ######################### #### General Logic ###### ######################### diff --git a/app/templates/video.html b/app/templates/video.html index 5cb4610..14505b6 100644 --- a/app/templates/video.html +++ b/app/templates/video.html @@ -3,51 +3,45 @@ {% extends "base.html" %} {% block content %} -
+
-
-
-

{{video.title}}

-
- -
- -
-
- {{video.viewCount}} +
+
+

{{video.title}}

-
-
-
-
+
+ +
+

{{video.viewCount}}

+
+
+ {% if video.averageRating | int > 49 %} +

{{video.averageRating[0:4]}}%

+ {% else %} +

{{video.averageRating[0:4]}}%

+ {% endif %} +
-
Rating: {{video.averageRating[0:4]}}%
-
-
- - -
-
-

Description

- {{video.description}} -
+
+

{{video.description}}

+
+
{% endblock %} \ No newline at end of file