Permalink
Browse files

add option to play in rtmp mode (default enabled)

  • Loading branch information...
1 parent b60d4b9 commit 414156978f2202d7dfe86c89c84e24c065cbbedc @dersphere committed Nov 1, 2012
Showing with 21 additions and 3 deletions.
  1. +4 −1 addon.py
  2. +1 −1 addon.xml
  3. +2 −0 changelog.txt
  4. +1 −0 resources/language/English/strings.xml
  5. +1 −0 resources/language/German/strings.xml
  6. +11 −1 resources/lib/api.py
  7. +1 −0 resources/settings.xml
View
@@ -65,7 +65,10 @@ def get_movies(category_id):
@plugin.route('/movie/<stream_path>/')
def play_movie(stream_path):
- stream_url = api.get_stream_url(stream_path)
+ if plugin.get_setting('use_rtmp') == 'true':
+ stream_url = api.get_rtmp_url(stream_path)
+ else:
+ stream_url = api.get_stream_url(stream_path)
return plugin.set_resolved_url(stream_url)
if __name__ == '__main__':
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.netzkino_de" name="Netzkino.de" version="0.0.1" provider-name="Tristan Fischer (sphere@dersphere.de)">
+<addon id="plugin.video.netzkino_de" name="Netzkino.de" version="0.0.2" provider-name="Tristan Fischer (sphere@dersphere.de)">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
View
@@ -1,2 +1,4 @@
+0.0.2
+ - added option to play in rtmp mode (avoids stuttering) default enabled
0.0.1
- initial release
@@ -2,6 +2,7 @@
<strings>
<!-- Settings -->
<string id="30100">Force ViewMode to Thumbnail</string>
+ <string id="30101">use RTMP (avoids stuttering)</string>
<!-- Messages -->
<string id="30200">Network Error</string>
</strings>
@@ -2,6 +2,7 @@
<strings>
<!-- Settings -->
<string id="30100">ViewMode Thumbnail erzwingen</string>
+ <string id="30101">RTMP benutzen (Verhindert stocken)</string>
<!-- Messages -->
<string id="30200">Netzwerkfehler</string>
</strings>
View
@@ -25,6 +25,7 @@
MAIN_URL = 'http://www.netzkino.de/capi/'
MOVIE_URL = ('http://mf.netzkinomobil.c.nmdn.net/netzkino_mobil'
'/_definst_/mp4:%s/playlist.m3u8')
+RTMP_URL = 'rtmp://mf.netzkino.c.nmdn.net/netzkino/_definst_/mp4:%s'
VISIBLE_CATEGORIES = (
('81', 'Neu bei Netzkino'),
@@ -83,6 +84,12 @@ def clean_tags(bad_str):
bad_str = re.sub(r'<[^>]*?>', '', bad_str)
return bad_str.replace('&#8211;', '-')
+ def get_image(attachments_list):
+ for item in attachments_list:
+ if item.get('url', '') != '':
+ print item['url']
+ return item['url']
+
path = (
'get_category_posts'
'?count=%(movie_count)d'
@@ -106,14 +113,17 @@ def clean_tags(bad_str):
'title': clean_tags(item.get('title_plain')),
'content': clean_tags(item.get('content')),
'modified': item.get('modified'),
- 'image': item.get('attachments', [])[0].get('url'),
+ 'image': get_image(item.get('attachments', [])),
'stream_path': item['custom_fields']['Streaming'][0]
})
return movies
def get_stream_url(self, stream_path):
return MOVIE_URL % stream_path
+ def get_rtmp_url(self, stream_path):
+ return RTMP_URL % stream_path
+
def __get_json(self, url, path=None):
if path:
url += path
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="force_viewmode" type="bool" label="30100" default="true"/>
+ <setting id="use_rtmp" type="bool" label="30101" default="true"/>
</settings>

0 comments on commit 4141569

Please sign in to comment.