Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py
- ===================================================================
- --- xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py (wersja 1205)
- +++ xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py (kopia robocza)
- @@ -33,6 +33,8 @@
- STATIC_MAGAZINES = [{'id':'FAKTY', 'title':'Fakty', 'icon':'http://www.tvnfakty.pl/assets/images/newsy_2012/nowaczolowka_big.jpg'},
- {'id':'SPORT', 'title':'Sport', 'icon':''},]
- +tvn24_quality = ptv.getSetting('tvn24_quality')
- +
- class TVN24:
- def __init__(self):
- log.info('Loading ' + SERVICE)
- @@ -101,7 +103,14 @@
- data = self.api.getAPI(url)
- for item in data['items']:
- if 'Video_Video' in item['related']:
- - url = item['related']['Video_Video']['url'].replace('https','http')
- + duration = item['related']['Video_Video']['org_duration']
- + url = item['related']['Video_Video']['url']
- + if tvn24_quality == 'Maksymalna':
- + url = sorted(item['related']['Video_Video']['profiles'], key=lambda x: x['video_bitrate'])[-1]['url']
- + for profile in item['related']['Video_Video']['profiles']:
- + if profile['quality'] == tvn24_quality:
- + url = profile['url']
- + url = url.replace('https','http')
- title = self.common.html_entity_decode(item['title'].encode('UTF-8'))
- if 'pht_url' in item:
- icon = item['pht_url'].replace('https','http')
- @@ -108,7 +117,7 @@
- else:
- icon = THUMB_SERVICE
- - params = {'service': SERVICE, 'url': url, 'category': 'playSelectedVideo', 'title': title, 'icon': icon}
- + params = {'service': SERVICE, 'url': url, 'category': 'playSelectedVideo', 'title': title, 'icon': icon, 'duration': duration}
- self.gui.addDir(params)
- self.gui.endDir()
- Index: xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml
- ===================================================================
- --- xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml (wersja 1205)
- +++ xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml (kopia robocza)
- @@ -138,4 +138,7 @@
- <setting id="ustream_username" type="text" label="30011" default=""/>
- <setting id="ustream_password" type="text" label="30013" option="hidden" default=""/>
- </category>
- + <category label="TVN24">
- + <setting id="tvn24_quality" type="labelenum" label="30020" values="Maksymalna|Domyślna|720p|480p|360p|240p" default="Maksymalna"/>
- + </category>
- </settings>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement