The branch, dharma-pre has been updated
       via  cd3e214ae08f14fa2cf0d6ca9b34462a2ff8aabd (commit)
      from  d130fda5657bab479b18d93623765725a019cda3 (commit)

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

commit cd3e214ae08f14fa2cf0d6ca9b34462a2ff8aabd
Author: spiff <[email protected]>
Date:   Sun Oct 10 15:31:07 2010 +0200

    [plugin.video.tagesschau] updated to version 0.1.2

diff --git a/plugin.video.tagesschau/addon.xml 
b/plugin.video.tagesschau/addon.xml
index 8fc350f..777c1d3 100644
--- a/plugin.video.tagesschau/addon.xml
+++ b/plugin.video.tagesschau/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <addon
   id="plugin.video.tagesschau"
-  version="0.1.1"
+  version="0.1.2"
   name="Tagesschau"
   provider-name="nevermore">
   <requires>
diff --git a/plugin.video.tagesschau/changelog.txt 
b/plugin.video.tagesschau/changelog.txt
index 0181df5..be0253a 100644
--- a/plugin.video.tagesschau/changelog.txt
+++ b/plugin.video.tagesschau/changelog.txt
@@ -1,8 +1,12 @@
+version 0.1.2:
+ * added encoding to python-file (thanks to Anssi)
+ * using high-quality video sources now 
+
 version 0.1.1:
-       - added icon.png (thanks to freezy)
-       - cosmetic changes (thanks to Arne)
+ * added icon.png (thanks to freezy)
+ * cosmetic changes (thanks to Arne)
 
 version 0.1.0:
-       - initial version
-       - includes only most recent Tagesschau, Tagesschau in 100 Sekunden
-         in low quality (fetched from podcast-RSS-feed of tagesschau.de)
+ * initial version
+ * includes only most recent Tagesschau, Tagesschau in 100 Sekunden
+   in low quality (fetched from podcast-RSS-feed of tagesschau.de)
diff --git a/plugin.video.tagesschau/tagesschau.py 
b/plugin.video.tagesschau/tagesschau.py
index cbfdbac..0b45e13 100644
--- a/plugin.video.tagesschau/tagesschau.py
+++ b/plugin.video.tagesschau/tagesschau.py
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 # Copyright 2010 Jörn Schumacher 
 #
 # This program is free software: you can redistribute it and/or modify
@@ -38,23 +39,40 @@ regexp['ts20h']['date'] = r'<title>tagesschau (.*)</title>'
 regexp['ts20h']['url'] = r'<enclosure url="(.*)"\slength.*'
 
 
-def video_file(name):
-    s = urllib2.urlopen(urls[name]).read()
 
-    # the _first_ item group
-    item = re.compile(r'<item>(?:.*\s)*</item>').findall(s)[0]
+def get_video_ts100s():
+    # config
+    url = 'http://www.tagesschau.de/multimedia/video/ondemand100.html'
+    pattern = r'<a href="(.*\.webl\.h264\.mp4)">.*</a>'
+    date_pattern = r'<span class="topline">(\S*)\s*(\S*)\s*Uhr</span>'
 
-    # date
-    date = re.compile(regexp[name]['date']).findall(item)[0]
-    if name == 'ts100s':
-        date = re.split('\s',date, 1)
-        date[0],date[1] = date[1],date[0]
-        date = ', '.join(date)
+    # parse the website
+    s = urllib2.urlopen(url).read()
+    video = re.compile(pattern).findall(s)[0]
 
-    # url
-    url = re.compile(regexp[name]['url']).findall(item)[0]
- 
-    return date, url
+    # fetch the date from the website
+    date = re.compile(date_pattern).findall(s)[0]
+    date = date[0]+', '+date[1]+' Uhr'
+
+    # return video+date
+    return date, video
+
+def get_video_ts20h():
+    # config
+    url = 'http://www.tagesschau.de/multimedia/video/ondemandarchiv100.html'
+    pattern = r'<a href="(.*\.webl\.h264\.mp4)">.*</a>'
+    date_pattern = r'TV-(\d\d\d\d)(\d\d)(\d\d)'
+
+    # parse the website
+    s = urllib2.urlopen(url).read()
+    video = re.compile(pattern).findall(s)[0]
+
+    # fetch the date from the video url
+    date = re.compile(date_pattern).findall(video)[0]
+    date = '.'.join((date[2], date[1], date[0])) + ', 20:00 Uhr'
+
+    # return video+date
+    return date, video
 
 def addLink(name,url,iconimage):
         ok=True
@@ -65,11 +83,10 @@ def addLink(name,url,iconimage):
 
 items = []
 
-date, url = video_file('ts20h')
+date, url = get_video_ts20h()
 addLink('Tagesschau ('+date+')', url, 
'http://www.tagesschau.de/image/podcast/ts-140.jpg')
 
-date, url = video_file('ts100s')
+date, url = get_video_ts100s()
 addLink('Tagesschau in 100 Sekunden ('+date+')', url, 
'http://www.tagesschau.de/image/podcast/ts100s-140.jpg')
 
-
 xbmcplugin.endOfDirectory(int(sys.argv[1]))

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

Summary of changes:
 plugin.video.tagesschau/addon.xml     |    2 +-
 plugin.video.tagesschau/changelog.txt |   14 ++++++---
 plugin.video.tagesschau/tagesschau.py |   51 ++++++++++++++++++++++-----------
 3 files changed, 44 insertions(+), 23 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to