Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2021
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.28 KB | None | 0 0
  1. diff --git a/resources/lib/client.py b/resources/lib/client.py
  2. index 30ae9e6..670f6dd 100644
  3. --- a/resources/lib/client.py
  4. +++ b/resources/lib/client.py
  5. @@ -25,20 +25,21 @@ class Client:
  6. '$format': 'json'
  7. }
  8.  
  9. - self.STARTUP = self.plugin.api_base + 'v5/Startup'
  10. - self.RAIL = self.plugin.api_base + 'v2/Rail'
  11. - self.RAILS = self.plugin.api_base + 'v7/Rails'
  12. - self.EPG = self.plugin.api_base + 'v1/Epg'
  13. - self.EVENT = self.plugin.api_base + 'v2/Event'
  14. - self.PLAYBACK = self.plugin.api_base + 'v2/Playback'
  15. - self.SIGNIN = self.plugin.api_base + 'v5/SignIn'
  16. - self.SIGNOUT = self.plugin.api_base + 'v1/SignOut'
  17. - self.REFRESH = self.plugin.api_base + 'v5/RefreshAccessToken'
  18. - self.PROFILE = self.plugin.api_base + 'v1/UserProfile'
  19. - self.RESOURCES = self.plugin.api_base + 'v1/ResourceStrings'
  20. + self.STARTUP = self.plugin.api_base['STARTUP'] + 'v5/Startup'
  21. + self.RAIL = self.plugin.api_base['RAIL'] + 'v2/Rail'
  22. + self.RAILS = self.plugin.api_base['RAILS'] + 'v7/Rails'
  23. + self.EPG = self.plugin.api_base['EPG'] + 'v1/Epg'
  24. + self.EVENT = self.plugin.api_base['EVENT'] + 'v2/Event'
  25. + self.PLAYBACK = self.plugin.api_base['PLAYBACK'] + 'v2/Playback'
  26. + self.SIGNIN = self.plugin.api_base['SIGNIN'] + 'v5/SignIn'
  27. + self.SIGNOUT = self.plugin.api_base['SIGNOUT'] + 'v1/SignOut'
  28. + self.REFRESH = self.plugin.api_base['REFRESH'] + 'v5/RefreshAccessToken'
  29. + self.PROFILE = self.plugin.api_base['PROFILE'] + 'v1/UserProfile'
  30. + self.RESOURCES = self.plugin.api_base['RESOURCES'] + 'live/resourcestrings'
  31.  
  32. def content_data(self, url):
  33. data = self.request(url)
  34. +
  35. if data.get('odata.error', None):
  36. self.errorHandler(data)
  37. return data
  38. diff --git a/resources/lib/common.py b/resources/lib/common.py
  39. index 635dd14..bd1cbe4 100644
  40. --- a/resources/lib/common.py
  41. +++ b/resources/lib/common.py
  42. @@ -19,7 +19,20 @@ from inputstreamhelper import Helper
  43. class Common:
  44.  
  45. def __init__(self, addon_handle=None, addon_url=None):
  46. - self.api_base = 'https://isl.dazn.com/misl/'
  47. + self._api_base_default = 'https://isl.dazn.com/misl/'
  48. + self.api_base = {'STARTUP': 'https://startup.core.indazn.com/misl/',
  49. + 'RAIL': 'https://rails.discovery.indazn.com/misl/eu/',
  50. + 'RAILS': 'https://rails.discovery.indazn.com/eu/',
  51. + 'EPG': 'https://epg.discovery.indazn.com/eu/',
  52. + 'EVENT': self._api_base_default,
  53. + 'PLAYBACK': 'https://api.playback.indazn.com/',
  54. + 'SIGNIN': self._api_base_default,
  55. + 'SIGNOUT': self._api_base_default,
  56. + 'REFRESH': self._api_base_default,
  57. + 'PROFILE': self._api_base_default,
  58. + 'RESOURCES': 'https://public-cdn.acc.indazn.com/eu/',
  59. + 'THUMBNAIL': 'https://image.discovery.indazn.com/eu/',
  60. + }
  61. self.time_format = '%Y-%m-%dT%H:%M:%SZ'
  62. self.date_format = '%Y-%m-%d'
  63. self.portability_list = ['AT', 'DE', 'IT', 'ES']
  64. diff --git a/resources/lib/simple_requests/api.py b/resources/lib/simple_requests/api.py
  65. index 7c2f29e..40b70c0 100644
  66. --- a/resources/lib/simple_requests/api.py
  67. +++ b/resources/lib/simple_requests/api.py
  68. @@ -171,4 +171,4 @@ def delete(url, **kwargs):
  69.  
  70.  
  71. def head(url, **kwargs):
  72. - return _request('HEAD', url, **kwargs)
  73. \ No newline at end of file
  74. + return _request('HEAD', url, **kwargs)
  75. diff --git a/resources/lib/tiles.py b/resources/lib/tiles.py
  76. index 4918cf8..2b98763 100644
  77. --- a/resources/lib/tiles.py
  78. +++ b/resources/lib/tiles.py
  79. @@ -38,7 +38,7 @@ class Tiles:
  80. self.item['duration'] = self.plugin.timedelta_total_seconds(self.plugin.time_stamp(self.end)-self.plugin.time_stamp(self.start))
  81.  
  82. def add_thumb(self, i):
  83. - url = self.plugin.api_base+'v2/image?id={0}&Quality=95&Width={1}&Height={2}&ResizeAction=fill&VerticalAlignment=top&Format={3}'
  84. + url = self.plugin.api_base['THUMBNAIL']+'v2/image?id={0}&Quality=95&Width={1}&Height={2}&ResizeAction=fill&VerticalAlignment=top&Format={3}'
  85. image = i.get('Image', '')
  86. if image:
  87. if self.type == 'Navigation':
  88.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement