Fix TuneIn
This commit is contained in:
+8
-3
@@ -1,9 +1,10 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per altadefinizione01
|
# Canale per tunein
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import scrapertools, support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = 'http://api.radiotime.com'
|
host = 'http://api.radiotime.com'
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -32,6 +33,7 @@ def radio(item):
|
|||||||
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
|
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
|
||||||
if data.matches:
|
if data.matches:
|
||||||
for title, location, url, quality, song, type, thumbnail in data.matches:
|
for title, location, url, quality, song, type, thumbnail in data.matches:
|
||||||
|
title = scrapertools.unescape(title)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(title, 'bold') + support.typo(quality + ' kbps','_ [] bold color kod'),
|
item.clone(title = support.typo(title, 'bold') + support.typo(quality + ' kbps','_ [] bold color kod'),
|
||||||
thumbnail = thumbnail,
|
thumbnail = thumbnail,
|
||||||
@@ -43,6 +45,7 @@ def radio(item):
|
|||||||
matches = support.match(data.data, patron= r'text="(?P<title>[^\("]+)(?:\([^\)]+\))?" URL="(?P<url>[^"]+)" (?:guide_id="[^"]+" )?(?:stream_type="[^"]+" )?topic_duration="(?P<duration>[^"]+)" subtext="(?P<plot>[^"]+)" item="[^"]+" image="(?P<thumb>[^"]+)"').matches
|
matches = support.match(data.data, patron= r'text="(?P<title>[^\("]+)(?:\([^\)]+\))?" URL="(?P<url>[^"]+)" (?:guide_id="[^"]+" )?(?:stream_type="[^"]+" )?topic_duration="(?P<duration>[^"]+)" subtext="(?P<plot>[^"]+)" item="[^"]+" image="(?P<thumb>[^"]+)"').matches
|
||||||
if matches:
|
if matches:
|
||||||
for title, url, duration, plot, thumbnail in matches:
|
for title, url, duration, plot, thumbnail in matches:
|
||||||
|
title = scrapertools.unescape(title)
|
||||||
infoLabels={}
|
infoLabels={}
|
||||||
infoLabels['duration'] = duration
|
infoLabels['duration'] = duration
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
@@ -56,12 +59,14 @@ def radio(item):
|
|||||||
else:
|
else:
|
||||||
matches = support.match(data.data, patron= r'text="(?P<title>[^"]+)" URL="(?P<url>[^"]+)"').matches
|
matches = support.match(data.data, patron= r'text="(?P<title>[^"]+)" URL="(?P<url>[^"]+)"').matches
|
||||||
for title, url in matches:
|
for title, url in matches:
|
||||||
|
title = scrapertools.unescape(title)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(channel = item.channel,
|
item.clone(channel = item.channel,
|
||||||
title = support.typo(title, 'bold'),
|
title = support.typo(title, 'bold'),
|
||||||
thumbnail = item.thumbnail,
|
thumbnail = item.thumbnail,
|
||||||
url = url,
|
url = url,
|
||||||
action = 'radio'))
|
action = 'radio'))
|
||||||
|
support.nextPage(itemlist, item, data.data, r'(?P<url>[^"]+)" key="nextStations')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -86,5 +91,5 @@ def search(item, text):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|||||||
Reference in New Issue
Block a user