summaryrefslogtreecommitdiff
path: root/tk_bbl.py
blob: f7ed30f0b101be02627ee72de7173be4710eb22f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import time, mechanize, re, random

browser = mechanize.Browser()
browser.set_handle_robots(False)
browser.set_handle_refresh(False)
browser.addheaders = [('User-agent', 'Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0')]

rand = random.randrange(1000000000,9999999999)
time = int(time.time())
state = str(time) + str(rand);

browser.open("https://www.telekombasketball.de")
browser.open("https://accounts.login.idm.telekom.com/oauth2/auth?response_type=code&client_id=10LIVESAM30000004901BEKOBBL0000000000000&scope=openid&redirect_uri=http:%2F%2Fwww.telekombasketball.de%2Foauth.php%3Frequest%3Dlogin%26headto%3Dhttp:%2F%2Fwww.telekombasketball.de%2F&state="+state+"&claims=%7B%22id_token%22%3A%7B%22urn%3Atelekom.com%3Aall%22%3Anull%7D%7D")

user = ""
password = ""
browser.select_form(name="login")
browser.form['pw_usr'] = user
browser.form['pw_pwd'] = password
browser.submit()

browser.open("https://www.telekombasketball.de/videoplayer/player.php?play=" + str(2731))
response = browser.response().read()
mobileUrl = re.search('mobileUrl: \"(.*?)\"', response).group(1)
print mobileUrl