From 93f71a8ea815659f9bbf2d7c71626c77566bd3a0 Mon Sep 17 00:00:00 2001 From: pluja Date: Sun, 23 Aug 2020 10:20:33 +0200 Subject: [PATCH] Add /channel/ route and build header --- app/routes.py | 10 ++++++++++ app/templates/channel.html | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 app/templates/channel.html diff --git a/app/routes.py b/app/routes.py index 7a49458..6082a35 100644 --- a/app/routes.py +++ b/app/routes.py @@ -285,6 +285,16 @@ def ytunfollow(channelId): flash("There was an error unfollowing the user. Try again.") return redirect(url_for('ytsearch')) +@app.route('/channel/', 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']) @login_required def watch(): diff --git a/app/templates/channel.html b/app/templates/channel.html new file mode 100644 index 0000000..1ca1271 --- /dev/null +++ b/app/templates/channel.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} + +{% block content %} + + + +
+ + +
+{% endblock %} \ No newline at end of file