15.10.2018, 20:29
(Tento příspěvek byl naposledy změněn: 15.10.2018, 20:31 uživatelem ros.
Důvod úpravy: dáno do správného vlákna
)
---------------
ThinkPad T530 : Lubuntu 20.04 + Kodi 19.4
Hodnocení tématu:
Playlist O2TV.CZ addon - verze od Pavuucek
|
Error Type: <type 'exceptions.OSError'>
Error Contents: (1, 'Operation not permitted', '/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.playlist.o2tv/streamer.sh')
Traceback (most recent call last):
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.playlist.o2tv/service.py", line 301, in <module>
_tryExec(_playlist_streamer_)
File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/service.playlist.o2tv/service.py", line 121, in _tryExec
if not (sts.st_mode & stat.S_IEXEC): os.chmod(file, sts.st_mode | stat.S_IEXEC)
OSError: (1, 'Operation not permitted', '/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/userdata/addon_data/service.playlist.o2tv/streamer.sh')
-->End of Python script error report<--
import httplib
import urllib
import json
import requests
_COMMON_HEADERS = { "X-Nangu-App-Version" : "Android#1.2.9",
"X-Nangu-Device-Name" : "Nexus 7",
"User-Agent" : "Dalvik/2.1.0 (Linux; U; Android 5.1.1; Nexus 7 Build/LMY47V)",
"Accept-Encoding": "gzip",
"Connection" : "Keep-Alive" }
headers = _COMMON_HEADERS
headers["Content-Type"] = "application/x-www-form-urlencoded;charset=UTF-8"
data = { 'grant_type' : 'password',
'client_id' : 'tef-web-portal-etnetera',
'client_secret' : '2b16ac9984cd60dd0154f779ef200679',
'username' : 'user',
'password' : 'pass',
'platform_id' : '231a7d6678d00c65f6f3b2aaa699a0d0',
'language' : 'cs'}
req = requests.post('https://oauth.o2tv.cz/oauth/token', data=data, headers=headers, verify=False)
print(req.text)
j = req.json()
if 'error' in j:
print(j)
if 'access_token' in j:
access_token = j['access_token']
print(access_token)
{"result":null,"error":"authentication-failed","statusCode":401}
{u'statusCode': 401, u'result': None, u'error': u'authentication-failed'}
Request Head:
POST /oauth/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 211
Host: oauth.o2tv.cz
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.10.0
Body:
client_id=tef-web-portal-etnetera&client_secret=2b16ac9984cd60dd0154f779ef200679&platform_id=231a7d6678d00c65f6f3b2aaa699a0d0&language=cs&grant_type=password&username=username&password=password
Response Head:
HTTP/1.1 401 Unauthorized
Date: Thu, 18 Oct 2018 20:35:04 GMT
Server: Apache/2.4.10 (Debian)
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET,POST,OPTIONS
Content-Security-Policy: default-src 'self' 'unsafe-inline'
X-Content-Security-Policy: default-src 'self' 'unsafe-inline'
Access-Control-Max-Age: 1728000
P3P: CP="IDC OUR"
X-FRAME-OPTIONS: DENY
Access-Control-Allow-Headers: X-NanguTv-TransactionID,x-nangutv-transactionid
Access-Control-Allow-Origin: http://oauth.o2tv.cz:80
Pragma: No-cache
Cache-Control: no-cache
Cache-Control: no-store
Content-Type: application/json;charset=utf-8
Content-Length: 64
X-Processing-Time: D=23834 t=1539894904910158
X-Cache-Miss: 1
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Body:
{
"result":null,
"error":"authentication-failed",
"statusCode":401
}
def refresh_access_token(self):
_COMMON_HEADERS0 = {
'X-Nangu-Device-Name': self.device_id,
'X-Nangu-App-Version': 'Android',
'User-Agent': 'okhttp/3.10.0',
'Accept-Encoding': 'gzip',
'Connection': 'Keep-Alive',
'Content-Type': 'application/x-www-form-urlencoded',
}
headers0 = _COMMON_HEADERS0
data0 = {'username': self.username,
'password': self.password}
req0 = \
requests.post('https://ottmediator.o2tv.cz:4443/ottmediator-war/login'
, data=data0, headers=headers0, verify=False)
j = req0.json()
service_id = str(j['services'][0]['service_id'])
remote_access_token = str(j['remote_access_token'])
datax = {'service_id': service_id,
'remote_access_token': remote_access_token}
reqx = \
requests.post('https://ottmediator.o2tv.cz:4443/ottmediator-war/loginChoiceService'
, data=datax, headers=headers0, verify=False)
_COMMON_HEADERS1 = \
{'Content-Type': 'application/x-www-form-urlencoded',
'Connection': 'Keep-Alive'}
headers1 = _COMMON_HEADERS1
data1 = {
'client_id': 'tef-web-portal-etnetera',
'client_secret': '2b16ac9984cd60dd0154f779ef200679',
'platform_id': '231a7d6678d00c65f6f3b2aaa699a0d0',
'language': 'cs',
'grant_type': 'remote_access_token',
'remote_access_token': remote_access_token,
'authority': 'tef-sso',
'isp_id': '1',
}
req1 = requests.post('https://oauth.o2tv.cz/oauth/token',
data=data1, headers=headers1, verify=False)
j = req1.json()
self.access_token = j['access_token']
self.expires_in = j['expires_in']
return self.access_token