The branch, eden-pre has been updated
via e2a7fa73b75c5f1b9f8151fd16f183c7fb10b66f (commit)
from b708a56355a2f37cad3c2be5ffc1681bca418a0b (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=e2a7fa73b75c5f1b9f8151fd16f183c7fb10b66f
commit e2a7fa73b75c5f1b9f8151fd16f183c7fb10b66f
Author: beenje <[email protected]>
Date: Wed Jun 15 21:42:15 2011 +0200
[plugin.video.arretsurimages] updated to version 2.1.2
diff --git a/plugin.video.arretsurimages/addon.xml
b/plugin.video.arretsurimages/addon.xml
index 449eb4f..6575b1e 100644
--- a/plugin.video.arretsurimages/addon.xml
+++ b/plugin.video.arretsurimages/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.arretsurimages"
name="Arrêt Sur Images"
- version="2.1.1"
+ version="2.1.2"
provider-name="beenje">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.arretsurimages/changelog.txt
b/plugin.video.arretsurimages/changelog.txt
index ded74d4..ffc03cf 100644
--- a/plugin.video.arretsurimages/changelog.txt
+++ b/plugin.video.arretsurimages/changelog.txt
@@ -1,3 +1,9 @@
+[B]Version 2.1.2[/B]
+
+- Fixed broken video link (redirection to HTML5 video using iPad
+user-agent doesn't work anymore)
+- "Display all parts" setting disabled (full length video not available
anymore)
+
[B]Version 2.1.1[/B]
- Update to xbmc.python 2.0 for eden repository
diff --git a/plugin.video.arretsurimages/resources/lib/asi.py
b/plugin.video.arretsurimages/resources/lib/asi.py
index c84a3d9..8b51d34 100644
--- a/plugin.video.arretsurimages/resources/lib/asi.py
+++ b/plugin.video.arretsurimages/resources/lib/asi.py
@@ -186,7 +186,8 @@ class Main:
self.streams = deque(STREAMS)
# Order the streams depending on the quality chosen
self.streams.rotate(int(__addon__.getSetting('quality')) * -1)
- self.displayParts = (__addon__.getSetting('displayParts') == 'true')
+ # displayParts settings removed - force to True
+ self.displayParts = True
def downloadVideo(self, url):
if self.downloadMode == 'true':
diff --git a/plugin.video.arretsurimages/resources/lib/asi_scraper.py
b/plugin.video.arretsurimages/resources/lib/asi_scraper.py
index 868f9eb..c2aea25 100644
--- a/plugin.video.arretsurimages/resources/lib/asi_scraper.py
+++ b/plugin.video.arretsurimages/resources/lib/asi_scraper.py
@@ -100,63 +100,52 @@ class ArretSurImages:
return parts
def getVideoDetails(self, url, streams):
- """Return the video title and real link"""
- # Follow the swf link and get the video id from the answer
- # (this works due to the iPad user-agent)
- html = getHTML(url)
- match = re.search("DM_Widget_Video_PlayerV4Html5\('(\w*)',", html)
- if match:
- videoId = match.group(1)
- # Run the json request with the video id
- request = getHTML(JSONREQUEST % videoId)
- result = simplejson.loads(request)
- # The stream quality chosen might not be available
- # -> get the first video link available (following the streams
quality order)
- for stream in streams:
- if result[stream]:
- print "Found %s link" % stream
- link = result[stream]
- break
- else:
- print "No video link found parsing swf link answer"
- link = 'None'
- title = result["title"]
+ """Return the video title and link"""
+ # Run the json request using the video id
+ # passed in url argument
+ request = getHTML(JSONREQUEST % url)
+ result = simplejson.loads(request)
+ # The stream quality chosen might not be available
+ # -> get the first video link available (following the streams quality
order)
+ for stream in streams:
+ if result[stream]:
+ print "Found %s link" % stream
+ link = result[stream]
+ break
else:
- print "No video id found parsing swf link answer"
+ print "No video link found for this video id"
link = 'None'
- title = 'None'
+ title = result["title"]
return {'Title':title, 'url':link}
def getProgramParts(self, url, name, icon):
- """Return all parts of a program (swf links)
+ """Return all parts of a program (video id)
- swf links allow to get HTML5 links with iPad user-agent"""
+ video id allows to get video url with a json request"""
html = getHTML(url)
# Filter to avoid wrap-porte (La chronique porte) defined at the
beginning
# of the html page
blocContainers = SoupStrainer(attrs = {'class':'contenu-html
bg-page-contenu'})
soup = BeautifulSoup(html, parseOnlyThese = blocContainers)
parts = []
- part = 0
- # Get all movie links
+ part = 1
+ # Get all movie id
for param in soup.findAll('param', attrs = {'name':'movie'}):
- link = param["value"]
- if part == 0:
- # First link is the full video, just use the icon from
previous page
- title = name
+ try:
+ videoId = param.parent["id"]
+ except KeyError:
+ continue
+ title = name + ' - Acte %d' % part
+ # Try to get the icon linked to the iPhone video on that page
+ # That's faster than getting it from the json request (see
getVideoDetails),
+ # which would require one extra HTML request for each part
+ try:
+ media = param.parent.parent.find(text=re.compile(u'img src='))
+ match = re.search(u'img src="(.*?)"', media)
+ thumb = URLASI + match.group(1)
+ except (TypeError, AttributeError):
thumb = icon
- else:
- title = name + ' - Acte %d' % part
- # Try to get the icon linked to the iPhone video on that page
- # That's much faster than getting it from the json request
(see getVideoDetails),
- # which would require 2 extra HTML requests for each part
- try:
- media = param.parent.parent.find(text=re.compile(u'img
src='))
- match = re.search(u'img src="(.*?)"', media)
- thumb = URLASI + match.group(1)
- except (TypeError, AttributeError):
- thumb = icon
- parts.append({'url':link, 'Title':title, 'Thumb':thumb})
+ parts.append({'url':videoId, 'Title':title, 'Thumb':thumb})
part += 1
return parts
diff --git a/plugin.video.arretsurimages/resources/settings.xml
b/plugin.video.arretsurimages/resources/settings.xml
index a13c7b0..4b5d2bb 100644
--- a/plugin.video.arretsurimages/resources/settings.xml
+++ b/plugin.video.arretsurimages/resources/settings.xml
@@ -17,6 +17,5 @@
<!--Video-->
<category label="30100">
<setting id="quality" type="enum" label="30101" default="0"
lvalues="30102|30103" />
- <setting id="displayParts" type="bool" default="true" label="30105" />
</category>
</settings>
-----------------------------------------------------------------------
Summary of changes:
plugin.video.arretsurimages/addon.xml | 2 +-
plugin.video.arretsurimages/changelog.txt | 6 ++
plugin.video.arretsurimages/resources/lib/asi.py | 3 +-
.../resources/lib/asi_scraper.py | 75 ++++++++-----------
plugin.video.arretsurimages/resources/settings.xml | 1 -
5 files changed, 41 insertions(+), 46 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons