CC-3224: "On-the-fly" stream rebroadcasting
- web interface - auth script for liquidsoap - DB changes
This commit is contained in:
parent
701ed82f40
commit
48bb19d758
26 changed files with 650 additions and 101 deletions
|
@ -21,6 +21,7 @@ from urlparse import urlparse
|
|||
import base64
|
||||
from configobj import ConfigObj
|
||||
import string
|
||||
import hashlib
|
||||
|
||||
AIRTIME_VERSION = "2.1.0"
|
||||
|
||||
|
@ -363,6 +364,28 @@ class AirTimeApiClient(ApiClientInterface):
|
|||
time.sleep(retries_wait)
|
||||
|
||||
return response
|
||||
|
||||
def check_live_stream_auth(self, username, password):
|
||||
#logger = logging.getLogger()
|
||||
response = ''
|
||||
try:
|
||||
url = "http://%s:%s/%s/%s" % (self.config["base_url"], str(self.config["base_port"]), self.config["api_base"], self.config["check_live_stream_auth"])
|
||||
|
||||
url = url.replace("%%api_key%%", self.config["api_key"])
|
||||
url = url.replace("%%username%%", username)
|
||||
url = url.replace("%%password%%", hashlib.md5(password).hexdigest())
|
||||
|
||||
req = urllib2.Request(url)
|
||||
response = urllib2.urlopen(req).read()
|
||||
response = json.loads(response)
|
||||
except Exception, e:
|
||||
import traceback
|
||||
top = traceback.format_exc()
|
||||
print "Exception: %s", e
|
||||
print "traceback: %s", top
|
||||
response = None
|
||||
|
||||
return response
|
||||
|
||||
def setup_media_monitor(self):
|
||||
logger = self.logger
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue