Fix RaiPlay per Kodi 19
This commit is contained in:
+6
-6
@@ -112,10 +112,10 @@ def search(item, text):
|
|||||||
json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json()
|
json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json()
|
||||||
for key in json:
|
for key in json:
|
||||||
for key in json[key]:
|
for key in json[key]:
|
||||||
if key.has_key('PathID') and (text.lower() in key['name'].lower()):
|
if 'PathID' in key and (text.lower() in key['name'].lower()):
|
||||||
itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type',
|
itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type',
|
||||||
thumbnail = getUrl(key['images']['portrait'] if key['images'].has_key('portrait') else key['images']['portrait43'] if key['images'].has_key('portrait43') else key['images']['landscape']),
|
thumbnail = getUrl(key['images']['portrait'] if 'portrait' in key['images'] else key['images']['portrait43'] if 'portrait43' in key['images'] else key['images']['landscape']),
|
||||||
fanart = getUrl(key['images']['landscape'] if key['images'].has_key('landscape') else key['images']['landscape43'])))
|
fanart = getUrl(key['images']['landscape'] if 'landscape' in key['images'] else key['images']['landscape43'])))
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
@@ -233,7 +233,7 @@ def findvideos(item):
|
|||||||
if item.url.endswith('json'):
|
if item.url.endswith('json'):
|
||||||
json = current_session.get(item.url).json()
|
json = current_session.get(item.url).json()
|
||||||
|
|
||||||
if json.has_key('first_item_path'):
|
if 'first_item_path' in json:
|
||||||
url = current_session.get(getUrl(json['first_item_path'])).json()['video']['content_url']
|
url = current_session.get(getUrl(json['first_item_path'])).json()['video']['content_url']
|
||||||
else:
|
else:
|
||||||
url = json['video']['content_url']
|
url = json['video']['content_url']
|
||||||
@@ -288,9 +288,9 @@ def load_episodes(key, item):
|
|||||||
itemlist=[]
|
itemlist=[]
|
||||||
json = current_session.get(getUrl(key['path_id'])).json()['items']
|
json = current_session.get(getUrl(key['path_id'])).json()['items']
|
||||||
for key in json:
|
for key in json:
|
||||||
ep = support.match(key['subtitle'].encode('utf8'), patron=r'St\s*(\d+)\s*Ep\s*(\d+)').match
|
ep = support.match(key['subtitle'], patron=r'St\s*(\d+)\s*Ep\s*(\d+)').match
|
||||||
if ep:
|
if ep:
|
||||||
title = ep[0] + 'x' + ep[1].zfill(2) + support.re.sub(r'St\s*\d+\s*Ep\s*\d+','',key['subtitle'].encode('utf8'))
|
title = ep[0] + 'x' + ep[1].zfill(2) + support.re.sub(r'St\s*\d+\s*Ep\s*\d+','',key['subtitle'])
|
||||||
else:
|
else:
|
||||||
title = key['subtitle'].strip()
|
title = key['subtitle'].strip()
|
||||||
if not title:
|
if not title:
|
||||||
|
|||||||
+7
-4
@@ -813,12 +813,15 @@ def match(item_url_string, **args):
|
|||||||
# check type of item_url_string
|
# check type of item_url_string
|
||||||
if string:
|
if string:
|
||||||
data = item_url_string
|
data = item_url_string
|
||||||
elif type(item_url_string) == str:
|
elif isinstance(item_url_string, Item):
|
||||||
if item_url_string.startswith('http'): url = item_url_string
|
|
||||||
else : data = item_url_string
|
|
||||||
else:
|
|
||||||
# if item_url_string is an item use item.url as url
|
# if item_url_string is an item use item.url as url
|
||||||
url = item_url_string.url
|
url = item_url_string.url
|
||||||
|
else:
|
||||||
|
if item_url_string.startswith('http'): url = item_url_string
|
||||||
|
else : data = item_url_string
|
||||||
|
# else:
|
||||||
|
# # if item_url_string is an item use item.url as url
|
||||||
|
# url = item_url_string.url
|
||||||
|
|
||||||
# if there is a url, download the page
|
# if there is a url, download the page
|
||||||
if url:
|
if url:
|
||||||
|
|||||||
Reference in New Issue
Block a user