The branch, frodo has been updated
       via  128cfbef89f6ab4000b28d4633ebc4d2f73fb718 (commit)
       via  bbc0153f91f8939f12b1e4eadc7cd5e7adf635f8 (commit)
       via  22a8b290bd00388e76dc1574d0252a0c0eb7dc4a (commit)
       via  cbec75b2c8ded3bdb0dc8d5a40a8970a29b493f1 (commit)
      from  9a7eee919d4967c417cdef333fb50f5097794dc8 (commit)

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

commit 128cfbef89f6ab4000b28d4633ebc4d2f73fb718
Author: Martijn Kaijser <[email protected]>
Date:   Sat Aug 9 11:15:27 2014 +0200

    [plugin.video.popcorntv] 1.0.8

diff --git a/plugin.video.popcorntv/addon.xml b/plugin.video.popcorntv/addon.xml
index 790d6d4..5694e30 100644
--- a/plugin.video.popcorntv/addon.xml
+++ b/plugin.video.popcorntv/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.popcorntv"
        name="PopcornTv"
-       version="1.0.7"
+       version="1.0.8"
        provider-name="Nightflyer">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.video.popcorntv/changelog.txt 
b/plugin.video.popcorntv/changelog.txt
index 9d5a476..ae106be 100644
--- a/plugin.video.popcorntv/changelog.txt
+++ b/plugin.video.popcorntv/changelog.txt
@@ -1,3 +1,8 @@
+[B]1.0.8[/B]
+- Updated page parsing because of upstream HTML changes.
+- Show title and thumbnail during play using video metadata.
+- Minor fixes.
+
 [B]1.0.7[/B]
 - added English description and summary in addon.xml
 
diff --git a/plugin.video.popcorntv/default.py 
b/plugin.video.popcorntv/default.py
index 06a46db..b2b8751 100644
--- a/plugin.video.popcorntv/default.py
+++ b/plugin.video.popcorntv/default.py
@@ -63,9 +63,11 @@ def show_video_files(url):
 
 def play_video(url):
     popcorntv = PopcornTV()
-    #video_url = popcorntv.getVideoURL(popcorntv.getSmilUrl(url))
-    video_url = popcorntv.getAndroidVideoURL(popcorntv.getSmilUrl(url))
-    xbmc.Player().play(video_url)
+    metadata = popcorntv.getVideoMetadata(url)
+    #video_url = popcorntv.getVideoURL(metadata["smilUrl"])
+    video_url = popcorntv.getAndroidVideoURL(metadata["smilUrl"])
+    liStyle=xbmcgui.ListItem(metadata["title"], 
thumbnailImage=metadata["thumb"])
+    xbmc.Player().play(video_url, liStyle)
     
 # parameter values
 params = parameters_string_to_dict(sys.argv[2])
diff --git a/plugin.video.popcorntv/resources/lib/popcorntv.py 
b/plugin.video.popcorntv/resources/lib/popcorntv.py
index bf5affb..57f118a 100644
--- a/plugin.video.popcorntv/resources/lib/popcorntv.py
+++ b/plugin.video.popcorntv/resources/lib/popcorntv.py
@@ -1,8 +1,5 @@
-import sys
-import urllib
 import urllib2
 import urlparse
-import httplib
 import re
 from BeautifulSoup import BeautifulSoup
 from BeautifulSoup import BeautifulStoneSoup
@@ -124,13 +121,25 @@ class PopcornTV:
         
         return videos
 
-    def getSmilUrl(self, pageUrl):
-        htmlData = urllib2.urlopen(pageUrl).read()
+    def getVideoMetadata(self, pageUrl):
+        metadata = {}
         
-        
match=re.compile('PlayVideoDettaglio\("vplayer","768","432","(.+?)"').findall(htmlData)
-        url = match[0]
+        data = urllib2.urlopen(pageUrl).read()
+        htmlTree = BeautifulSoup(data, 
convertEntities=BeautifulSoup.HTML_ENTITIES)
         
-        return url
+        metadata["title"] = htmlTree.find('meta', {"property": 
"og:title"})['content']
+        metadata["thumb"] = htmlTree.find('meta', {"property": 
"og:image"})['content']
+        metadata["plot"] = htmlTree.find('meta', {"property": 
"og:description"})['content']
+        try:
+            # Not all the pages have the following metadata yet!
+            metadata["smilUrl"] = htmlTree.find('meta', {"property": 
"og:video"})['content']
+        except TypeError:
+            match=re.compile('\("vplayer","768","432","(.+?)"').findall(data)
+            metadata["smilUrl"] = match[0]
+        # Remove spaces from smil URL
+        metadata["smilUrl"] = metadata["smilUrl"].replace(" ","")
+        
+        return metadata
         
     def getVideoURL(self, smilUrl):
         data = urllib2.urlopen(smilUrl).read()

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

commit bbc0153f91f8939f12b1e4eadc7cd5e7adf635f8
Author: Martijn Kaijser <[email protected]>
Date:   Sat Aug 9 11:14:41 2014 +0200

    [plugin.video.schaetzederwelt] 2.0.0

diff --git a/plugin.video.schaetzederwelt/README.md 
b/plugin.video.schaetzederwelt/README.md
index d4c72ce..fbefb6d 100644
--- a/plugin.video.schaetzederwelt/README.md
+++ b/plugin.video.schaetzederwelt/README.md
@@ -5,16 +5,12 @@ Schaetze der Welt / Treasures of the World is an XBMC addon 
that gives you acces
 
 Supported platforms
 -------------------
-XBMC Frodo (Linux, Windows, raspBMC 12.2013)
+XBMC (Linux, Windows, raspBMC, ...)
 
 
 Current Features
 ----------------
-* Episodes ordered by continent
-* Episodes ordered alphabetically
-* Specials
-* Comfortable browsing experience based on cached menu navigation
-* Selective purge of navigation cache per context menu
+* All episodes ordered by country
 
 
 Further information
diff --git a/plugin.video.schaetzederwelt/addon.py 
b/plugin.video.schaetzederwelt/addon.py
index 2e3144c..e4c59a5 100644
--- a/plugin.video.schaetzederwelt/addon.py
+++ b/plugin.video.schaetzederwelt/addon.py
@@ -37,33 +37,12 @@ from xbmcswift2 import Plugin, xbmcgui
 from resources.lib import htmlscraper
 import string
 
-
-MAIN_MENU_TOPICS = [
-     {'label': 'afrika', 'endpoint' : 'topic', 'path' : 'afrika'},
-     {'label': 'amerika', 'endpoint' : 'topic', 'path' : 'amerika'},
-     {'label': 'asien', 'endpoint' : 'topic', 'path' : 'asien'},
-     {'label': 'australien-ozeanien', 'endpoint' : 'topic', 'path' : 
'australien-ozeanien'},
-     {'label': 'europa', 'endpoint' : 'topic', 'path' : 'europa'},
-     {'label': 'spezial', 'endpoint' : 'topic', 'path' : 'spezial'},
-     {'label': 'a_to_z_menu', 'endpoint' : 'a_to_z_menu', 'path' : ''}
-]
-
-
 plugin = Plugin()
 
 
 I18NINDEX = { 
-             'afrika' : 30001,
-             'amerika' : 30002,
-             'asien' : 30003,
-             'australien-ozeanien' : 30004,
-             'europa' : 30005,
-             'spezial' : 30006,
-             'a_to_z_menu' : 30007,
              'video_not_online' : 30008,
-             'clear_cache' : 30009,
-             'cache_cleared' : 30010,
-             'toggle_watched' : 30011
+             'toggle_watched' : 30011,
              }
 
 def get_localized_string(label):
@@ -72,69 +51,19 @@ def get_localized_string(label):
 
 @plugin.route('/')
 def index():
-    items = [{'label' : get_localized_string(item['label']), 
-              'path' : plugin.url_for(endpoint = item['endpoint'], path = 
item['path'])} for item in MAIN_MENU_TOPICS]
-    
-    for item in items:
-        item['context_menu'] = [(get_localized_string('clear_cache'), 
'XBMC.RunPlugin(%s)' % plugin.url_for(endpoint = 'clear_cache', path = 
item['path']))]
-    return plugin.finish(items)
-
[email protected]('/topic/<path>')
-def topic(path):
-    if (len(plugin.get_storage(path).items()) == 0):
-        plugin.log.info("Cache is empty for items in topic " + path)         
-        # Cache items
-        if (path in string.ascii_uppercase):
-            plugin.get_storage(path)['items'] = 
htmlscraper.scrape_a_to_z_per_regex(path, plugin.url_for, 'play_video', 
get_localized_string)
-        else:
-            plugin.get_storage(path)['items'] = 
htmlscraper.scrape_topic_per_regex(path, plugin.url_for, 'play_video', 
get_localized_string)
-        #plugin.log.info(str(path) + " stored in cache")
-    else:
-        plugin.log.info(str(path) + " items retrieved from cache")
-         
-    items =  plugin.get_storage(path)['items']
-    return plugin.finish(items)
-
-
[email protected]('/atozmenu/')  
-def a_to_z_menu():
-    items = [{'label': le, 
-              'path': plugin.url_for('topic', path=le)
-            } for le in string.ascii_uppercase ]
-    #items.append({'label': '0-9', 'path': plugin.url_for('a_to_z', 
letter='0-9')})    
-    return plugin.finish(items)
-
-
[email protected]('/video/<url>')
-def play_video(url):
-    videolink = htmlscraper.get_video_from_url("http.*l\.mp4", url)
-    if (videolink != None):
-        plugin.log.info("Playing url: %s" % videolink)
-        plugin.set_resolved_url(videolink)
+    return (htmlscraper.build_menuitems(plugin.url_for, 'play_video', 
get_localized_string))
+
[email protected]('/video/<ekey>')
+def play_video(ekey):
+    item = htmlscraper.get_json_for_ekey(ekey)
+    if (item['url'] != None):
+        plugin.log.info("Playing url: %s" % item['url'])
+        plugin.set_resolved_url(item['url'])
     else:
-        plugin.log.info("videolink is None")
+        plugin.log.info("url is None")
         xbmcgui.Dialog().ok(plugin.name, 
get_localized_string("video_not_online"))
         return plugin.finish()
 
 
[email protected]('/clear_cache/<path>')  
-def clear_cache(path):
-    token = path.split('/')
-    
-    if (token[-1] == "?path="):
-        # path is empty for Index item
-        for path in string.ascii_uppercase:
-            plugin.get_storage(path).clear()
-        menuitem = 'a_to_z_menu'
-    else:
-        plugin.get_storage(token[-1]).clear()
-        menuitem = token[-1]
-            
-    plugin.log.info("Cache cleared for: %s" % menuitem)
-    message = get_localized_string("cache_cleared") + ' \'' + 
get_localized_string(menuitem) + '\'.'  
-    xbmcgui.Dialog().ok(plugin.name, message)
-    return plugin.redirect(plugin.url_for('index'))
-
-
 if __name__ == '__main__':
     plugin.run()
diff --git a/plugin.video.schaetzederwelt/addon.xml 
b/plugin.video.schaetzederwelt/addon.xml
index 8c9873d..e14e134 100644
--- a/plugin.video.schaetzederwelt/addon.xml
+++ b/plugin.video.schaetzederwelt/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.schaetzederwelt" name="Schaetze-der-Welt.de" 
version="1.0.1" provider-name="CHF">
+<addon id="plugin.video.schaetzederwelt" name="Schaetze-der-Welt.de" 
version="2.0.0" provider-name="CHF">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
     <import addon="script.module.xbmcswift2" version="2.4.0"/>
diff --git a/plugin.video.schaetzederwelt/changelog.txt 
b/plugin.video.schaetzederwelt/changelog.txt
index 345d57f..4b11de2 100644
--- a/plugin.video.schaetzederwelt/changelog.txt
+++ b/plugin.video.schaetzederwelt/changelog.txt
@@ -1,3 +1,7 @@
+v2.0.0
+* Complete redesign (Menu, Parsing, ...)
+* No need for caching anymore
+
 v1.0.1
 * Improvements to get rid of timeout-problems opening URLs: catch timeout and 
retry urlopen() several times  
 * Caching Main Page to reduce redundant requests to get the topic URLs. 
@@ -8,15 +12,9 @@ v1.0.1
 * Videos Context menu: Toggle button watched / unwatched
 * unified logging instead of print()
 
-
-Current Features
-----------------
+v1.0.0
 * Episodes ordered by continent
 * Episodes ordered alphabetically
 * Specials
 * Comfortable browsing experience based on cached menu navigation
-* Selective purge of navigation cache per context menu
-
-
-v1.0.0
-- Initial version 
+* Selective purge of navigation cache per context menu 
diff --git 
a/plugin.video.schaetzederwelt/resources/language/English/strings.xml 
b/plugin.video.schaetzederwelt/resources/language/English/strings.xml
index 230fb08..bdab370 100644
--- a/plugin.video.schaetzederwelt/resources/language/English/strings.xml
+++ b/plugin.video.schaetzederwelt/resources/language/English/strings.xml
@@ -1,16 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <strings>
   <!-- Plugin name -->
-  <string id="30000">Treasures of the World</string>
-  <string id="30001">Africa</string>
-  <string id="30002">America</string>
-  <string id="30003">Asia</string>
-  <string id="30004">Australia / Ozeania</string>
-  <string id="30005">Europe</string>
-  <string id="30006">Specials</string>
-  <string id="30007">A to Z Index</string>
   <string id="30008">Video is not available.</string>
-  <string id="30009">Clear menu item cache</string>
-  <string id="30010">Cache cleared for item </string>
   <string id="30011">watched / unwatched</string>  
 </strings>
diff --git a/plugin.video.schaetzederwelt/resources/language/German/strings.xml 
b/plugin.video.schaetzederwelt/resources/language/German/strings.xml
index ca2c866..236e7ed 100644
--- a/plugin.video.schaetzederwelt/resources/language/German/strings.xml
+++ b/plugin.video.schaetzederwelt/resources/language/German/strings.xml
@@ -1,16 +1,6 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <strings>
   <!-- Plugin name -->
-  <string id="30000">Schätze der Welt</string>
-  <string id="30001">Afrika</string>
-  <string id="30002">Amerika</string>
-  <string id="30003">Asien</string>
-  <string id="30004">Australien / Ozeanien</string>
-  <string id="30005">Europa</string>
-  <string id="30006">Spezial</string>
-  <string id="30007">Index von A bis Z</string>
   <string id="30008">Dieses Video ist zur Zeit nicht online.</string>
-  <string id="30009">Menucache bereinigen</string>
-  <string id="30010">Cache bereinigt für Menueintrag</string>  
   <string id="30011">gesehen / nicht gesehen</string>
 </strings>
diff --git a/plugin.video.schaetzederwelt/resources/lib/htmlscraper.py 
b/plugin.video.schaetzederwelt/resources/lib/htmlscraper.py
index 74179c4..30e5fb4 100644
--- a/plugin.video.schaetzederwelt/resources/lib/htmlscraper.py
+++ b/plugin.video.schaetzederwelt/resources/lib/htmlscraper.py
@@ -37,68 +37,106 @@ from urllib2 import urlopen, Request
 import logging
 import re
 import socket
+import json
 
-MAIN_URL = "http://www.swr.de/schaetze-der-welt/";
+BASE_URL = 'http://swrmediathek.de'
+MAIN_URL = 
"http://swrmediathek.de/tvshow.htm?show=945f9950-cc74-11df-9bbb-0026b975f2e6";
+EKEY_URL = "http://swrmediathek.de/AjaxEntry?ekey=";
 REQUEST_HEADERS = {"User-Agent" : "Mozilla/4.0 (compatible; MSIE 5.5; Windows 
NT)"}
 SOCKET_TIMEOUT = 30
 MAIN_PAGE_CACHE = None
 MAX_TIMEOUT_RETRIES = 20
 logger = logging.getLogger('plugin.video.schaetzederwelt')
-
-def scrape_topic_per_regex(topic, url_for, endpoint, localizer):
-    log_info("Scraping " + topic)
-    page = 
get_content_from_url(get_actual_from_baseurl("http://www.swr.de/schaetze-der-welt/";
 + topic + "/.*.html"))
-           
-    pattern = re.compile('teaser teaser-08 schaetze-der-welt\">(\n| )*<h2>(\n| 
)*<a href=\"(?P<url>.*)\">(\n| )*<img.*src=\"(?P<img>.*.jpg)\".*/>(\n| )*\t(\n| 
)*<span.*>(?P<titel1>(.*\n.*|.*)) *</span>(\n| 
)*<span.*>(?P<titel2>(.*\n.*|.*)) *</span>(\n| )*</a.*(\n| )*</h2.*(\n| 
)*<div.*(\n| )*<p>(?P<desc>.*)(\n| )*<a')    
-    log_info("RegEx processed, gathering videos...")
-            
-    items = [{
-             # Kurztext, Titel
-             'label': m.group('titel1').decode('utf-8', 'ignore') + ', ' + 
m.group('titel2').decode('utf-8', 'ignore'),
-             # URL fuer die Videoseite
-             'path' : url_for(endpoint, url=m.group('url')),
-             # Bild
-             'thumbnail' : m.group('img'),
-             'icon' : m.group('img'),
-             #'fanart_image' : './fanart.jpg',
-             # Beschreibung
-             'info' : { 'plot' : m.group('desc')},
-             # Add watch toggle button manually
-             'context_menu' : [(localizer('toggle_watched'), 
'XBMC.Action(ToggleWatched)')],
-             'is_playable' : True
-            } for m in pattern.finditer(page)]
+kontinente_und_anderes = ['Europa', 'Afrika', 'Amerika', 'Australien', 
'Asien', 'Pazifik']
+ 
+     
+def build_menuitems(url_for, endpoint, localizer):
+    
+    #log_info("Oeffne Showseite ...")
+    page = get_content_from_url(MAIN_URL)
+    
+    #log_info("Hole alle Ids der einzelnen Sendungen ...")
+    pattern = regex_pattern_for_items()
+    
+    items = []
+    for match in pattern.finditer(page):
+        item = {'label' : 
enrich_title(match.group('title').decode('utf-8')).strip(),
+                'thumbnail' : BASE_URL + match.group('img'),
+                'icon' : BASE_URL + match.group('img'),
+                'path' : url_for(endpoint, ekey=match.group('ekey')),
+                'context_menu' : [(localizer('toggle_watched'), 
'XBMC.Action(ToggleWatched)')],
+                'is_playable' : True
+                }
+        items.append(item)
     
-    log_info(str(len(items)) + " Videos gathered.")
     items.sort(key=lambda video: video['label'])
+    log_info("Anzahl Videos: " + str(len(items)))
+    #log_info("Videos: " + str(items))
     return items
 
 
-def scrape_a_to_z_per_regex(letter, url_for, endpoint, localizer):
-    log_info("Scraping " + letter)
-    page = 
get_content_from_url(get_actual_from_baseurl("http://www.swr.de/schaetze-der-welt/denkmaeler/.*.html";))
-    pattern = re.compile('<p><a name=\"' + letter + '\"></a>' + letter + 
'</p>\n *<ul>\n *(<li><a href=\".*\".*</a></li>\n *)*')
-    erg = pattern.search(page)    
-    pattern2 = re.compile('<li><a href=\"(?P<url>.*)\">(?P<text>.*)</a></li>')
-    log_info("RexEx processed, gathering monuments for letter " + letter)
-    #log_info(pattern2.findall(page, erg.start(), erg.end()))    
+def regex_pattern_for_items():
+    return re.compile('<a 
href=\"/player.htm\?show=(?P<ekey>[a-z0-9-]*)\">[\n\t]*<img 
src=\"(?P<img>.*)\"[\n\t ]*alt=\".*\"[\n\t ]*title=\"(?P<title>.*)\"[\n\t ]*/>')
+
+
+def enrich_title(title):
+    match = re.match('.*, (?P<land>.*), Folge', title)
+    if (match is not None):
+        land = match.group('land')
+        #log_info("Land: " + land)
+    else:
+        land = 'ungeordnet'
+    #return '{0}: {1}'.format(land, title).encode('utf-8')
+    return land + ' - ' + title
     
-    items = [{
-             # Kurztext, Titel
-             'label': m.group(2).decode('utf-8', 'ignore'),
-             # URL fuer die Videoseite
-             'path' : url_for(endpoint, url=m.group(1)),
-             # Bild
-             'thumbnail' : '',
-             'icon' : '', 
-             # Beschreibung
-             'info' : '',
-             'context_menu' : [(localizer('toggle_watched'), 
'XBMC.Action(ToggleWatched)')],
-             'is_playable' : True  
-            } for m in pattern2.finditer(page, erg.start(), erg.end())]    
     
-    log_info(str(len(items)) + " monuments gathered.")
-    return items
+def get_json_for_ekey(ekey):
+    # TODO: auf get_content_from_url umstellen, aber: return response.read() 
umstellen auf return response
+    log_info("Lese ekey JSON: " + ekey)
+    request = Request(EKEY_URL + ekey, headers = REQUEST_HEADERS)
+    response = urlopen(request, timeout = SOCKET_TIMEOUT)
+    json_object = json.load(response)
+    log_info("Title: " + 
str(json_object['attr']['entry_title'].encode('utf-8')))
+    # desc: Regex: 'entry_descl'
+    #log_info("descr: " + json_object['attr']['entry_descl'])
+    # image: entry_image_16_9
+    #log_info("img: " + json_object['attr']['entry_image_16_9'])    
+    # url: {"val0":"h264","val1":"3" - hochauflösend bzw. regex: 'rmtp ... 
l.mp4'
+    #url = re.match('.*(?P<url>rtmp.*\.l\.mp4)', str(json_object['sub']))
+    #log_info("url: " + url.group('url'))
+    
+    # Listen durchsuchen: s.a. 
http://stackoverflow.com/questions/9542738/python-find-in-list
+    # Kontinent:
+    # Suche nach Europa, Amerika, Asien, Australien, Ozeanien, Afrika
+    # Liste traversieren: Wenn Atrtribut name == entry_keywd
+    kontinent = None
+    for item in json_object['sub']:
+        if(item['name'] == 'entry_keywd' and kontinent is None):
+            #log_info("item['attr']['val']" + item['attr']['val'])
+            if (item['attr']['val'] in kontinente_und_anderes):
+                kontinent = item['attr']['val']
+        elif(item['name'] == 'entry_media'):            
+            if (item['attr']['val0'] == 'h264' and item['attr']['val1'] == 
'3'):
+               url =  item['attr']['val2']
+            
 
+    if (kontinent is None):
+        kontinent = ''
+    log_info("Kontinent: " + kontinent)
+    log_info("url: " + url)
+    
+    # Land:
+    # Suche in Titel nach 'Folge', davor kommt das Land, wenn nicht, dann leer 
lassen
+    match = re.match('.* (?P<land>.*), Folge', 
str(json_object['attr']['entry_title'].encode('utf-8')))
+    if (match is not None):
+        land = match.group('land')
+        log_info("Land: " + land)
+    else:
+        land = ''
+    
+    return {'ekey':ekey, 'label':json_object['attr']['entry_title'], 
'url':url, 'land':land, 'kontinent':kontinent, 
'img':json_object['attr']['entry_image_16_9']}
+
+  
 
 def get_content_from_url(url):
     request = Request(url, headers = REQUEST_HEADERS)
@@ -124,30 +162,6 @@ def get_content_from_url(url):
     return response.read()
 
 
-def get_actual_from_baseurl(regexp):
-    global MAIN_PAGE_CACHE
-    
-    if (MAIN_PAGE_CACHE == None):
-        log_debug("Filling MAIN_PAGE_CACHE")                       
-        MAIN_PAGE_CACHE = get_content_from_url(MAIN_URL)
-    
-    log_debug("using MAIN_PAGE_CACHE")
-    actual_url=re.search(regexp, MAIN_PAGE_CACHE)
-    if (actual_url != None):
-        return actual_url.group(0)
-    else:
-        return None
-
-
-def get_video_from_url(regexp, url):                           
-    page = get_content_from_url(url)    
-    video_url=re.search(regexp, page)
-    if (video_url != None):        
-        return video_url.group(0)
-    else:
-        return None
-
-
 def log_info(msg):
     logger.info('HtmlScraper: %s' % msg)
 

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

commit 22a8b290bd00388e76dc1574d0252a0c0eb7dc4a
Author: Martijn Kaijser <[email protected]>
Date:   Sat Aug 9 11:13:37 2014 +0200

    [plugin.video.raitv] 1.0.10

diff --git a/plugin.video.raitv/addon.xml b/plugin.video.raitv/addon.xml
index 1ad1fcd..882e602 100644
--- a/plugin.video.raitv/addon.xml
+++ b/plugin.video.raitv/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.raitv"
        name="Rai On Demand"
-       version="1.0.9"
+       version="1.0.10"
        provider-name="Nightflyer">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
diff --git a/plugin.video.raitv/changelog.txt b/plugin.video.raitv/changelog.txt
index 78bcaca..6535153 100644
--- a/plugin.video.raitv/changelog.txt
+++ b/plugin.video.raitv/changelog.txt
@@ -1,3 +1,11 @@
+[B]1.0.10[/B]
+- Force replay availability for Rai Gulp and Rai YoYo.
+- Better stream selection in RAI Replay. Plot is now shown too.
+- Show RAI Replay dates starting from yesterday.
+- Use bigger logo thumbnails in Dirette TV and RAI Replay.
+- Normalize relinker URLs if not properly encoded. Now "Sereno Variabile" 
works.
+- Minor fixes.
+
 [B]1.0.9[/B]
 - fixed RAI relinker (closes #7).
 
diff --git a/plugin.video.raitv/default.py b/plugin.video.raitv/default.py
index 59ba234..9fe3622 100644
--- a/plugin.video.raitv/default.py
+++ b/plugin.video.raitv/default.py
@@ -8,6 +8,7 @@ import xbmcaddon
 import urllib
 import urlparse
 import datetime
+import StorageServer
 from resources.lib.tgr import TGR
 from resources.lib.search import Search
 from resources.lib.onair import onAir
@@ -27,6 +28,11 @@ Addon = xbmcaddon.Addon(id=__plugin__)
 # plugin handle
 handle = int(sys.argv[1])
 
+# Cache channels for 1 hour
+cache = StorageServer.StorageServer("plugin.video.raitv", 0) # (Your plugin 
name, Cache time in hours)
+tv_stations = cache.cacheFunction(stations.get_tv_stations)
+radio_stations = cache.cacheFunction(stations.get_radio_station)
+
 # utility functions
 def parameters_string_to_dict(parameters):
     ''' Convert parameters encoded in a URL to a dict. '''
@@ -142,16 +148,16 @@ def play(title, url, thumbailUrl="", uniquename="", 
mediatype="RaiTv Media Video
     xbmc.Player().play(url, item)
 
 def show_tv_channels():
-    for station in stations.tv_stations:
+    for station in tv_stations:
         if station["diretta"] == "YES":
-            liStyle = xbmcgui.ListItem(station["name"])
+            liStyle = xbmcgui.ListItem(station["name"], 
thumbnailImage=station["icon"])
             addLinkItem({"mode": "play",
                 "title": station["name"],
                 "url": station["direttaLink"]}, liStyle)
     xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
 
 def show_radio_stations():
-    for station in stations.radio_stations:
+    for station in radio_stations:
         liStyle = xbmcgui.ListItem(station["nome"], 
thumbnailImage=station["logo_menu"])
         addLinkItem({"mode": "play",
             "title": station["nome"],
@@ -159,9 +165,9 @@ def show_radio_stations():
     xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
 
 def show_replay_channels():
-    for station in stations.tv_stations:
+    for station in tv_stations:
         if station["hasReplay"] == "YES":
-            liStyle = liStyle = xbmcgui.ListItem(station["name"], 
thumbnailImage=station["icon"].replace(".png", "-big.png"))
+            liStyle = xbmcgui.ListItem(station["name"], 
thumbnailImage=station["icon"])
             addDirectoryItem({"mode": "replay",
                 "channel_id": station["id"]}, liStyle)
     xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
@@ -184,10 +190,10 @@ def show_replay_dates(channelId):
 def show_replay_epg(channelId, date):
     replay = Replay()
     
-    channelName = ""
-    for station in stations.tv_stations:
+    for station in tv_stations:
         if station["id"] == channelId:
             channelTag = station["tag"]
+            break
     
     programmes = replay.getProgrammes(channelId, channelTag, date)
     
@@ -195,22 +201,47 @@ def show_replay_epg(channelId, date):
     timetable = utils.sortedDictKeys(programmes)
 
     for entry in timetable:
-        if programmes[entry]["h264"] == "":
-            # program is not available
-            title = entry + " " + programmes[entry]["t"]
-            liStyle = xbmcgui.ListItem(title,
-                thumbnailImage=programmes[entry]["image"])
+        recording = programmes[entry]
+                
+        title = recording["t"]
+        
+        if recording["d"] != "":
+            plot = recording["d"]
+        else:
+            plot = None
+        
+        if recording["image"] != "":
+            thumbnail = recording["image"]
+        else:
+            thumbnail = None
+    
+        if recording["urlTablet"] != "":
+            videoUrl = recording["urlTablet"]
+        elif recording["h264"] != "":
+            videoUrl = recording["h264"]
+        else:
+            videoUrl = None
+        
+        if videoUrl is None:
+            # programme is not available
+            liStyle = xbmcgui.ListItem(entry + " " + title,
+                thumbnailImage=thumbnail)
+            liStyle.setInfo(type="Video", infoLabels={"Title" : title,
+                "Label": title,
+                "Plot": plot})
             addLinkItem({"mode": "nop",
-                "title": programmes[entry]["t"].encode('utf8'),
-                "thumbnail": programmes[entry]["image"]}, liStyle)
+                "title": title.encode('utf8'),
+                "thumbnail": thumbnail}, liStyle)
         else:
-            title = "[COLOR blue]" + entry + " " + programmes[entry]["t"] + 
"[/COLOR]"
-            liStyle = xbmcgui.ListItem(title,
-                thumbnailImage=programmes[entry]["image"])
+            liStyle = xbmcgui.ListItem("[COLOR blue]" + entry + " " + title + 
"[/COLOR]",
+                thumbnailImage=thumbnail)
+            liStyle.setInfo(type="Video", infoLabels={"Title" : title,
+                "Label": title,
+                "Plot": plot})
             addLinkItem({"mode": "play",
-                "title": programmes[entry]["t"].encode('utf8'),        
-                "url": programmes[entry]["h264"],
-                "thumbnail": programmes[entry]["image"]}, liStyle)
+                "title": title.encode('utf8'),
+                "url": videoUrl,
+                "thumbnail": thumbnail}, liStyle)
     xbmcplugin.endOfDirectory(handle=handle, succeeded=True)
 
 def show_ondemand_root():
diff --git a/plugin.video.raitv/resources/lib/onair.py 
b/plugin.video.raitv/resources/lib/onair.py
index 0ec57a1..aacc279 100644
--- a/plugin.video.raitv/resources/lib/onair.py
+++ b/plugin.video.raitv/resources/lib/onair.py
@@ -1,7 +1,4 @@
-import sys
-import urllib
 import urllib2
-import httplib
 import json
 from StringIO import StringIO
 
diff --git a/plugin.video.raitv/resources/lib/ondemand.py 
b/plugin.video.raitv/resources/lib/ondemand.py
index d63560c..1fb3915 100644
--- a/plugin.video.raitv/resources/lib/ondemand.py
+++ b/plugin.video.raitv/resources/lib/ondemand.py
@@ -1,8 +1,5 @@
 # -*- coding: utf-8 -*-
-import sys
-import urllib
 import urllib2
-import re
 import json
 from operator import itemgetter
 from xml.dom import minidom
diff --git a/plugin.video.raitv/resources/lib/relinker.py 
b/plugin.video.raitv/resources/lib/relinker.py
index 9bff547..af9fe8b 100644
--- a/plugin.video.raitv/resources/lib/relinker.py
+++ b/plugin.video.raitv/resources/lib/relinker.py
@@ -1,5 +1,5 @@
+import urllib
 import urllib2
-import re
 
 class Relinker:
     # Rai.tv android app
@@ -27,7 +27,12 @@ class Relinker:
         # A stream will be returned depending on the UA (and pl parameter?)
         url = url + "&output=20"
         print "Relinker URL: %s" % url
+        
         response = urllib2.urlopen(url)
         mediaUrl = response.read().strip()
+        
+        # Workaround to normalize URL if the relinker doesn't
+        mediaUrl = urllib.quote(mediaUrl, safe="%/:=&?~#+!$,;'@()*[]")
+        
         return mediaUrl
         
\ No newline at end of file
diff --git a/plugin.video.raitv/resources/lib/replay.py 
b/plugin.video.raitv/resources/lib/replay.py
index b17c867..09b35b5 100644
--- a/plugin.video.raitv/resources/lib/replay.py
+++ b/plugin.video.raitv/resources/lib/replay.py
@@ -1,4 +1,3 @@
-import urllib
 import urllib2
 import json
 
diff --git a/plugin.video.raitv/resources/lib/stations.py 
b/plugin.video.raitv/resources/lib/stations.py
index a125883..3fad7b1 100644
--- a/plugin.video.raitv/resources/lib/stations.py
+++ b/plugin.video.raitv/resources/lib/stations.py
@@ -1,19 +1,26 @@
 import urllib2
 import json
-import StorageServer
 
 def get_tv_stations():
     url = 
"http://www.rai.tv/dl/RaiTV/iphone/android/smartphone/advertising_config.html";
     response = json.load(urllib2.urlopen(url))
-    return response["Channels"]
+    channels = response["Channels"]
+    
+    for channel in channels:
+        channel["icon"] = channel["icon"].replace(".png", "-big.png")
+        
+        # Force replay availability for Rai Gulp and Rai YoYo
+        if channel["name"] in ("Rai Gulp", "Rai Yoyo"):
+            channel["hasReplay"] = "YES"
+            
+        # Fix tag for Rai Gulp
+        if channel["name"] == "Rai Gulp":
+            channel["tag"] = "RaiGulp"
+    
+    return channels
     
 def get_radio_station():
     url = "http://www.rai.tv/dl/RadioRai/config_json.html";
     response = json.load(urllib2.urlopen(url))
     return response["canali"]
 
-# Cache channels for 1 hour
-cache = StorageServer.StorageServer("plugin.video.raitv", 1) # (Your plugin 
name, Cache time in hours)
-
-tv_stations = cache.cacheFunction(get_tv_stations)
-radio_stations = cache.cacheFunction(get_radio_station)
diff --git a/plugin.video.raitv/resources/lib/tgr.py 
b/plugin.video.raitv/resources/lib/tgr.py
index 98ce516..69d230b 100644
--- a/plugin.video.raitv/resources/lib/tgr.py
+++ b/plugin.video.raitv/resources/lib/tgr.py
@@ -1,7 +1,4 @@
-import sys
-import urllib
 import urllib2
-import httplib
 from xml.dom import minidom
 
 class TGR:
diff --git a/plugin.video.raitv/resources/lib/utils.py 
b/plugin.video.raitv/resources/lib/utils.py
index fbb653e..d724e1b 100644
--- a/plugin.video.raitv/resources/lib/utils.py
+++ b/plugin.video.raitv/resources/lib/utils.py
@@ -7,4 +7,4 @@ def sortedDictKeys(adict):
 
 def daterange(start_date, end_date):
     for n in range((end_date - start_date).days + 1):
-        yield start_date + datetime.timedelta(n)
+        yield end_date - datetime.timedelta(n)

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

commit cbec75b2c8ded3bdb0dc8d5a40a8970a29b493f1
Author: Martijn Kaijser <[email protected]>
Date:   Sat Aug 9 11:12:52 2014 +0200

    [plugin.video.newyorktimes] 1.4.3

diff --git a/plugin.video.newyorktimes/addon.py 
b/plugin.video.newyorktimes/addon.py
index 8e72d03..20e310d 100755
--- a/plugin.video.newyorktimes/addon.py
+++ b/plugin.video.newyorktimes/addon.py
@@ -20,6 +20,8 @@ settings = xbmcaddon.Addon(id='plugin.video.newyorktimes')
 #
 ###
 
+import re
+
 plugin = Plugin()
 
 
@@ -57,8 +59,11 @@ def update_url_for_rtmp(url, XXL4HIRES):
     For brightcove urls, the playpath is after the '&'.
 
     '''
-    if XXL4HIRES == 'true': url=url.replace('_xl_','_xxl_')
-    ###print "XXL4HIRES = " + XXL4HIRES + " url = " + url
+    # 201408: new renditions (video resolutions) have been added... and FLVURL 
is anchored to 3g resolution (?)
+    #         maybe in the future renditions[] should be parsed and resolution 
selected by "encodingRate".
+    url = re.sub(r'^(.+_wg_16x9)_.+_.+_.+\.mp4$', r'\1_xl_bb_mm.mp4', url)
+    if XXL4HIRES == 'true': 
+        url=url.replace('_xl_bb_mm.mp4','_xxxl_hb_mm.mp4') 
     if url.startswith('rtmp'):
         return '%s playpath=%s' % (url, url.split('&', 1)[1])
     return url
diff --git a/plugin.video.newyorktimes/addon.xml 
b/plugin.video.newyorktimes/addon.xml
index e5d7554..bf0694f 100644
--- a/plugin.video.newyorktimes/addon.xml
+++ b/plugin.video.newyorktimes/addon.xml
@@ -1,4 +1,4 @@
-<addon id="plugin.video.newyorktimes" name="New York Times" 
provider-name="Jonathan Beluch (jbel), idleloop" version="1.4.2">
+<addon id="plugin.video.newyorktimes" name="New York Times" 
provider-name="Jonathan Beluch (jbel), idleloop" version="1.4.3">
   <requires>
     <import addon="xbmc.python" version="2.1.0" />
     <import addon="script.module.beautifulsoup" version="3.2.0" />
diff --git a/plugin.video.newyorktimes/changelog.txt 
b/plugin.video.newyorktimes/changelog.txt
index 4110cb9..c04c429 100644
--- a/plugin.video.newyorktimes/changelog.txt
+++ b/plugin.video.newyorktimes/changelog.txt
@@ -1,3 +1,6 @@
+Version 1.4.3
+* changed video urls as per website changes
+
 Version 1.4 to 1.4.2
 * Update addon to reflect website changes
 
diff --git a/plugin.video.newyorktimes/resources/settings.xml 
b/plugin.video.newyorktimes/resources/settings.xml
index cce75b7..a1c3dec 100644
--- a/plugin.video.newyorktimes/resources/settings.xml
+++ b/plugin.video.newyorktimes/resources/settings.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="utf-8" standalone="yes"?>
 <settings>
-<setting id="xxl4hires" type="bool" label="Try to access (little) higher 
resolution videos" default="false"/>
+<setting id="xxl4hires" type="bool" label="Try to access higher resolution 
videos" default="false"/>
 </settings>

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

Summary of changes:
 plugin.video.newyorktimes/addon.py                 |    9 +-
 plugin.video.newyorktimes/addon.xml                |    2 +-
 plugin.video.newyorktimes/changelog.txt            |    3 +
 plugin.video.newyorktimes/resources/settings.xml   |    2 +-
 plugin.video.popcorntv/addon.xml                   |    2 +-
 plugin.video.popcorntv/changelog.txt               |    5 +
 plugin.video.popcorntv/default.py                  |    8 +-
 plugin.video.popcorntv/resources/lib/popcorntv.py  |   25 ++-
 plugin.video.raitv/addon.xml                       |    2 +-
 plugin.video.raitv/changelog.txt                   |    8 +
 plugin.video.raitv/default.py                      |   71 +++++++---
 plugin.video.raitv/resources/lib/onair.py          |    3 -
 plugin.video.raitv/resources/lib/ondemand.py       |    3 -
 plugin.video.raitv/resources/lib/relinker.py       |    7 +-
 plugin.video.raitv/resources/lib/replay.py         |    1 -
 plugin.video.raitv/resources/lib/stations.py       |   21 ++-
 plugin.video.raitv/resources/lib/tgr.py            |    3 -
 plugin.video.raitv/resources/lib/utils.py          |    2 +-
 plugin.video.schaetzederwelt/README.md             |    8 +-
 plugin.video.schaetzederwelt/addon.py              |   91 ++----------
 plugin.video.schaetzederwelt/addon.xml             |    2 +-
 plugin.video.schaetzederwelt/changelog.txt         |   14 +-
 .../resources/language/English/strings.xml         |   10 --
 .../resources/language/German/strings.xml          |   10 --
 .../resources/lib/htmlscraper.py                   |  158 +++++++++++---------
 25 files changed, 226 insertions(+), 244 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to