From 5e6f4fcd5d8819ff36d3825302046d204619c839 Mon Sep 17 00:00:00 2001 From: LS80 Date: Sun, 23 Apr 2017 22:39:14 +0100 Subject: [plugin.video.spurs-tv] 2.14.0 --- plugin.video.spurs-tv/addon.py | 10 +++++++--- plugin.video.spurs-tv/addon.xml | 4 ++-- plugin.video.spurs-tv/changelog.txt | 4 ++++ plugin.video.spurs-tv/icon.png | Bin 26314 -> 21388 bytes plugin.video.spurs-tv/resources/lib/new_stadium.py | 13 +++++++------ 5 files changed, 20 insertions(+), 11 deletions(-) diff --git a/plugin.video.spurs-tv/addon.py b/plugin.video.spurs-tv/addon.py index acaa08b..a3f4fca 100644 --- a/plugin.video.spurs-tv/addon.py +++ b/plugin.video.spurs-tv/addon.py @@ -29,7 +29,7 @@ import traceback import json import platform -from xbmcswift2 import Plugin, xbmc, xbmcgui +from kodiswift import Plugin, xbmc, xbmcgui from bs4 import BeautifulSoup import requests import livestreamer @@ -237,8 +237,12 @@ def get_search_result_videos(soup, query): form_data['viewstate'] = get_viewstate(soup) def get_stadium_index(): - for title, entry_id in new_stadium.get_cams(): - yield video_item(entry_id, title) + for title, youtube_id in new_stadium.get_cams(): + yield {'label': title, + 'thumbnail': 'https://i.ytimg.com/vi/{}/sddefault_live.jpg'.format(youtube_id), + 'info': {'title': title}, + 'path': "plugin://plugin.video.youtube/play/?video_id={}".format(youtube_id), + 'is_playable': True} yield {'label': plugin.get_string(30019), 'path': plugin.url_for('show_stadium_video_gallery')} diff --git a/plugin.video.spurs-tv/addon.xml b/plugin.video.spurs-tv/addon.xml index 5ee0f5e..3364f4b 100644 --- a/plugin.video.spurs-tv/addon.xml +++ b/plugin.video.spurs-tv/addon.xml @@ -1,8 +1,8 @@ - + - + diff --git a/plugin.video.spurs-tv/changelog.txt b/plugin.video.spurs-tv/changelog.txt index e1b7c3c..d96dedf 100644 --- a/plugin.video.spurs-tv/changelog.txt +++ b/plugin.video.spurs-tv/changelog.txt @@ -1,3 +1,7 @@ +v2.14.0 (2017-04-23) + - Fixed New Stadium category after new YouTube streams were added + - Update icon again, to match the video logo + v2.13.0 (2017-01-08) - Fixed New Stadium category after new site launch - Fixed error when Live Audio Commentary is offline diff --git a/plugin.video.spurs-tv/icon.png b/plugin.video.spurs-tv/icon.png index 1f37f27..240802a 100644 Binary files a/plugin.video.spurs-tv/icon.png and b/plugin.video.spurs-tv/icon.png differ diff --git a/plugin.video.spurs-tv/resources/lib/new_stadium.py b/plugin.video.spurs-tv/resources/lib/new_stadium.py index 32b4ded..1534417 100644 --- a/plugin.video.spurs-tv/resources/lib/new_stadium.py +++ b/plugin.video.spurs-tv/resources/lib/new_stadium.py @@ -3,9 +3,10 @@ http://new-stadium.tottenhamhotspur.com ''' -from urlparse import urljoin +from urlparse import urljoin, urlparse import json import re +import os from collections import namedtuple from bs4 import BeautifulSoup as BS @@ -15,7 +16,7 @@ URL_ROOT = "http://new-stadium.tottenhamhotspur.com/" RE_EMBED = re.compile(r'kWidget\.embed\((.*)\)') -Video = namedtuple('Video', ['title', 'entry_id']) +Video = namedtuple('Video', ['title', 'id']) def get_soup(path): @@ -27,9 +28,9 @@ def get_soup(path): def get_cams(): '''Generator for live stadium cameras''' soup = get_soup("interact") - div = soup.find('div', {'data-player-id': 'player2'}) - for tab in json.loads(div['data-tabs']): - yield Video(title=tab['title'], entry_id=tab['entryId']) + for stream_num, iframe in enumerate(soup('iframe', 'video-class'), start=1): + yield Video(title='Live Stream {}'.format(stream_num), + id=os.path.basename(urlparse(iframe['src']).path)) def get_video_gallery(): @@ -38,4 +39,4 @@ def get_video_gallery(): for video in soup('div', 'video-new'): video_vars = json.loads(RE_EMBED.search(video.find(text=RE_EMBED)).group(1)) yield Video(title=video.find_next_sibling('p').get_text().strip(), - entry_id=video_vars['entry_id']) + id=video_vars['entry_id']) -- cgit v1.2.3