Fixes #81 on ytsearch
This commit is contained in:
parent
2dbc62c6ff
commit
641724f79f
@ -234,6 +234,12 @@ def ytsearch():
|
|||||||
sort = 0
|
sort = 0
|
||||||
filters = {"time":0, "type":0, "duration":0}
|
filters = {"time":0, "type":0, "duration":0}
|
||||||
results = yts.search_by_terms(searchTerms, page, autocorrect, sort, filters)
|
results = yts.search_by_terms(searchTerms, page, autocorrect, sort, filters)
|
||||||
|
for channel in results['channels']:
|
||||||
|
if config['nginxVideoStream']:
|
||||||
|
channel['thumbnail'] = channel['thumbnail'].replace("~", "/")
|
||||||
|
hostName = urllib.parse.urlparse(channel['thumbnail']).netloc
|
||||||
|
channel['thumbnail'] = channel['thumbnail'].replace("https://{}".format(hostName), "")+"&host="+hostName
|
||||||
|
print(channel['thumbnail'])
|
||||||
return render_template('ytsearch.html', form=form, btform=button_form, results=results, restricted=config['restrictPublicUsage'], config=config)
|
return render_template('ytsearch.html', form=form, btform=button_form, results=results, restricted=config['restrictPublicUsage'], config=config)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -21,7 +21,11 @@
|
|||||||
{% for res in results.channels %}
|
{% for res in results.channels %}
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="image">
|
<div class="image">
|
||||||
<img src="{{ url_for('img', url=res.thumbnail) }}">
|
{% if config.nginxVideoStream %}
|
||||||
|
<img src="{{res.thumbnail}}" alt="Avatar">
|
||||||
|
{% else %}
|
||||||
|
<img alt="Avatar" src="{{ url_for('img', url=res.thumbnail) }}">
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<a class = "header" href="{{ url_for('channel', id=res.channelId)}}">{{res.username}}</a>
|
<a class = "header" href="{{ url_for('channel', id=res.channelId)}}">{{res.username}}</a>
|
||||||
|
Reference in New Issue
Block a user