diff --git a/app/routes.py b/app/routes.py
index 1d37866..e8de468 100644
--- a/app/routes.py
+++ b/app/routes.py
@@ -18,6 +18,7 @@ import random, string
import time, datetime
import feedparser
import requests
+import bleach
import urllib
import json
import re
@@ -312,7 +313,7 @@ def watch():
video = {
'title':data['title'],
- 'description':Markup(data['description']),
+ 'description':Markup(markupString(data['description'])),
'viewCount':data['view_count'],
'author':data['uploader'],
'authorUrl':data['uploader_url'],
@@ -320,8 +321,18 @@ def watch():
'id':id,
'averageRating': str((float(data['average_rating'])/5)*100)
}
+ print(video['description'])
return render_template("video.html", video=video)
+def markupString(string):
+ string = string.replace("\n\n", "
").replace("\n", "
")
+ string = bleach.linkify(string)
+ string = string.replace("https://youtube.com/", "")
+ string = string.replace("https://www.youtube.com/", "")
+ string = string.replace("https://twitter.com/", "/u/")
+ print(request.url)
+ return string
+
## PROXY videos through Parasitter server to the client.
@app.route('/stream', methods=['GET', 'POST'])
@login_required
@@ -636,7 +647,7 @@ def getYoutubePosts(ids):
if time.days >= 15:
continue
-
+
video = ytPost()
video.date = vid.published_parsed
video.timeStamp = getTimeDiff(vid.published_parsed)
diff --git a/app/templates/_empty_feed.html b/app/templates/_empty_feed.html
index fef5e9c..365eb0e 100644
--- a/app/templates/_empty_feed.html
+++ b/app/templates/_empty_feed.html
@@ -1,6 +1,6 @@
-
-
- -+
+ +{{ form.submit() }}
-