The branch, eden has been updated
       via  1fd0362fc892ee7f1fce68096e57ccd16ee257a4 (commit)
       via  b078b9a47b5e7af9eff19d8e725ec7f4ac951efd (commit)
       via  3161f2a542a5250822089eb037319c4f8dac7fa5 (commit)
      from  27e198a11938c72baf4f5db32e3cf87a79b13a7f (commit)

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

commit 1fd0362fc892ee7f1fce68096e57ccd16ee257a4
Author: beenje <[email protected]>
Date:   Thu Feb 28 21:56:23 2013 +0100

    [plugin.video.neterratv] updated to version 0.0.7

diff --git a/plugin.video.neterratv/addon.xml b/plugin.video.neterratv/addon.xml
index 3d7cfe8..7ae24f3 100644
--- a/plugin.video.neterratv/addon.xml
+++ b/plugin.video.neterratv/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.neterratv" name="Neterra.TV" version="0.0.6" 
provider-name="[email protected]">
+<addon id="plugin.video.neterratv" name="Neterra.TV" version="0.0.7" 
provider-name="[email protected]">
   <requires>
     <import addon="xbmc.python" version="2.0"/>
     <import addon="script.module.xbmcswift" version="0.2.0"/>
diff --git a/plugin.video.neterratv/changelog.txt 
b/plugin.video.neterratv/changelog.txt
index 0401a3c..5f54435 100644
--- a/plugin.video.neterratv/changelog.txt
+++ b/plugin.video.neterratv/changelog.txt
@@ -21,4 +21,7 @@ Todo: Need function to delete cookie file
 
 0.0.6
 - updated email addresses
-- 
\ No newline at end of file
+0.0.7
+- neterra website was re-designed 
+- the old webpage is available under old.neterra.tv 
+- I changed the URL to the old URL
\ No newline at end of file
diff --git a/plugin.video.neterratv/icon.png b/plugin.video.neterratv/icon.png
index d7a7573..34c3db1 100644
Binary files a/plugin.video.neterratv/icon.png and 
b/plugin.video.neterratv/icon.png differ
diff --git a/plugin.video.neterratv/readme.txt 
b/plugin.video.neterratv/readme.txt
index 2b5ec7e..7491864 100644
--- a/plugin.video.neterratv/readme.txt
+++ b/plugin.video.neterratv/readme.txt
@@ -4,6 +4,21 @@ I created this addon to watch NeterraTV on my jailbreak 
AppleTV 2.
 Before I used to stream from my IPad via Airplay but the quality was that good 
I always had to fight
 with my daughter over IPad. I have also tested the on my Win7 machine. I 
didn't test on any other hardware.
 
+The plugin is not published official by XMBC. Below are the steps how to 
install it manually. 
+
+How to install:
+
 Note: The plugin uses methods from module script.module.beautifulsoup. This 
should be installed
 automatically when you install from zip file. If not install the MyVideo.de 
plugin from Tristan 
-Fischer which is available in the official XBMC addon repositiory. 
\ No newline at end of file
+Fischer which is available in the official XBMC addon repositiory. 
+
+1. Copy the zip file plugin.video.neterratv-x.x.x.zip to a directory XMBC 
server has access to 
+       e.g. <USERDIR>\AppData\Roaming\XBMC\addons\packages\
+2. Run XBMC and go to System -> Add-ons
+3. From Add-ons menu select -> Install from zip file
+4. Select the zip file plugin.video.neterratv-x.x.x.zip
+5. NeterraTV add-on will appear in the video addon list
+6. Before you run it you have to provide login information
+       For this select the addon in the list and the PC use right mouse button 
+       on AppleTV long press Menu on the remote control
+
diff --git a/plugin.video.neterratv/resources/lib/neterratv.py 
b/plugin.video.neterratv/resources/lib/neterratv.py
index 4d3a2cc..bfea1a7 100644
--- a/plugin.video.neterratv/resources/lib/neterratv.py
+++ b/plugin.video.neterratv/resources/lib/neterratv.py
@@ -36,10 +36,10 @@ class neterra:
     CLASSNAME = 'neterra'
     COOKIEFILE = 'cookies.lwp'
     PLUGINID = 'plugin.video.neterratv'
-    MAINURL = 'http://www.neterra.tv/bg/'
-    LOGINURL = 'http://www.neterra.tv/bg/login.php'
+    MAINURL = 'http://old.neterra.tv/bg/'
+    LOGINURL = 'http://old.neterra.tv/bg/login.php'
     USERAGENT = {'User-agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows 
NT)'}
-    BTVURL = 'http://www.neterra.tv/bg/media.php?id=1&bm=2'
+    BTVURL = 'http://old.neterra.tv/bg/media.php?id=1&bm=2'
     
     
     #globals
@@ -142,7 +142,7 @@ returns true if login successful
         isLoggedIn = False
         urlopen = urllib2.urlopen
         request = urllib2.Request
-        theurl = 'http://www.neterra.tv/bg/login.php'
+        theurl = 'http://old.neterra.tv/bg/login.php'
         self.__log('----URL request started for: ' + theurl + ' ----- ')
         txdata = 'username=' + self.__username__ + '&password=' + 
self.__password__ + '&submitted=1'
         req = request(self.LOGINURL, txdata, self.USERAGENT)
@@ -265,8 +265,8 @@ returns a soup obejct
                                     url=''
                                 else:
                                     #build the url
-                                    # example 
http://www.neterra.tv/bg/playlivestream.php?epid=94718&q=12&plid=3
-                                    url = 
'http://www.neterra.tv/bg/playlivestream.php?epid=' + str(parameters[0]) + 
'&q=' + str(parameters[1]) + '&plid=' + str(parameters[2])                      
                     
+                                    # example 
http://old.neterra.tv/bg/playlivestream.php?epid=94718&q=12&plid=3
+                                    url = 
'http://old.neterra.tv/bg/playlivestream.php?epid=' + str(parameters[0]) + 
'&q=' + str(parameters[1]) + '&plid=' + str(parameters[2])                      
                     
                             else:
                                 url = ''                    
                         if len(url) > 1:
@@ -361,8 +361,8 @@ returns a soup obejct
                                 url=''
                             else:
                                 #build the url
-                                # 
http://www.neterra.tv/bg/playlivestream.php?epid=94718&q=12&plid=3
-                                url = 
'http://www.neterra.tv/bg/playstream.php?epid=' + str(parameters[0]) + '&q=' + 
str(parameters[1]) + '&plid=' + str(parameters[2])                              
             
+                                # 
http://old.neterra.tv/bg/playlivestream.php?epid=94718&q=12&plid=3
+                                url = 
'http://old.neterra.tv/bg/playstream.php?epid=' + str(parameters[0]) + '&q=' + 
str(parameters[1]) + '&plid=' + str(parameters[2])                              
             
                         else:
                             url = ''                    
                     if len(url) > 1:

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=b078b9a47b5e7af9eff19d8e725ec7f4ac951efd

commit b078b9a47b5e7af9eff19d8e725ec7f4ac951efd
Author: beenje <[email protected]>
Date:   Thu Feb 28 21:55:44 2013 +0100

    [plugin.video.pbs] updated to version 2.0.11

diff --git a/plugin.video.pbs/addon.xml b/plugin.video.pbs/addon.xml
index 9e81199..07a819a 100644
--- a/plugin.video.pbs/addon.xml
+++ b/plugin.video.pbs/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.pbs"
        name="PBS"
-       version="2.0.10"
+       version="2.0.11"
        provider-name="stacked">
   <requires>
        <import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.pbs/changelog.txt b/plugin.video.pbs/changelog.txt
index 00c626d..019cd34 100644
--- a/plugin.video.pbs/changelog.txt
+++ b/plugin.video.pbs/changelog.txt
@@ -1,4 +1,10 @@
-[B]Version 2.0.10[/B]
+[B]Version 2.0.11[/B]
+
+- Removed deprecated video quality 'MPEG-4 500kbps'
+- Set default video quality to 'MP4 800k'
+- Fixed 'base' referenced before assignment error
+
+[B]Version 3.0.10[/B]
 
 - Fixed index error when loading directories
 - Fixed redirect_url errors
diff --git a/plugin.video.pbs/default.py b/plugin.video.pbs/default.py
index 34f52bb..e13a755 100644
--- a/plugin.video.pbs/default.py
+++ b/plugin.video.pbs/default.py
@@ -5,8 +5,8 @@ import simplejson as json
 plugin = "PBS"
 __author__ = 'stacked <[email protected]>'
 __url__ = 'http://code.google.com/p/plugin/'
-__date__ = '01-20-2013'
-__version__ = '2.0.10'
+__date__ = '02-28-2013'
+__version__ = '2.0.11'
 settings = xbmcaddon.Addon( id = 'plugin.video.pbs' )
 buggalo.SUBMIT_URL = 'http://www.xbmc.byethost17.com/submit.php'
 dbg = False
@@ -185,10 +185,10 @@ def build_search_directory( url, page ):
 
 @retry(TypeError)
 def find_videos( name, program_id, topic, page ):
-       if settings.getSetting("quality") == '0':
-               type = ['MPEG-4 500kbps', 'MP4 800k', HIGH]
+       if settings.getSetting("video") == '0':
+               type = ['MP4 800k', 'Legacy KIDS encoding', HIGH]
        else:
-               type = [HIGH, 'MP4 800k', 'MPEG-4 500kbps' ]
+               type = [HIGH, 'MP4 800k', 'Legacy KIDS encoding']
        start = str( 200 * page )
        url = 'None'
        backup_url = None
@@ -255,6 +255,7 @@ def play_video( name, url, thumb, plot, studio, starttime, 
backup_url ):
        print 'PBS - ' + studio + ' - ' + name
        print url
        playpath = False
+       defaulturl = url
        
        #Release Urls
        if 'http://release.theplatform.com/' in url:
@@ -274,15 +275,6 @@ def play_video( name, url, thumb, plot, studio, starttime, 
backup_url ):
                try:
                        base = re.compile( '<meta base="(.+?)" />' ).findall( 
data )[0]
                        src = re.compile( '<ref src="(.+?)" title="(.+?)" 
(author)?' ).findall( data )[0][0]
-               except:
-                       print 'PBS - Release backup_url'
-                       if backup_url != 'None':
-                               url = backup_url
-                               backup_url = 'None'
-                       else:
-                               url = 'None'
-                               backup_url = 'None'
-               if url != 'None' and 'http://urs.pbs.org/redirect/' not in url:
                        if base == 'http://ad.doubleclick.net/adx/':
                                src_data = src.split( "&lt;break&gt;" )
                                url = src_data[0] + "mp4:" + 
src_data[1].replace('mp4:','')
@@ -291,6 +283,14 @@ def play_video( name, url, thumb, plot, studio, starttime, 
backup_url ):
                        else:
                                url = base
                                playpath = "mp4:" + src.replace('mp4:','')
+               except:
+                       print 'PBS - Release backup_url'
+                       if backup_url != 'None':
+                               url = backup_url
+                               backup_url = 'None'
+                       else:
+                               url = 'None'
+                               backup_url = 'None'
        
        #Empty Urls
        if url == 'None':
@@ -342,6 +342,7 @@ def play_video( name, url, thumb, plot, studio, starttime, 
backup_url ):
                dialog = xbmcgui.Dialog()
                ok = dialog.ok(plugin , settings.getLocalizedString( 30008 ))
                ok = dialog.ok(plugin, settings.getLocalizedString( 30051 ))
+               buggalo.addExtraData('defaulturl', defaulturl)
                buggalo.addExtraData('url', url)
                buggalo.addExtraData('info', studio + ' - ' + name)
                raise Exception("backup_url ERROR")
diff --git a/plugin.video.pbs/resources/language/English/strings.xml 
b/plugin.video.pbs/resources/language/English/strings.xml
index 17aea53..d1ea871 100644
--- a/plugin.video.pbs/resources/language/English/strings.xml
+++ b/plugin.video.pbs/resources/language/English/strings.xml
@@ -19,7 +19,7 @@
        <string id="30016">access to this content.</string>
        <string id="30017">Preferred video quality:</string>
        <string id="30018">2500k-1200k</string>
-       <string id="30019">800k-500k</string>
+       <string id="30019">800k</string>
        <string id="30050">There was a connection error:</string>
        <string id="30051">If this problem persists, please submit the error 
report.</string>
        <string id="30052">Retry</string>
diff --git a/plugin.video.pbs/resources/settings.xml 
b/plugin.video.pbs/resources/settings.xml
index c3d6889..8def279 100644
--- a/plugin.video.pbs/resources/settings.xml
+++ b/plugin.video.pbs/resources/settings.xml
@@ -1,4 +1,4 @@
 <settings>
-   <setting id="quality" type="enum" label="30017" lvalues="30019|30018" 
default="1"/>
+   <setting id="video" type="enum" label="30017" lvalues="30019|30018" 
default="0"/>
    <setting id="view" type="bool" label="30055" default="true"/>
 </settings>

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=3161f2a542a5250822089eb037319c4f8dac7fa5

commit 3161f2a542a5250822089eb037319c4f8dac7fa5
Author: beenje <[email protected]>
Date:   Thu Feb 28 21:55:35 2013 +0100

    [plugin.video.tv5monde] updated to version 1.0.4

diff --git a/plugin.video.tv5monde/addon.xml b/plugin.video.tv5monde/addon.xml
index 04f7e69..623ff9c 100644
--- a/plugin.video.tv5monde/addon.xml
+++ b/plugin.video.tv5monde/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.tv5monde" name="tv5monde" version="1.0.3" 
provider-name="jamontes">
+<addon id="plugin.video.tv5monde" name="tv5monde" version="1.0.4" 
provider-name="jamontes">
     <requires>
         <import addon="xbmc.python" version="2.0"/>
     </requires>
@@ -8,12 +8,12 @@
     </extension>
     <extension point="xbmc.addon.metadata">
         <platform>all</platform>
-        <summary lang="en">TV5MONDE videos (EN)</summary>
-        <description lang="en">This plugin allows you to watch the TV5MONDE 
videos provided by TV5MONDE+ web site, selected by category and ordered by date 
of apearance (EN)</description>
-        <summary lang="es">TV5MONDE vídeos (ES)</summary>
-        <description lang="es">Este plugin permite ver los vídeos de TV5MONDE 
contenidos en la página web de TV5MONDE+, seleccionados por categoría y 
ordenados por fecha de emisión (ES)</description>
-        <summary lang="fr">TV5MONDE médiathèque (FR)</summary>
-        <description lang="fr">Ce plugin permet de regarder TV5MONDE 
médiathèque qui se trouve sur le site web de TV5MONDE+ (FR)</description>
+        <summary lang="en">TV5MONDE videos</summary>
+        <description lang="en">This plugin allows you to watch the TV5MONDE 
videos provided by TV5MONDE+ web site, selected by category and ordered by date 
of apearance</description>
+        <summary lang="es">TV5MONDE vídeos</summary>
+        <description lang="es">Este plugin permite ver los vídeos de TV5MONDE 
contenidos en la página web de TV5MONDE+, seleccionados por categoría y 
ordenados por fecha de emisión</description>
+        <summary lang="fr">TV5MONDE médiathèque</summary>
+        <description lang="fr">Ce plugin permet de regarder TV5MONDE 
médiathèque qui se trouve sur le site web de TV5MONDE+</description>
         <language>fr</language>
     </extension>
 </addon>
diff --git a/plugin.video.tv5monde/changelog.txt 
b/plugin.video.tv5monde/changelog.txt
index 7672bc8..4d39086 100644
--- a/plugin.video.tv5monde/changelog.txt
+++ b/plugin.video.tv5monde/changelog.txt
@@ -1,23 +1,27 @@
-0.0.1
-- First Try.
-0.0.2
-- Added json query from category video list.
-- Supported category selection ordered by date.
-0.9.99
-- Supported french characteres on titles.
-- Play older videos at the end of category list.
-1.0.0
-- Refactoring and code optimization.
-- First public release.
-1.0.1
-- Fix a pre 2.7 python syntax error in get_plugin_parms to run over Windows 7 
and ATV. 
-- change fanart and icon images.
+1.0.4
+- Added TV5MONDE+7 and Programs sections.
+- Fixed bug with last page link under each category section.
+- Some refactoring and cleaning up.
+1.0.3
+- Scaled fanart and icon images according to add-ons standards.
+- Added language tag into addon.xml to allow add-ons search by language.
 1.0.2
 - Suported debug option from plugin settings. Now debug is disabled by default.
 - Suported internationalization of gui messages: English, Spanish and French.
 - Modified plugin description.
 - Change the copyleft license from GPLv2 to GPLv3.
 - Eden and Frodo branches splited for pull to oficial repositories. 
-1.0.3
-- Scaled fanart and icon images according to add-ons standards.
-- Added language tag into addon.xml to allow add-ons search by language.
+1.0.1
+- Fix a pre 2.7 python syntax error in get_plugin_parms to run over Windows 7 
and ATV. 
+- Change fanart and icon images.
+1.0.0
+- Refactoring and code optimization.
+- First public release.
+0.9.99
+- Supported french characteres on titles.
+- Play older videos at the end of category list.
+0.0.2
+- Added json query from category video list.
+- Supported category selection ordered by date.
+0.0.1
+- First Try.
diff --git a/plugin.video.tv5monde/default.py b/plugin.video.tv5monde/default.py
index fcefae5..33b7da6 100644
--- a/plugin.video.tv5monde/default.py
+++ b/plugin.video.tv5monde/default.py
@@ -40,14 +40,38 @@ def run():
     params = lutil.get_plugin_parms()
     
     if params.get("action") is None:
-        index(params)
+        create_index(params)
     else:
         action = params.get("action")
         exec action+"(params)"
 
+def create_index(params):
+    lutil.log("tv5monde.create_index "+repr(params))
+
+    action = 'genre_index'
+    title  = 'Les Genres'
+    url    = 'http://www.tv5mondeplus.com/videos'
+    lutil.log('tv5monde.create_index action=["%s"] title=["%s"] url=["%s"]' % 
(action, title, url))
+    lutil.addDir(action=action, title=title, url=url)
+
+    action = 'emission_index'
+    title  = 'Les Emissions'
+    url    = 'http://www.tv5mondeplus.com/emissions'
+    lutil.log('tv5monde.create_index action=["%s"] title=["%s"] url=["%s"]' % 
(action, title, url))
+    lutil.addDir(action=action, title=title, url=url)
+
+    action = 'monde7_index'
+    title  = 'TV5MONDE+7'
+    url    = 'http://www.tv5mondeplus.com/grilles'
+    lutil.log('tv5monde.create_index action=["%s"] title=["%s"] url=["%s"]' % 
(action, title, url))
+    lutil.addDir(action=action, title=title, url=url)
+
+    lutil.close_dir(pluginhandle)
+
+
 # This function generate the video index ordered by category.
-def index(params):
-    lutil.log("tv5monde.index "+repr(params))
+def genre_index(params):
+    lutil.log("tv5monde.genre_index "+repr(params))
 
     url = 'http://www.tv5mondeplus.com/videos'
     buffer_html = lutil.carga_web(url)
@@ -57,18 +81,120 @@ def index(params):
 
     for genre, label in lutil.find_multiple(lista_genre, genre_pattern):
         genre_url = 
'http://www.tv5mondeplus.com/get/videos?pg=0&type=genre&sort=%s&loadpg=false&order=date'
 %  genre
-        lutil.log('tv5monde.index url=["%s"] genre=["%s"]' % (genre_url, 
label))
-        lutil.addDir(action="main_list", title=label, url=genre_url)
+        lutil.log('tv5monde.genre_index url=["%s"] genre=["%s"]' % (genre_url, 
label))
+        lutil.addDir(action="genre_list", title=label, url=genre_url)
+
+    lutil.close_dir(pluginhandle)
+
+# This function generate the video index ordered by category.
+def emission_index(params):
+    lutil.log("tv5monde.emission_index "+repr(params))
+
+    url = params.get("url")
+    emi_pattern_block = '<div id="liste-emission">(.*?)</div></div>'
+    emi_pattern       = '<a href="([^"]+)">([^<]+)</a>'
+
+    buffer_html = lutil.carga_web(url)
+    cacho_html = lutil.find_first(buffer_html, emi_pattern_block)
+    for url, title in lutil.find_multiple(cacho_html, emi_pattern):
+        url = 'http://www.tv5mondeplus.com%s' % url
+        action = 'emission_first_list'
+        lutil.log('tv5monde.emission_index action=["%s"] url=["%s"]' % 
(action, url))
+        lutil.addDir(action=action, title=title, url=url)
+
+    lutil.close_dir(pluginhandle)
+
+# This function generate the video index ordered by category.
+def monde7_index(params):
+    lutil.log("tv5monde.monde7_index "+repr(params))
+
+    url = params.get("url")
+    buffer_html = lutil.carga_web(url)
+    grille_pattern_block = '<ul id="grille-floater">(.*?)</ul>'
+    grille_pattern ='<li name="[^"]+".*?rel="([^"]+)"><span 
class="titre">([^<]+)</span><span class="date">([^<]+)</span></a></li>'
+    block_grille = lutil.find_first(buffer_html, grille_pattern_block)
+
+    if block_grille:
+        lista_grille = 
[('http://www.tv5mondeplus.com/grilles/calendar?ajx=1&pg=0&classes=%s&slot=&sig=0&onoff=1'
 % rel, '%s, %s' % (weekday, date)) for rel, weekday, date in 
lutil.find_multiple(block_grille, grille_pattern)]
+        lista_grille.reverse()
+
+        for monde7_url, label in lista_grille:
+            lutil.log('tv5monde.monde7_index url=["%s"]' % monde7_url)
+            lutil.addDir(action="monde7_list", title=label, url=monde7_url)
+
+        lutil.close_dir(pluginhandle)
+
+
+def emission_first_list(params):
+    lutil.log("tv5monde.emission_first_list "+repr(params))
+
+    url = params.get("url")
+    nid_pattern       = '<input id="nid" type="hidden" value="([^"]+)" />'
+    vid_pattern       = '<input id="vid" type="hidden" value="([^"]+)" />'
+    emiid_pattern     = '<input id="emi_string" type="hidden" value="([^"]+)" 
/>'
+
+    mi_html = lutil.carga_web(url)
+    mi_nid  = lutil.find_first(mi_html, nid_pattern)
+    mi_vid  = lutil.find_first(mi_html, vid_pattern)
+    mi_emi  = lutil.find_first(mi_html, emiid_pattern)
+    url_query = 
'http://www.tv5mondeplus.com/get/video_emi?pg=0&emi=%s&nid=%s&vid=%s' % 
(mi_emi, mi_nid, mi_vid)
+    params['referer'] = url
+    params['url'] = url_query
+
+    return emission_list(params)
+
+
+def emission_list(params):
+    lutil.log("tv5monde.emission_list "+repr(params))
+
+    url = params.get("url")
+    referer = params.get("referer")
+
+    mi_headers = {  'Accept'            : 'application/json, text/javascript, 
*/*',
+                    'Accept-Encoding'   : 'deflate',
+                    'X-Requested-With'  : 'XMLHttpRequest',
+                    'Referer'           :  referer,
+                    'Cookie'            : 'ns_cookietest=true; ns_session=true'
+                }
+
+    buffer_html = lutil.carga_web(params.get("url"), mi_headers)
+    buffer_json = lutil.get_json_dict(buffer_html)
+    pattern_videos = '<a title="([^"]+)" href=".+?nid=([^"]+)"> <img 
src="([^"]+)".*?<p class="date">([^<]+)</p>'
+    videolist = lutil.find_multiple(buffer_json['content'], pattern_videos)
+    for title, videoid, thumbnail, date in videolist:
+        video_url = 'http://www.tv5mondeplus.com/video-xml/get/%s' % videoid
+        title = title.replace('&quot;', '"')
+        fecha = lutil.limpia_fecha(date)
+        lutil.log('videolist: URL: "%s" Date: "%s" Thumbnail: "%s"' % 
(video_url, fecha, thumbnail))
+
+        plot = title
+        lutil.addLink(action="play_video", title='%s %s' % (title, fecha), 
plot=plot, url=video_url, thumbnail=thumbnail)
+    
+    pattern_next = '<li class="item suivante hide">.+?<a rel="address:([^"]+)"'
+    next_page = lutil.find_first(buffer_json['content'], pattern_next)
+    if next_page:
+        next_page_url = 'http://www.tv5mondeplus.com%s' % next_page
+        lutil.log('next_page_url="%s"' %  next_page_url)
+        lutil.addDir(action="emission_list", title=">> %s" % 
translation(30010), url=next_page_url, referer=referer)
 
     lutil.close_dir(pluginhandle)
 
 
 # This function generates the list of videos available on each category, 
ordered by date.
-def main_list(params):
-    lutil.log("tv5monde.main_list "+repr(params))
+def genre_list(params):
+    lutil.log("tv5monde.genre_list "+repr(params))
 
     # Loads the list of videos of the selected category based on the json 
object retrieved from the server.
-    buffer_json = lutil.get_json(params.get("url"))
+    mi_headers = {  'Accept'            : 'application/json, text/javascript, 
*/*',
+                    'Accept-Encoding'   : 'deflate',
+                    'X-Requested-With'  : 'XMLHttpRequest',
+                    'Referer'           : 'http://www.tv5mondeplus.com/videos',
+                    'Cookie'            : 'ns_cookietest=true; ns_session=true'
+                }
+
+    url = params.get("url")
+    buffer_html = lutil.carga_web(url, mi_headers)
+    buffer_json = lutil.get_json_dict(buffer_html)
     pattern_videos = '<a title="([^"]+)" href="/video/([^/]+)/[^"]+"> <img 
src="([^"]+)" .*?<div class="bookmark" id="book_([0-9]+)">'
     videolist = lutil.find_multiple(buffer_json['content'], pattern_videos)
 
@@ -85,15 +211,61 @@ def main_list(params):
         pattern_total = '<ul class="pager" total="([0-9]+)"'
         pattern_genre = 'sort=([0-9]+)'
         last_page = int(lutil.find_first(buffer_json['pager'], pattern_total)) 
- 1
-        next_page = int(lutil.find_first(params.get("url"), pattern_page)) + 1
-        if last_page != next_page:
-            genre = lutil.find_first(params.get("url"), pattern_genre)
+        current_page = int(lutil.find_first(url, pattern_page))
+        if last_page > current_page:
+            next_page = current_page + 1
+            genre = lutil.find_first(url, pattern_genre)
             next_page_url = 
'http://www.tv5mondeplus.com/get/videos?pg=%s&type=genre&sort=%s&loadpg=false&order=date'
 %  (next_page, genre)
-            lutil.log('next_page=%s last_page=%s next_page_url="%s"' % 
(next_page, last_page, next_page_url))
-            lutil.addDir(action="main_list", title=">> %s" % 
translation(30010), url=next_page_url)
+            lutil.log('current_page=%s last_page=%s next_page_url="%s"' % 
(current_page, last_page, next_page_url))
+            lutil.addDir(action="genre_list", title=">> %s" % 
translation(30010), url=next_page_url)
 
     lutil.close_dir(pluginhandle)
 
+
+# This function generates the list of videos available on each day.
+def monde7_list(params):
+    lutil.log("tv5monde.monde7_list "+repr(params))
+
+    # Loads the list of videos of the selected category based on the json 
object retrieved from the server.
+    mi_headers = {  'Accept'            : 'application/json, text/javascript, 
*/*',
+                    'Accept-Encoding'   : 'deflate',
+                    'X-Requested-With'  : 'XMLHttpRequest',
+                    'Referer'           : 
'http://www.tv5mondeplus.com/grilles',
+                    'Cookie'            : 'ns_cookietest=true; ns_session=true'
+                }
+
+    url = params.get("url")
+    buffer_html = lutil.carga_web(url, mi_headers)
+    buffer_json = lutil.get_json_dict(buffer_html)
+
+    pattern_videos = '<li class="item hide">.*? <div class="ivid">.*?<div 
class="image-tv">.*?<a href="/video/([^/]+)/.*?<img 
src="([^"]+)".*?<span>(.*?)</span><a href="[^>]+?>([^<]+?)<.*?<div 
class="bookmark" id="book_([0-9]+)">.*?</li>' 
+    videolist = lutil.find_multiple(buffer_json['output'], pattern_videos)
+
+    for date, thumbnail, time, title, videoid in videolist:
+        title = title.replace('&quot;', '"')
+        mi_title = '%s (%s %s)' % (title, date, time[:5])
+        video_url = 'http://www.tv5mondeplus.com/video-xml/get/%s' % videoid
+        lutil.log('videolist: URL: "%s" Descripcion: "%s" Thumbnail: "%s"' % 
(video_url, title, thumbnail))
+
+        plot = title
+        lutil.addLink(action="play_video", title=mi_title, plot=plot, 
url=video_url, thumbnail=thumbnail)
+    
+    if buffer_json['pager'] is not None:
+        pattern_page = 'pg=([0-9]+)'
+        pattern_total = '<ul class="pager" total="([0-9]+)"'
+        pattern_class = 'classes=([0-9-]+)'
+        last_page = int(lutil.find_first(buffer_json['pager'], pattern_total)) 
- 1
+        current_page = int(lutil.find_first(url, pattern_page))
+        if last_page > current_page:
+            next_page = current_page + 1
+            mi_class = lutil.find_first(url, pattern_class)
+            next_page_url = 
'http://www.tv5mondeplus.com/grilles/calendar?ajx=1&pg=%s&classes=%s&slot=&sig=0&onoff=1'
  %  (next_page, mi_class)
+            lutil.log('current_page=%s last_page=%s next_page_url="%s"' % 
(current_page, last_page, next_page_url))
+            lutil.addDir(action="monde7_list", title=">> %s" % 
translation(30010), url=next_page_url)
+
+    lutil.close_dir(pluginhandle)
+
+
 # This function searchs on the web server (up to 2 times) in order to get the 
video link and then reproduces the video.
 def play_video(params):
     lutil.log("tv5monde.play_video "+repr(params))
diff --git a/plugin.video.tv5monde/lutil.py b/plugin.video.tv5monde/lutil.py
index c0bce56..2172e4e 100644
--- a/plugin.video.tv5monde/lutil.py
+++ b/plugin.video.tv5monde/lutil.py
@@ -19,7 +19,7 @@
 
    Description:
    These funtions are called from the main plugin module, aimed to ease and 
simplify the plugin development process.
-   Release 0.1.1
+   Release 0.1.3
 '''
 
 # First of all We must import all the libraries used for plugin development.
@@ -31,6 +31,7 @@ import xbmcplugin, xbmcaddon, xbmcgui, xbmc, xbmcaddon
 def get_plugin_settings(plugin_id=""):
     return xbmcaddon.Addon(id=plugin_id)
     
+
 debug_enable = False # The debug logs are disabled by default.
 
 # This function sets the debug_enable var to log everything if debug option is 
true.
@@ -39,19 +40,20 @@ def set_debug_mode(debug_flag=""):
     if debug_flag == "true":
         debug_enable = True
 
+
 # This function logs the messages into the main XBMC log file. Called from 
main plugin module.
 def log(message):
     if debug_enable:
         xbmc.log(message.encode('ascii', 'ignore'))
 
+
 # This function logs the messages into the main XBMC log file. Called from the 
libraries module by other functions.
 def _log(message):
     if debug_enable:
-        xbmc.log("lutils.%s" % message.encode('ascii', 'ignore'))
+        xbmc.log("lutils." + message.encode('ascii', 'ignore'))
+
 
 # This function gets all the parameters passed to the plugin from XBMC API and 
retuns a dictionary.
-# Example:
-# plugin://plugin.video.atactv/?parametro1=valor1&parametro2=valor2&parametro3
 def get_plugin_parms():
     params = sys.argv[2]
     _log("get_plugin_parms " + str(params))
@@ -64,15 +66,16 @@ def get_plugin_parms():
 
 
 # This function loads the html code from a webserver and returns it into a 
string.
-def carga_web(url):
+def carga_web(url, headers=""):
     _log("carga_web " + url)
 
-    MiReq = urllib2.Request(url) # esto funciona de forma diferente porque 
metemos una cabecera.
-    # Tenemos que hacer creer a la web que usamos un navegador de usuario real.
-    MiReq.add_header('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:17.0) 
Gecko/20100101 Firefox/17.0') # Cabecera del Firefox.
-    MiConex = urllib2.urlopen(MiReq) # abrimos una conexion con la URL
-    MiHTML = MiConex.read() # Chupamos TODO el contenido de la pagina web y lo 
salvamos en una variable
-    MiConex.close() # Cerramos la conexion con la pagina web, pues ya tenemos 
toda la info que necesitamos.
+    MiReq = urllib2.Request(url) # We have to use this method as we need to 
add some headers.
+    MiReq.add_header('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:17.0) 
Gecko/20100101 Firefox/17.0') # Firefox header.
+    for key in headers:
+        MiReq.add_header(key, headers[key])
+    MiConex = urllib2.urlopen(MiReq) # Opens the http connection to the URL.
+    MiHTML = MiConex.read() # Gets all the html contents from the URL and 
stores it into a variable.
+    MiConex.close() # Close the http connection as we get what we need.
 
     return MiHTML
 
@@ -88,23 +91,18 @@ def get_redirect(url):
     return MiHTML
 
 
-# This function sends a http GET with XMLHttpRequest, and gets back a JSON 
from the web server stored into a dict. 
-def get_json(url):
-    _log("get_json " + url)
-
-    MiReq = urllib2.Request(url)
-    MiReq.add_header('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:17.0) 
Gecko/20100101 Firefox/17.0')
-    MiReq.add_header('Accept', 'application/json, text/javascript, */*')
-    MiReq.add_header('Accept-Encoding', 'deflate')
-    MiReq.add_header('X-Requested-With', 'XMLHttpRequest')
-    MiReq.add_header('Referer', 'http://www.tv5mondeplus.com/videos')
-    MiReq.add_header('Cookie', 'ns_cookietest=true; ns_session=true')
+# This function returns a json object collected from the web into a dictionary.
+def get_json_dict(MiJSON):
+    return json.loads(MiJSON)
 
-    MiConex = urllib2.urlopen(MiReq)
-    MiJSON = MiConex.read()
-    MiConex.close()
 
-    return json.loads(MiJSON)
+# This function cleans the date field obtained from the emissions JSON video 
list.
+def limpia_fecha(date):
+    fecha = date.split(",")
+    dia = fecha[1][1:].replace("..","")
+    hora = fecha[2][1:8]
+    _log("limpia_fecha (%s %s)"  % (dia, hora))
+    return "(%s %s)" % (dia, hora)
 
 
 # This function allows us to find multiples matches from a regexp into a 
string.
@@ -127,11 +125,16 @@ def find_first(text,pattern):
     except:
         return ""
 
+
 # This function adds a directory entry into the XBMC GUI throught the API
-def addDir(action = "", title = "", url = "", thumbnail = ""):
-    _log("addDir action = [" + action + "] title = [" + title + "] url = [" + 
url + "] thumbnail = [" + thumbnail + "]")
+def addDir(action = "", title = "", url = "", thumbnail = "", referer = ""):
+    _log("addDir action = [" + action + "] url = [" + url + "] thumbnail = [" 
+ thumbnail + "]")
+
+    if referer:
+        dir_url = '%s?action=%s&url=%s&referer=%s' % (sys.argv[0], action, 
urllib.quote_plus(url), urllib.quote_plus(referer))
+    else:
+        dir_url = '%s?action=%s&url=%s' % (sys.argv[0], action, 
urllib.quote_plus(url))
 
-    dir_url = '%s?action=%s&url=%s' % (sys.argv[0], action, 
urllib.quote_plus(url))
     dir_item = xbmcgui.ListItem(title, iconImage = "DefaultFolder.png", 
thumbnailImage = thumbnail)
     dir_item.setInfo(type = "Video", infoLabels = {"Title": title})
     return xbmcplugin.addDirectoryItem(handle = int(sys.argv[1]), url = 
dir_url, listitem = dir_item, isFolder = True)
@@ -139,7 +142,7 @@ def addDir(action = "", title = "", url = "", thumbnail = 
""):
 
 # This function adds a video link entry into the XBMC GUI throught the API
 def addLink(action = "", title = "", plot = "", url = "", thumbnail = ""):
-    _log("addDir action = [" + action + "] title = [" + title + "] plot = [" + 
plot + "] url = [" + url + "] thumbnail = [" + thumbnail + "]")
+    _log("addLink action = [" + action + "] url = [" + url + "] thumbnail = [" 
+ thumbnail + "]")
 
     link_url = '%s?action=%s&url=%s' % (sys.argv[0], action, 
urllib.quote_plus(url))
     link_item = xbmcgui.ListItem(title, iconImage = "DefaultVideo.png", 
thumbnailImage = thumbnail)
@@ -153,11 +156,13 @@ def close_dir(pluginhandle):
     _log("close_dir pluginhadle: %s" % pluginhandle)
     xbmcplugin.endOfDirectory(pluginhandle)
 
+
 # This funtion shows a popup window with a notices message through the XBMC 
GUI during 5 secs.
 def showWarning(message):
     _log("showWarning message: %s" % message)
     xbmc.executebuiltin('XBMC.Notification(Info:,' + message + '!,6000)')
 
+
 # This function plays the video file pointed by the URL passed as argument.
 def play_resolved_url(pluginhandle= "", url = ""):
     _log("play_resolved_url pluginhandle = [%s] url = [%s]" % (pluginhandle, 
url))

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

Summary of changes:
 plugin.video.neterratv/.gitattributes              |   22 ---
 plugin.video.neterratv/.gitignore                  |  163 ----------------
 plugin.video.neterratv/addon.xml                   |    2 +-
 plugin.video.neterratv/changelog.txt               |    5 +-
 plugin.video.neterratv/icon.png                    |  Bin 20284 -> 19959 bytes
 plugin.video.neterratv/readme.txt                  |   17 ++-
 plugin.video.neterratv/resources/lib/neterratv.py  |   16 +-
 plugin.video.pbs/addon.xml                         |    2 +-
 plugin.video.pbs/changelog.txt                     |    8 +-
 plugin.video.pbs/default.py                        |   29 ++--
 .../resources/language/English/strings.xml         |    2 +-
 plugin.video.pbs/resources/settings.xml            |    2 +-
 plugin.video.tv5monde/addon.xml                    |   14 +-
 plugin.video.tv5monde/changelog.txt                |   38 ++--
 plugin.video.tv5monde/default.py                   |  198 ++++++++++++++++++--
 plugin.video.tv5monde/lutil.py                     |   65 ++++---
 16 files changed, 302 insertions(+), 281 deletions(-)
 delete mode 100644 plugin.video.neterratv/.gitattributes
 delete mode 100644 plugin.video.neterratv/.gitignore


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to