diff --git a/addon.xml b/addon.xml index 76df707..20660ba 100644 --- a/addon.xml +++ b/addon.xml @@ -1,7 +1,7 @@ diff --git a/resources/language/resource.language.en_gb/strings.po b/resources/language/resource.language.en_gb/strings.po index 6274d4b..576e7f7 100644 --- a/resources/language/resource.language.en_gb/strings.po +++ b/resources/language/resource.language.en_gb/strings.po @@ -178,6 +178,10 @@ msgctxt "#30041" msgid "Subscription country (two letter code):" msgstr "" +msgctxt "#30042" +msgid "Warn when a title is removed in less than these days:" +msgstr "" + msgctxt "#30050" msgid "Remember username and password" msgstr "" diff --git a/resources/language/resource.language.es_es/strings.po b/resources/language/resource.language.es_es/strings.po index e25eb20..b7ab4fc 100644 --- a/resources/language/resource.language.es_es/strings.po +++ b/resources/language/resource.language.es_es/strings.po @@ -162,6 +162,10 @@ msgctxt "#30041" msgid "Subscription country (two letter code):" msgstr "País de la suscripción (código de dos letras):" +msgctxt "#30042" +msgid "Warn when a title is removed in less than these days:" +msgstr "Avisar cuando se elimine un título en menos de estos días:" + msgctxt "#30050" msgid "Remember username and password" msgstr "Recordar usuario y clave" diff --git a/resources/lib/movistar.py b/resources/lib/movistar.py index d1fea59..2b031fe 100644 --- a/resources/lib/movistar.py +++ b/resources/lib/movistar.py @@ -832,6 +832,7 @@ class Movistar(object): t['subscribed'] = self.is_subscribed_vod(video.get('tvProducts', [])) if not 'UrlVideo' in video: return None t['url'] = video['UrlVideo'] + t['availability'] = {'start': video.get('FechaInicioPublicacion'), 'end': video.get('FechaFinPublicacion')} if video['AssetType'] == 'VOD': t['session_request'] = '{"contentID":' + str(t['id']) + ',"drmMediaID":"' + video['CasId'] +'", "streamType":"AST"}' elif video['AssetType'] == 'U7D': @@ -1011,6 +1012,7 @@ class Movistar(object): if not 'UrlVideo' in video: continue t['subscribed'] = self.is_subscribed_vod(video.get('tvProducts', [])) t['url'] = video['UrlVideo'] + t['availability'] = {'start': video.get('FechaInicioPublicacion'), 'end': video.get('FechaFinPublicacion')} if video['AssetType'] == 'VOD': t['session_request'] = '{"contentID":' + str(t['id']) + ',"drmMediaID":"' + video['CasId'] +'", "streamType":"AST"}' elif video['AssetType'] == 'U7D': diff --git a/resources/lib/plugin.py b/resources/lib/plugin.py index 4f73cd4..e09dfd0 100644 --- a/resources/lib/plugin.py +++ b/resources/lib/plugin.py @@ -286,6 +286,19 @@ def add_videos(category, ctype, videos, ref=None, url_next=None, url_prev=None, if 'subscribed' in t: if addon.getSettingBool('only_subscribed') and t['subscribed'] == False: continue t['info']['title'] = m.colorize_title(t) + + if 'availability' in t: + ends = int(t['availability'].get('end', '0')) + if ends > 0: + now = int(time.time()*1000) + n_hours = int((ends - now) / (1000 * 60 * 60)) + n_days = int(n_hours / 24) + if (n_days <= addon.getSettingInt('expdays')): + if n_days < 1: + t['info']['title'] += ' [COLOR red](' + addon.getLocalizedString(30401).format(n_hours) + ')[/COLOR]' + else: + t['info']['title'] += ' [COLOR red](' + addon.getLocalizedString(30400).format(n_days) + ')[/COLOR]' + title_name = t['info']['title'] if not 'type' in t: continue diff --git a/resources/settings.xml b/resources/settings.xml index 7f9645a..e47fefc 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -5,6 +5,7 @@ +