Skip to content

Commit

Permalink
Added legacy api support stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
enyone committed Jan 30, 2016
1 parent 43a8d63 commit 9529d3f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion elisaviihde.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class elisaviihde:
# Init vars
verbose = False
baseurl = "https://elisaviihde.fi"
legacyurl = "http://api.elisaviihde.fi"
ssobaseurl = "https://id.elisa.fi"
session = None
authcode = None
Expand Down Expand Up @@ -218,7 +219,7 @@ def getstreamuri(self, programid=0):
for line in uridata.text.split("\n"):
if "recording-player" in line:
return re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', line)[0]

def markwatched(self, programid=0):
# Mark recording as watched
if self.verbose: print("Marking as watched...")
Expand All @@ -227,4 +228,13 @@ def markwatched(self, programid=0):
headers={"X-Requested-With": "XMLHttpRequest"},
verify=self.verifycerts)
self.checkrequest(watched.status_code)

def login_legacy(self, username, password):
# Handle login to legacy api
raise Exception("Not implemented")

def getlegacyuri(self, programid=0):
# Parse recording stream uri for program
self.checklogged()
return "%s/etvrecorder/program.sl?programid=%s&ajax" % (self.legacyurl, programid)

0 comments on commit 9529d3f

Please sign in to comment.