Version 0.8.13
This commit is contained in:
1 parent
3791ef3ac4
commit
5aa3ce449b
4 files changed
+15
-12
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.movistarplus"
|
<addon id="plugin.video.movistarplus"
|
||||||
name="Movistar+"
|
name="Movistar+"
|
||||||
version="0.8.12"
|
version="0.8.13"
|
||||||
provider-name="Paco8">
|
provider-name="Paco8">
|
||||||
<requires>
|
<requires>
|
||||||
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
|
<!--- <import addon="xbmc.python" version="2.25.0"/> -->
|
||||||
|
|||||||
@@ -460,7 +460,7 @@ class Movistar(object):
|
|||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
date = today.strftime('%Y-%m-%dT00:00:00')
|
date = today.strftime('%Y-%m-%dT00:00:00')
|
||||||
ch_data = self.load_epg_data(date, duration, channels)
|
ch_data = self.load_epg_data(date, duration, channels)
|
||||||
if not ch_data: return []
|
if not ch_data or 'error' in ch_data: return {}
|
||||||
data = []
|
data = []
|
||||||
data.append(ch_data)
|
data.append(ch_data)
|
||||||
else:
|
else:
|
||||||
@@ -1025,9 +1025,9 @@ class Movistar(object):
|
|||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def epg_to_movies(self, channel_id, date=None):
|
def epg_to_movies(self, channel_id, date=None, duration=2):
|
||||||
LOG('epg_to_movies: {} {}'.format(channel_id, date))
|
LOG('epg_to_movies: {} {}'.format(channel_id, date))
|
||||||
epg = self.get_epg(channels=channel_id, date=date)
|
epg = self.get_epg(channels=channel_id, date=date, duration=duration)
|
||||||
res = []
|
res = []
|
||||||
if not channel_id in epg: return res
|
if not channel_id in epg: return res
|
||||||
for p in epg[channel_id]:
|
for p in epg[channel_id]:
|
||||||
|
|||||||
@@ -421,15 +421,16 @@ def list_profiles(params):
|
|||||||
def list_epg(params):
|
def list_epg(params):
|
||||||
LOG('list_epg: {}'.format(params))
|
LOG('list_epg: {}'.format(params))
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
from .timeconv import my_strftime
|
||||||
if 'id' in params:
|
if 'id' in params:
|
||||||
if not 'date' in params:
|
if not 'date' in params:
|
||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
for i in range(7, 1, -1):
|
for i in range(6, 0, -1):
|
||||||
past_date = today - timedelta(days=i)
|
past_date = today - timedelta(days=i)
|
||||||
date = past_date.strftime('%Y-%m-%dT00:00:00')
|
date = past_date.strftime('%Y-%m-%dT00:00:00')
|
||||||
display_str = past_date.strftime('%a %d/%m').capitalize()
|
display_str = my_strftime(past_date, '%a %d')
|
||||||
add_menu_option(display_str, get_url(action='epg', id=params['id'], name=params['name'], date=date))
|
add_menu_option(display_str, get_url(action='epg', id=params['id'], name=params['name'], date=date))
|
||||||
add_videos(params['name'], 'movies', m.epg_to_movies(params['id'], params.get('date')))
|
add_videos(params['name'], 'movies', m.epg_to_movies(params['id'], params.get('date'), duration=1))
|
||||||
else:
|
else:
|
||||||
channels = m.get_channels()
|
channels = m.get_channels()
|
||||||
open_folder(addon.getLocalizedString(30107)) # EPG
|
open_folder(addon.getLocalizedString(30107)) # EPG
|
||||||
|
|||||||
@@ -9,14 +9,16 @@ from datetime import datetime
|
|||||||
import pytz
|
import pytz
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
|
||||||
weekdays = ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab']
|
def my_strftime(time, format):
|
||||||
|
weekdays = ['Dom', 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'Sab']
|
||||||
def timestamp2str(timestamp, format='%H:%M'):
|
|
||||||
time = datetime.fromtimestamp(timestamp / 1000)
|
|
||||||
if '%a' in format:
|
if '%a' in format:
|
||||||
w = int(time.strftime('%w'))
|
w = int(time.strftime('%w'))
|
||||||
format = format.replace('%a', weekdays[w])
|
format = format.replace('%a', weekdays[w])
|
||||||
return time.strftime(format).capitalize()
|
return time.strftime(format)
|
||||||
|
|
||||||
|
def timestamp2str(timestamp, format='%H:%M'):
|
||||||
|
time = datetime.fromtimestamp(timestamp / 1000)
|
||||||
|
return my_strftime(time, format)
|
||||||
|
|
||||||
def isodate2date(date_string):
|
def isodate2date(date_string):
|
||||||
date_object = parser.parse(date_string)
|
date_object = parser.parse(date_string)
|
||||||
|
|||||||
Reference in new issue
Block a user