The branch, dharma has been updated
       via  8678d896078e0fe93817575082539dc839d15e05 (commit)
      from  29519fb844314f8ce2adbf7d0cc874ecc0b2e6be (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=8678d896078e0fe93817575082539dc839d15e05

commit 8678d896078e0fe93817575082539dc839d15e05
Author: beenje <[email protected]>
Date:   Mon Jul 11 22:30:20 2011 +0200

    [plugin.video.arretsurimages] updated to version 1.1.3

diff --git a/plugin.video.arretsurimages/addon.xml 
b/plugin.video.arretsurimages/addon.xml
index 4658fff..de0cd59 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="1.1.2"
+       version="1.1.3"
        provider-name="beenje">
   <requires>
     <import addon="xbmc.python" version="1.0"/>
diff --git a/plugin.video.arretsurimages/changelog.txt 
b/plugin.video.arretsurimages/changelog.txt
index 2cbb8e9..fc4a7c7 100644
--- a/plugin.video.arretsurimages/changelog.txt
+++ b/plugin.video.arretsurimages/changelog.txt
@@ -1,3 +1,7 @@
+[B]Version 1.1.3[/B]
+
+- Fixed broken video download link after website change
+
 [B]Version 1.1.2[/B]
 
 - Fixed broken video link (redirection to HTML5 video using iPad
diff --git a/plugin.video.arretsurimages/resources/lib/asi_scraper.py 
b/plugin.video.arretsurimages/resources/lib/asi_scraper.py
index c2aea25..07acf48 100644
--- a/plugin.video.arretsurimages/resources/lib/asi_scraper.py
+++ b/plugin.video.arretsurimages/resources/lib/asi_scraper.py
@@ -38,26 +38,32 @@ class ArretSurImages:
         """Return the video title and download link"""
         title = None
         link = None
+        downloadPage = ''
         html = getHTML(url)
         soup = BeautifulSoup(html)
-        # Look for the download link image
-        img = soup.find('img', attrs = 
{'src':'http://www.arretsurimages.net/images/boutons/bouton-telecharger.png'})
-        if img:
-            downloadPage = img.findParent()['href']
+        # Look for the "bouton-telecharger" class (new version)
+        telecharger = soup.find('a', attrs = {'class':'bouton-telecharger'})
+        if telecharger:
+            downloadPage = telecharger['href']
+        else:
+            # Look for the "bouton-telecharger" image (old version)
+            img = soup.find('img', attrs = 
{'src':'http://www.arretsurimages.net/images/boutons/bouton-telecharger.png'})
+            if img:
+                downloadPage = img.findParent()['href']
+        if downloadPage.endswith('.avi'):
             print downloadPage
-            if downloadPage.endswith('.avi'):
-                title = downloadPage.split('/')[-1]
-                print title
-                html = getHTML(downloadPage)
-                soup = BeautifulSoup(html)
-                click = soup.find(text=re.compile('cliquer ici'))
-                if click:
-                    link = click.findParent()['href']
-                    print link
-                else:
-                    print "No \"cliquer ici\" found"
+            title = downloadPage.split('/')[-1]
+            print title
+            html = getHTML(downloadPage)
+            soup = BeautifulSoup(html)
+            click = soup.find(text=re.compile('cliquer ici'))
+            if click:
+                link = click.findParent()['href']
+                print link
+            else:
+                print "No \"cliquer ici\" found"
         else:
-            print "bouton-telecharger.png not found"
+            print "bouton-telecharger not found"
         return {'Title':title, 'url':link}
 
     def getIphoneVideoDetails(self, url):

-----------------------------------------------------------------------

Summary of changes:
 plugin.video.arretsurimages/addon.xml              |    2 +-
 plugin.video.arretsurimages/changelog.txt          |    4 ++
 .../resources/lib/asi_scraper.py                   |   38 +++++++++++--------
 3 files changed, 27 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to