From df7a62649b60fa00e1909f677c17f43ed9a62080 Mon Sep 17 00:00:00 2001 From: pluja Date: Sun, 23 Aug 2020 17:27:12 +0200 Subject: [PATCH] Update links and filename --- app/models.py | 1 + app/routes.py | 6 ++++-- app/templates/_video_item.html | 2 +- app/templates/video.html | 2 +- app/templates/{invidious.html => youtube.html} | 0 5 files changed, 7 insertions(+), 4 deletions(-) rename app/templates/{invidious.html => youtube.html} (100%) diff --git a/app/models.py b/app/models.py index 5247c2c..62d9cbc 100644 --- a/app/models.py +++ b/app/models.py @@ -96,6 +96,7 @@ class twitterPost(): class ytPost(): channelName = 'Error' channelUrl = '#' + channelId = '@' videoUrl = '#' videoTitle = '#' videoThumb = '#' diff --git a/app/routes.py b/app/routes.py index 9f62e17..1386405 100644 --- a/app/routes.py +++ b/app/routes.py @@ -207,8 +207,8 @@ def youtube(): videos = getYoutubePosts(ids) if videos: videos.sort(key=lambda x: x.date, reverse=True) - print("--- {} seconds fetching invidious feed---".format(time.time() - start_time)) - return render_template('invidious.html', videos=videos) + print("--- {} seconds fetching youtube feed---".format(time.time() - start_time)) + return render_template('youtube.html', videos=videos) @app.route('/ytsearch', methods=['GET', 'POST']) @login_required @@ -311,6 +311,7 @@ def watch(): 'viewCount':data['view_count'], 'author':data['uploader'], 'authorUrl':data['uploader_url'], + 'channelId': data['uploader_id'], 'id':id, 'averageRating': str((float(data['average_rating'])/5)*100) } @@ -523,6 +524,7 @@ def getYoutubePosts(ids): video.date = vid.published_parsed video.timeStamp = getTimeDiff(vid.published_parsed) video.channelName = vid.author_detail.name + video.channelId = vid.yt_channelid video.channelUrl = vid.author_detail.href video.id = vid.yt_videoid video.videoTitle = vid.title diff --git a/app/templates/_video_item.html b/app/templates/_video_item.html index 7eec1d5..abcb958 100644 --- a/app/templates/_video_item.html +++ b/app/templates/_video_item.html @@ -5,7 +5,7 @@
{{video.videoTitle}}
{{video.description}} diff --git a/app/templates/video.html b/app/templates/video.html index 2765c8f..5cb4610 100644 --- a/app/templates/video.html +++ b/app/templates/video.html @@ -20,7 +20,7 @@