From dcfd34444273ab627726ba2bbe08b276da1d5d69 Mon Sep 17 00:00:00 2001
From: Julian Rother <julianr@fsmpi.rwth-aachen.de>
Date: Sun, 4 Nov 2018 17:46:20 +0100
Subject: [PATCH] Display streaming servers when generating a new stream key
 (quite hacky, should be refactored!)

---
 config.py.example | 2 ++
 livestreams.py    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/config.py.example b/config.py.example
index bbbed17..767ec61 100644
--- a/config.py.example
+++ b/config.py.example
@@ -38,3 +38,5 @@ MAIL_FROM = 'Video AG-Website <videoag-it@lists.fsmpi.rwth-aachen.de>'
 MAIL_SUFFIX = 'fsmpi.rwth-aachen.de'
 MAIL_DEFAULT = 'Video AG <videoag@fsmpi.rwth-aachen.de>'
 MAIL_ADMINS = 'videoag-it@lists.fsmpi.rwth-aachen.de'
+STREAMING_SERVER = 'rtmp://video-web-0.fsmpi.rwth-aachen.de/src/'
+BACKUP_STREAMING_SERVER = 'rtmp://video-web-1.fsmpi.rwth-aachen.de/src/'
diff --git a/livestreams.py b/livestreams.py
index fd1a6ea..ed2b76f 100644
--- a/livestreams.py
+++ b/livestreams.py
@@ -98,7 +98,7 @@ def gentoken():
 def streamrekey(id):
 	modify('UPDATE live_sources SET `key` = ? WHERE id = ? AND NOT deleted', gentoken(), id)
 	source = query('SELECT * FROM live_sources WHERE NOT deleted AND id = ?', id)[0]
-	flash('Der Streamkey von <strong>'+source['name']+'</strong> wurde neu generiert: <span><input readonly type="text" style="width: 15em" value="'+source['key']+'"></span>')
+	flash('Der Streamkey von <strong>'+source['name']+'</strong> wurde neu generiert: <span><input readonly type="text" style="width: 15em" value="'+source['key']+'"></span><br>Trage diesen Streamkey zusammen mit einem der folgenden Streamingserver in die Streamingsoftware ein:<ul><li>'+config['STREAMING_SERVER']+'</li><li>'+config['BACKUP_STREAMING_SERVER']+'</li></ul>Insgesamt sollte die Streaming-URL z.B. so aussehen: <a href="'+config['STREAMING_SERVER']+source['key']+'">'+config['STREAMING_SERVER']+source['key']+'</a>')
 	return redirect(url_for('streaming'))
 
 @app.route('/internal/streaming/drop/<int:id>')
-- 
GitLab