Update links and filename
This commit is contained in:
parent
a0ccc2aa4c
commit
df7a62649b
@ -96,6 +96,7 @@ class twitterPost():
|
|||||||
class ytPost():
|
class ytPost():
|
||||||
channelName = 'Error'
|
channelName = 'Error'
|
||||||
channelUrl = '#'
|
channelUrl = '#'
|
||||||
|
channelId = '@'
|
||||||
videoUrl = '#'
|
videoUrl = '#'
|
||||||
videoTitle = '#'
|
videoTitle = '#'
|
||||||
videoThumb = '#'
|
videoThumb = '#'
|
||||||
|
@ -207,8 +207,8 @@ def youtube():
|
|||||||
videos = getYoutubePosts(ids)
|
videos = getYoutubePosts(ids)
|
||||||
if videos:
|
if videos:
|
||||||
videos.sort(key=lambda x: x.date, reverse=True)
|
videos.sort(key=lambda x: x.date, reverse=True)
|
||||||
print("--- {} seconds fetching invidious feed---".format(time.time() - start_time))
|
print("--- {} seconds fetching youtube feed---".format(time.time() - start_time))
|
||||||
return render_template('invidious.html', videos=videos)
|
return render_template('youtube.html', videos=videos)
|
||||||
|
|
||||||
@app.route('/ytsearch', methods=['GET', 'POST'])
|
@app.route('/ytsearch', methods=['GET', 'POST'])
|
||||||
@login_required
|
@login_required
|
||||||
@ -311,6 +311,7 @@ def watch():
|
|||||||
'viewCount':data['view_count'],
|
'viewCount':data['view_count'],
|
||||||
'author':data['uploader'],
|
'author':data['uploader'],
|
||||||
'authorUrl':data['uploader_url'],
|
'authorUrl':data['uploader_url'],
|
||||||
|
'channelId': data['uploader_id'],
|
||||||
'id':id,
|
'id':id,
|
||||||
'averageRating': str((float(data['average_rating'])/5)*100)
|
'averageRating': str((float(data['average_rating'])/5)*100)
|
||||||
}
|
}
|
||||||
@ -523,6 +524,7 @@ def getYoutubePosts(ids):
|
|||||||
video.date = vid.published_parsed
|
video.date = vid.published_parsed
|
||||||
video.timeStamp = getTimeDiff(vid.published_parsed)
|
video.timeStamp = getTimeDiff(vid.published_parsed)
|
||||||
video.channelName = vid.author_detail.name
|
video.channelName = vid.author_detail.name
|
||||||
|
video.channelId = vid.yt_channelid
|
||||||
video.channelUrl = vid.author_detail.href
|
video.channelUrl = vid.author_detail.href
|
||||||
video.id = vid.yt_videoid
|
video.id = vid.yt_videoid
|
||||||
video.videoTitle = vid.title
|
video.videoTitle = vid.title
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<a class="video-title" href="{{url_for('watch', v=video.id, _method='GET')}}">{{video.videoTitle}}</a>
|
<a class="video-title" href="{{url_for('watch', v=video.id, _method='GET')}}">{{video.videoTitle}}</a>
|
||||||
<div class="meta">
|
<div class="meta">
|
||||||
<a href="{{video.channelUrl}}">{{video.channelName}}</a>
|
<a href="{{url_for('channel', id=video.channelId)}}">{{video.channelName}}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
{{video.description}}
|
{{video.description}}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<div style="margin-top: 2em;" class="ui center aligned grid">
|
<div style="margin-top: 2em;" class="ui center aligned grid">
|
||||||
<div class="two wide column">
|
<div class="two wide column">
|
||||||
<a target="_blank" href="{{video.authorUrl}}" class="ui label">
|
<a target="_blank" href="{{ url_for('channel', id=video.channelId)}}" class="ui label">
|
||||||
{%if video.author.__len__() > 8%}
|
{%if video.author.__len__() > 8%}
|
||||||
<i class="user icon"></i> {{video.author[0:10]+'...'}}
|
<i class="user icon"></i> {{video.author[0:10]+'...'}}
|
||||||
{%else%}
|
{%else%}
|
||||||
|
Reference in New Issue
Block a user