153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
"typ": e["format"][6:],
"eintragen": "eintragen", # form
}
# just push data in, like the form does
if form:
self.login()
http.ajax(self.api + "c_neu.jsp", submit)
# use JSON interface
else:
http.ajax(self.api + "commonadd.json?" + urllib.urlencode(submit))
# authenticate against MyOggRadio
def login(self):
login = self.user_pw()
if login:
data = dict(zip(["benutzer", "passwort"], login))
http.ajax(self.api + "c_login.jsp", data)
# let's hope the JSESSIONID cookie is kept
# returns login (user,pw)
def user_pw(self):
if conf.myoggradio_login != "user:password":
return conf.myoggradio_login.split(":")
else: pass
|
|
|
|
|
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
|
"typ": e["format"][6:],
"eintragen": "eintragen", # form
}
# just push data in, like the form does
if form:
self.login()
http.get(self.api + "c_neu.jsp", params=submit, ajax=1, post=1)
# use JSON interface
else:
http.get(self.api + "commonadd.json", params=submit, ajax=1)
# authenticate against MyOggRadio
def login(self):
login = self.user_pw()
if login:
data = dict(zip(["benutzer", "passwort"], login))
http.get(self.api + "c_login.jsp", params=data, ajax=1)
# let's hope the JSESSIONID cookie is kept
# returns login (user,pw)
def user_pw(self):
if conf.myoggradio_login != "user:password":
return conf.myoggradio_login.split(":")
else: pass
|