daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py
  2. ===================================================================
  3. --- xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py   (wersja 1205)
  4. +++ xbmc-addons/src/plugin.video.polishtv.live/hosts/tvn24.py   (kopia robocza)
  5. @@ -33,6 +33,8 @@
  6.  STATIC_MAGAZINES = [{'id':'FAKTY', 'title':'Fakty', 'icon':'http://www.tvnfakty.pl/assets/images/newsy_2012/nowaczolowka_big.jpg'},
  7.                      {'id':'SPORT', 'title':'Sport', 'icon':''},]
  8.  
  9. +tvn24_quality = ptv.getSetting('tvn24_quality')
  10. +
  11.  class TVN24:
  12.      def __init__(self):
  13.          log.info('Loading ' + SERVICE)
  14. @@ -101,7 +103,14 @@
  15.          data = self.api.getAPI(url)
  16.          for item in data['items']:
  17.              if 'Video_Video' in item['related']:
  18. -                url = item['related']['Video_Video']['url'].replace('https','http')
  19. +                duration = item['related']['Video_Video']['org_duration']
  20. +                url = item['related']['Video_Video']['url']
  21. +                if tvn24_quality == 'Maksymalna':
  22. +                    url = sorted(item['related']['Video_Video']['profiles'], key=lambda x: x['video_bitrate'])[-1]['url']
  23. +                for profile in item['related']['Video_Video']['profiles']:
  24. +                    if profile['quality'] == tvn24_quality:
  25. +                        url = profile['url']
  26. +                url = url.replace('https','http')
  27.                  title = self.common.html_entity_decode(item['title'].encode('UTF-8'))
  28.                  if 'pht_url' in item:
  29.                      icon = item['pht_url'].replace('https','http')
  30. @@ -108,7 +117,7 @@
  31.                  else:
  32.                      icon = THUMB_SERVICE
  33.                  
  34. -                params = {'service': SERVICE, 'url': url, 'category': 'playSelectedVideo', 'title': title, 'icon': icon}
  35. +                params = {'service': SERVICE, 'url': url, 'category': 'playSelectedVideo', 'title': title, 'icon': icon, 'duration': duration}
  36.                  self.gui.addDir(params)
  37.          self.gui.endDir()
  38.  
  39. Index: xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml
  40. ===================================================================
  41. --- xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml   (wersja 1205)
  42. +++ xbmc-addons/src/plugin.video.polishtv.live/resources/settings.xml   (kopia robocza)
  43. @@ -138,4 +138,7 @@
  44.         <setting id="ustream_username" type="text" label="30011" default=""/>
  45.         <setting id="ustream_password" type="text" label="30013" option="hidden" default=""/>
  46.     </category>
  47. +   <category label="TVN24">
  48. +       <setting id="tvn24_quality" type="labelenum" label="30020" values="Maksymalna|Domyślna|720p|480p|360p|240p" default="Maksymalna"/>
  49. +   </category>
  50.  </settings>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top