Add /channel/<id> route and build header
This commit is contained in:
parent
7c78ab8d96
commit
93f71a8ea8
@ -285,6 +285,16 @@ def ytunfollow(channelId):
|
|||||||
flash("There was an error unfollowing the user. Try again.")
|
flash("There was an error unfollowing the user. Try again.")
|
||||||
return redirect(url_for('ytsearch'))
|
return redirect(url_for('ytsearch'))
|
||||||
|
|
||||||
|
@app.route('/channel/<id>', methods=['GET'])
|
||||||
|
@login_required
|
||||||
|
def channel(id):
|
||||||
|
data = requests.get('https://www.youtube.com/feeds/videos.xml?channel_id={id}'.format(id=id))
|
||||||
|
data = feedparser.parse(data.content)
|
||||||
|
|
||||||
|
channel = YoutubeSearch.channelInfo(id)
|
||||||
|
|
||||||
|
return render_template('channel.html', channel=channel)
|
||||||
|
|
||||||
@app.route('/watch', methods=['GET'])
|
@app.route('/watch', methods=['GET'])
|
||||||
@login_required
|
@login_required
|
||||||
def watch():
|
def watch():
|
||||||
|
36
app/templates/channel.html
Normal file
36
app/templates/channel.html
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="blue ui centered card">
|
||||||
|
<div class="content">
|
||||||
|
<div class="center aligned author">
|
||||||
|
<img class="ui avatar image" src="{{channel.avatar}}">
|
||||||
|
</div>
|
||||||
|
<div style="margin: .1em" class="center aligned header"><a href="">{{channel.name}}</a></div>
|
||||||
|
<div class="center aligned description">
|
||||||
|
<a>
|
||||||
|
<i class="users icon"></i>
|
||||||
|
{{channel.subCount}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="extra content">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui one column grid" id="card-container">
|
||||||
|
|
||||||
|
<!--{% if not posts %}
|
||||||
|
{% include '_empty_feed.html' %}
|
||||||
|
{% else %}
|
||||||
|
{% for post in posts %}
|
||||||
|
{% if post.isRT %}
|
||||||
|
{% include '_post.html' %}
|
||||||
|
{% else %}
|
||||||
|
{% include '_post_nort.html' %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}-->
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Reference in New Issue
Block a user