summaryrefslogtreecommitdiff
path: root/plugin.video.spurs-tv
diff options
context:
space:
mode:
authorLS80 <github@lee-smith.me.uk>2017-04-23 22:39:14 +0100
committerLS80 <github@lee-smith.me.uk>2017-04-23 22:46:54 +0100
commit5e6f4fcd5d8819ff36d3825302046d204619c839 (patch)
tree68047c32d2859b3a601c1f0c442b7f0be73a00c4 /plugin.video.spurs-tv
parenta1e11f9d27f446204c1f4d7f2cb38c1185c396a8 (diff)
[plugin.video.spurs-tv] 2.14.0
Diffstat (limited to 'plugin.video.spurs-tv')
-rw-r--r--plugin.video.spurs-tv/addon.py10
-rw-r--r--plugin.video.spurs-tv/addon.xml4
-rw-r--r--plugin.video.spurs-tv/changelog.txt4
-rw-r--r--plugin.video.spurs-tv/icon.pngbin26314 -> 21388 bytes
-rw-r--r--plugin.video.spurs-tv/resources/lib/new_stadium.py13
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 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.spurs-tv" name="Spurs TV" version="2.13.0" provider-name="Leopold">
+<addon id="plugin.video.spurs-tv" name="Spurs TV" version="2.14.0" provider-name="Leopold">
<requires>
<import addon="xbmc.python" version="2.25.0"/>
- <import addon="script.module.xbmcswift2" version="2.4.0" optional="false"/>
+ <import addon="script.module.kodiswift" version="0.0.8" optional="false"/>
<import addon="script.module.beautifulsoup4" version="4.3.1" optional="false"/>
<import addon="script.module.requests" version="2.3.0" optional="false"/>
<import addon="script.module.livestreamer" version="1.12.0" optional="false"/>
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
--- a/plugin.video.spurs-tv/icon.png
+++ b/plugin.video.spurs-tv/icon.png
Binary files 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'])