The branch, eden has been updated
via dfb0ca712238d2833dcbeea84b2d52dc74f3c755 (commit)
from db606eb9d8b4c294d2829546e4c24e97d5431d45 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=dfb0ca712238d2833dcbeea84b2d52dc74f3c755
commit dfb0ca712238d2833dcbeea84b2d52dc74f3c755
Author: spiff <[email protected]>
Date: Sat May 19 15:03:56 2012 +0200
[plugin.video.aljazeera] updated to version 0.9.2
diff --git a/plugin.video.aljazeera/README.md b/plugin.video.aljazeera/README.md
index b3c40d1..dc8c7c5 100644
--- a/plugin.video.aljazeera/README.md
+++ b/plugin.video.aljazeera/README.md
@@ -1,6 +1,6 @@
Al Jazeera Addon for XBMC
========================
-version 0.9.0
+version 0.9.2
### Summary ###
This is a plugin for [XBMC](http://xbmc.org) that enables watching videos and
diff --git a/plugin.video.aljazeera/addon.py b/plugin.video.aljazeera/addon.py
index cca2c5b..36ac67e 100755
--- a/plugin.video.aljazeera/addon.py
+++ b/plugin.video.aljazeera/addon.py
@@ -14,10 +14,9 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from xbmcswift import Plugin, download_page
+from xbmcswift import Plugin, download_page, xbmc, xbmcgui
from xbmcswift.ext.playlist import playlist
-from resources.lib.getflashvideo import get_flashvideo_url, YouTube
-from BeautifulSoup import BeautifulSoup as BS, SoupStrainer as SS
+from BeautifulSoup import BeautifulSoup as BS
from urllib import urlencode
from urlparse import urljoin
import re
@@ -25,19 +24,26 @@ try:
import json
except ImportError:
import simplejson as json
-from xbmcswift import xbmc, xbmcgui
-__plugin__ = 'AlJazeera'
-__plugin_id__ = 'plugin.video.aljazeera'
-plugin = Plugin(__plugin__, __plugin_id__, __file__)
+PLUGIN_NAME = 'AlJazeera'
+PLUGIN_ID = 'plugin.video.aljazeera'
+
+plugin = Plugin(PLUGIN_NAME, PLUGIN_ID, __file__)
plugin.register_module(playlist, url_prefix='/_playlist')
+
BASE_URL = 'http://english.aljazeera.net'
def full_url(path):
return urljoin(BASE_URL, path)
+
+YOUTUBE_PTN = 'plugin://plugin.video.youtube/?action=play_video&videoid=%s'
+def youtube_url(videoid):
+ return YOUTUBE_PTN % (videoid)
+
+
def parse_queryvideo_args(s):
'''Parses a QueryVideos javascript call (string) and returns a 4 tuple.
@@ -51,6 +57,7 @@ def parse_queryvideo_args(s):
count, list_id, start_index, method = m.group(1).split(',')
return count, list_id.strip("'"), start_index, method
+
def parse_video(video):
'''Returns a dict of information for a given json video object.'''
info = {
@@ -69,6 +76,7 @@ def parse_video(video):
#info['published'] = video['published']['$t']
return info
+
def get_videos(count, list_id, start_index):
'''Returns a tuple of (videos, total_videos) where videos is a list of
dicts containing video information and total_videos is the toal number
@@ -96,39 +104,48 @@ def get_videos(count, list_id, start_index):
return video_infos, total_results
-#### Plugin Views ####
-
-# Default View
@plugin.route('/', default=True)
def show_homepage():
items = [
# Watch Live
- {'label': plugin.get_string(30100), 'url':
plugin.url_for('watch_live')},
+ {'label': plugin.get_string(30100),
+ 'url': plugin.url_for('watch_live')},
# News Clips
- {'label': plugin.get_string(30101), 'url':
plugin.url_for('show_clip_categories')},
+ {'label': plugin.get_string(30101),
+ 'url': plugin.url_for('show_clip_categories')},
# Programs
- {'label': plugin.get_string(30102), 'url':
plugin.url_for('show_program_categories')},
+ {'label': plugin.get_string(30102),
+ 'url': plugin.url_for('show_program_categories')},
]
return plugin.add_items(items)
+
@plugin.route('/live/')
def watch_live():
rtmpurl =
'rtmp://aljazeeraflashlivefs.fplive.net:1935/aljazeeraflashlive-live/aljazeera_english_1
live=true'
li = xbmcgui.ListItem('AlJazeera Live')
xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(rtmpurl, li)
- # Return an empty list so we can test with plugin.crawl() and
plugin.interactive()
+ # Return an empty list so we can test with plugin.crawl() and
+ # plugin.interactive()
return []
+
def only_clip_categories(s):
return s.find("SelectProgInfo('Selected');") > -1
+
def only_program_categories(s):
return not only_clip_categories(s)
[email protected]('/categories/clips/', onclick_func=only_clip_categories,
name='show_clip_categories', clips=True)
[email protected]('/categories/programs/', name='show_program_categories',
onclick_func=only_program_categories)
+
[email protected]('/categories/clips/', onclick_func=only_clip_categories,
+ name='show_clip_categories', clips=True)
[email protected]('/categories/programs/', name='show_program_categories',
+ onclick_func=only_program_categories)
def show_categories3(onclick_func, clips=False):
- '''Shows categories available for either Clips or Programs on the
aljazeera video page.'''
+ '''Shows categories available for either Clips or Programs on the aljazeera
+ video page.
+ '''
url = full_url('video')
src = download_page(url)
# Fix shitty HTML so BeautifulSoup doesn't break
@@ -142,7 +159,8 @@ def show_categories3(onclick_func, clips=False):
items = []
- # The first link for the 'Clips' section links directly to a video so we
must handle it differently.
+ # The first link for the 'Clips' section links directly to a video so we
+ # must handle it differently.
if clips:
videos, total_results = get_videos('1', 'vod', '1')
video = videos[0]
@@ -150,7 +168,7 @@ def show_categories3(onclick_func, clips=False):
'label': video['title'],
'thumbnail': video['thumbnail'],
'info': {'plot': video['summary'], },
- 'url': plugin.url_for('watch_video', videoid=video['videoid']),
+ 'url': youtube_url(video['videoid']),
'is_folder': False,
'is_playable': True,
})
@@ -160,22 +178,25 @@ def show_categories3(onclick_func, clips=False):
count, list_id, start_index, method =
parse_queryvideo_args(td['onclick'])
items.append({
'label': td.string,
- 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
start_index=start_index),
+ 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
+ start_index=start_index),
})
return plugin.add_items(items)
+
@plugin.route('/videos/<list_id>/<start_index>/<count>/')
def show_videos(list_id, start_index, count):
- '''List videos available for a given category. Only 13 videos are
displayed at a time.
- If there are older or newwer videos, appropriate list items will be placed
at the top of
- the list.'''
+ '''List videos available for a given category. Only 13 videos are displayed
+ at a time. If there are older or newwer videos, appropriate list items will
+ be placed at the top of the list.
+ '''
videos, total_results = get_videos(count, list_id, start_index)
items = [{
'label': video['title'],
'thumbnail': video['thumbnail'],
'info': {'plot': video['summary'], },
- 'url': plugin.url_for('watch_video', videoid=video['videoid']),
+ 'url': youtube_url(video['videoid']),
'is_folder': False,
'is_playable': True,
'context_menu': [(
@@ -183,34 +204,31 @@ def show_videos(list_id, start_index, count):
plugin.get_string(30300),
'XBMC.RunPlugin(%s)' % plugin.url_for(
'playlist.add_to_playlist',
- url=plugin.url_for('watch_video', videoid=video['videoid']),
+ url=youtube_url(video['videoid']),
label=video['title']
)
)],
} for video in videos]
- # MOAR VIDEOS
- # Add '> Older' and '< Newer' list items if the list spans more than 1
page (e.g. > 13 videos)
+ # Add '> Older' and '< Newer' list items if the list spans more than 1 page
+ # (e.g. > 13 videos)
if int(start_index) + int(count) < int(total_results):
items.insert(0, {
# Older videos
'label': u'%s »' % plugin.get_string(30200),
- 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
start_index=str(int(start_index) + int(count))),
+ 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
+ start_index=str(int(start_index) +
int(count))),
})
if int(start_index) > 1:
items.insert(0, {
# Newer videos
'label': u'« %s' % plugin.get_string(30201),
- 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
start_index=str(int(start_index) - int(count))),
+ 'url': plugin.url_for('show_videos', count=count, list_id=list_id,
+ start_index=str(int(start_index) -
int(count))),
})
return plugin.add_items(items)
[email protected]('/watch/<videoid>/')
-def watch_video(videoid):
- url = YouTube.get_flashvideo_url(videoid=videoid)
- return plugin.set_resolved_url(url)
-
if __name__ == '__main__':
plugin.run()
diff --git a/plugin.video.aljazeera/addon.xml b/plugin.video.aljazeera/addon.xml
index c3afacf..87d476a 100644
--- a/plugin.video.aljazeera/addon.xml
+++ b/plugin.video.aljazeera/addon.xml
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.aljazeera" name="Al Jazeera" version="0.9.0"
provider-name="Jonathan Beluch (jbel)">
+<addon id="plugin.video.aljazeera" name="Al Jazeera" version="0.9.2"
provider-name="Jonathan Beluch (jbel)">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.beautifulsoup" version="3.0.8"/>
<import addon="script.module.simplejson" version="2.0.10"/>
<import addon="script.module.xbmcswift" version="0.2.0"/>
+ <import addon="plugin.video.youtube" version="2.9.2"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
</extension>
<extension point="xbmc.addon.metadata">
+ <language>en</language>
<platform>all</platform>
- <summary>Watch videos and the live stream from Al Jazeera
English.</summary>
- <description>"Drawing on the legacy of the groundbreaking Al Jazeera
Arabic channel, Al Jazeera English was launched on November 15, 2006 to more
than 80 million households worldwide.[CR][CR] The 24-hour news and current
affairs channel is the first international English-language news channel to
broadcast across the globe from the Middle East.[CR][CR] Al Jazeera's global
footprint continues to grow and now broadcasts to more than 220 million
households on six continents in more than 100 countries.[CR][CR] Our channel is
broadcast from four strategic broadcast centres: Doha, Kuala Lumpur, London,
and Washington DC. Unlike other international channels, we broadcast from our
different centres, as the world turns, providing the most comprehensive and
contextual news coverage.[CR][CR] Our mission is to provide independent,
impartial news for an international audience and to offer a voice to a
diversity of perspectives from under-reported regions.[CR][CR] In addition, the
channel aims to balance the information flow between the South and the
North.[CR][CR] The channel of reference for the Middle East and Africa, Al
Jazeera has unique access to some of the worldâs most troubled and
controversial locations. Our determination and ability to accurately reflect
the truth on the ground in regions torn by conflict and poverty has set our
content apart."[CR][CR] Source: Al Jazeera
+ <summary lang="en">Watch videos and the live stream from Al Jazeera
English.</summary>
+ <description lang="en">"Drawing on the legacy of the groundbreaking Al
Jazeera Arabic channel, Al Jazeera English was launched on November 15, 2006 to
more than 80 million households worldwide.[CR][CR] The 24-hour news and current
affairs channel is the first international English-language news channel to
broadcast across the globe from the Middle East.[CR][CR] Al Jazeera's global
footprint continues to grow and now broadcasts to more than 220 million
households on six continents in more than 100 countries.[CR][CR] Our channel is
broadcast from four strategic broadcast centres: Doha, Kuala Lumpur, London,
and Washington DC. Unlike other international channels, we broadcast from our
different centres, as the world turns, providing the most comprehensive and
contextual news coverage.[CR][CR] Our mission is to provide independent,
impartial news for an international audience and to offer a voice to a
diversity of perspectives from under-reported regions.[CR][CR] In addition, the
channel aims to balance the information flow between the South and the
North.[CR][CR] The channel of reference for the Middle East and Africa, Al
Jazeera has unique access to some of the worldâs most troubled and
controversial locations. Our determination and ability to accurately reflect
the truth on the ground in regions torn by conflict and poverty has set our
content apart."[CR][CR] Source: Al Jazeera
</description>
</extension>
</addon>
diff --git a/plugin.video.aljazeera/changelog.txt
b/plugin.video.aljazeera/changelog.txt
index a20d7eb..14adbe8 100644
--- a/plugin.video.aljazeera/changelog.txt
+++ b/plugin.video.aljazeera/changelog.txt
@@ -1,3 +1,9 @@
+Version 0.9.2
+* Add language tag to addon.xml
+
+Version 0.9.1
+* Use youtube addon for playback
+
Version 0.9.0
* Updated required versions of xbmcswift and python for Eden.
-----------------------------------------------------------------------
Summary of changes:
plugin.video.aljazeera/README.md | 2 +-
plugin.video.aljazeera/addon.py | 86 +++++++-----
plugin.video.aljazeera/addon.xml | 8 +-
plugin.video.aljazeera/changelog.txt | 6 +
.../resources/lib/getflashvideo.py | 151 --------------------
5 files changed, 64 insertions(+), 189 deletions(-)
delete mode 100644 plugin.video.aljazeera/resources/lib/getflashvideo.py
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons