Proxy images through nginx v1
This commit is contained in:
parent
23a2809e0b
commit
d2dfbbdb5f
@ -775,7 +775,11 @@ def getYoutubePosts(ids):
|
||||
video.channelUrl = vid.author_detail.href
|
||||
video.id = vid.yt_videoid
|
||||
video.videoTitle = vid.title
|
||||
video.videoThumb = vid.media_thumbnail[0]['url'].replace('/', '~')
|
||||
if config['nginxVideoStream']:
|
||||
hostName = urllib.parse.urlparse(vid.media_thumbnail[0]['url']).netloc
|
||||
video.videoThumb = vid.media_thumbnail[0]['url'].replace(hostName, config['serverName'])+"?hostname="+hostName
|
||||
else:
|
||||
video.videoThumb = vid.media_thumbnail[0]['url'].replace('/', '~')
|
||||
video.views = vid.media_statistics['views']
|
||||
video.description = vid.summary_detail.value
|
||||
video.description = re.sub(r'^https?:\/\/.*[\r\n]*', '', video.description[0:120]+"...", flags=re.MULTILINE)
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 59 KiB |
@ -1,6 +1,10 @@
|
||||
<div class="card">
|
||||
<div class="image">
|
||||
{%if config.nginxVideoStream%}
|
||||
<img alt="Thumbnail" src="{{video.videoThumb}}">
|
||||
{%else%}
|
||||
<img alt="Thumbnail" src="/img/{{video.videoThumb.replace('/', '~')}}">
|
||||
{%endif%}
|
||||
</div>
|
||||
<div class="content">
|
||||
{% if video.views == "Livestream" %}
|
||||
|
Reference in New Issue
Block a user