Merge pull request #24 from Hedda/patch-1
authorSebastian Golasch <public@asciidisco.com>
Mon, 10 Apr 2017 11:20:40 +0000 (13:20 +0200)
committerGitHub <noreply@github.com>
Mon, 10 Apr 2017 11:20:40 +0000 (13:20 +0200)
chore(i18n): Swedish translation for Netflix plugin addon

README.md
addon.xml
resources/language/English/strings.po
resources/language/German/strings.po
resources/language/Slovak/strings.po
resources/language/Spanish/strings.po
resources/lib/MSL.py
resources/media/fanart.xcf [new file with mode: 0644]
resources/media/netflix_logo.xcf [new file with mode: 0644]

index ae246f0a5aeed19daa6391076b07bcd4e4772e6a..ce3656c3d1e9c126abb15aa8481f95872d58cc06 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,15 +2,27 @@
 
 ## Netflix Plugin for Kodi 18
 
-###Prerequisites
-----------------
+Disclaimer
+-------------
+This plugin is not officially commisioned/supported by Netflix.
+The trademark "Netflix" is registered by "Netflix, Inc."
+
+Prerequisites
+-------------
 
 - Kodi 18 [agile build](https://github.com/FernetMenta/kodi-agile)
 - Libwidevine 1.4.8.962 (A german description how to get/install it, can be found [here](https://www.kodinerds.net/index.php/Thread/51486-Kodi-17-Inputstream-HowTo-AddOns-f%C3%BCr-Kodi-17-ab-Beta-6-aktuelle-Git-builds-Updat/))
 - Inputstream.adaptive [agile branch build](https://github.com/liberty-developer/inputstream.adaptive/tree/agile)
 
-###Functionality
-----------------
+FAQ
+---
+
+- [Does it work with Kodi 17](https://github.com/asciidisco/plugin.video.netflix/issues/25)
+- [Does it work on a RPI](https://github.com/asciidisco/plugin.video.netflix/issues/28)
+- [Which video resolutions are supported](https://github.com/asciidisco/plugin.video.netflix/issues/27)
+
+Functionality
+-------------
 - Multiple profiles
 - Search Netflix (incl. suggestions)
 - Netflix categories, recommendations, "my list" & continue watching
@@ -18,8 +30,8 @@
 - Add & remove to/from "my list"
 - Export of complete shows & movies in local database (custom library folder can be configured, by default the .strm files are stored in `userdata/addon_data/plugin.video.netflix` )
 
-###ToDo
-----------------
+ToDo
+----
 
 > Note: Those Todos are considered enhancements, they´re not issues, nor they prevent the usage of the plugin for everyday business
 
@@ -33,8 +45,8 @@ please open an issue & we can provide you with some help to get started
 - [ ] If a new user has been created, they need to select their movie/show preferences to actually get started, we could provide the same mechanisms in Kodi
 - [ ] Enable aggressive fetching of data in background (maybe using Futures), like the Netflix website does, to enhance the speed and the user experience when browsing the frontend
 
-###Something doesn't work
--------------------------
+Something doesn't work
+----------------------
 
 If something doesn't work for you, please:
 
@@ -48,8 +60,8 @@ If something doesn't work for you, please:
        - Libwedevine version
        - A Kodi debug log that represents your issue
 
-###Licence
------------------
+Licence
+-------
 
 Licenced under The MIT License.
 Includes [pyjsparser](https://github.com/PiotrDabkowski/pyjsparser) by [Piotr Dabkowski](https://github.com/PiotrDabkowski)
index 7b23e709c230ed88a9be2182db3cdb741bc410e7..11d4e8e3577639d63cb74e86fdcbb9885fd42f02 100644 (file)
--- a/addon.xml
+++ b/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.netflix" name="Netflix" version="0.11.8" provider-name="libdev + jojo + asciidisco">
+<addon id="plugin.video.netflix" name="Netflix" version="0.11.9" provider-name="libdev + jojo + asciidisco">
   <requires>
     <import addon="xbmc.python" version="2.24.0"/>
     <import addon="script.module.beautifulsoup4" version="4.3.2"/>
index f9a78d3eda3f1222dcdfcd70463c2cb8fcf06f84..26401e9ee77dea19009c797c2a5fe52b2e081032 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.8
+# Addon version: 0.11.9
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 9c0dfa8524d76d9ecad908d4b17c85d74b83ad2d..7c75b5a3737cdb5bd2ae628954fc2c9cca6c4ec3 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.8
+# Addon version: 0.11.9
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index d278ad5e2b860071ba667c118d3d95962707d1c1..7b1ed6ec5c40cb70b93d11ce7eb6a54cfa89752b 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.8
+# Addon version: 0.11.9
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 559b66bbe5de1759e2ca60279a38f1b31d1d9907..60edbe88236f91d3167fc7674fa860d919e97c55 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.8
+# Addon version: 0.11.9
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 83a06ee37b5fc0e19d625a4a50d8c61e8c4787be..ef7e93be5a6c20ba6ab7ce85881eb09bfa009dc3 100644 (file)
@@ -10,6 +10,8 @@ import os
 import pprint
 import random
 from StringIO import StringIO
+
+from datetime import datetime
 import requests
 import zlib
 
@@ -152,9 +154,13 @@ class MSL:
 
                 # Audio
                 'heaac-2-dash',
+
+                #subtiltes
                 'dfxp-ls-sdh',
-                'simplesdh',
-                'nflx-cmisc',
+                #'simplesdh',
+                #'nflx-cmisc',
+
+                #unkown
                 'BIF240',
                 'BIF320'
             ],
@@ -349,6 +355,21 @@ class MSL:
                 segment_base = ET.SubElement(rep, 'SegmentBase', indexRange="0-"+str(init_length), indexRangeExact="true")
                 ET.SubElement(segment_base, 'Initialization', range='0-'+str(init_length))
 
+        # Multiple Adaption Sets for subtiles
+        for text_track in manifest['textTracks']:
+            if 'downloadables' not in text_track or text_track['downloadables'] is None:
+                continue
+            subtiles_adaption_set = ET.SubElement(period, 'AdaptationSet',
+                                                  lang=text_track['bcp47'],
+                                                  codecs='stpp',
+                                                  contentType='text',
+                                                  mimeType='application/ttml+xml')
+            for downloadable in text_track['downloadables']:
+                rep = ET.SubElement(subtiles_adaption_set, 'Representation',
+                                    nflxProfile=downloadable['contentProfile']
+                                    )
+                ET.SubElement(rep, 'BaseURL').text = self.__get_base_url(downloadable['urls'])
+
 
         xml = ET.tostring(root, encoding='utf-8', method='xml')
         xml = xml.replace('\n', '').replace('\r', '')
@@ -559,6 +580,18 @@ class MSL:
 
     def __load_msl_data(self):
         msl_data = json.JSONDecoder().decode(self.load_file(self.kodi_helper.msl_data_path, 'msl_data.json'))
+        #Check expire date of the token
+        master_token = json.JSONDecoder().decode(base64.standard_b64decode(msl_data['tokens']['mastertoken']['tokendata']))
+        valid_until = datetime.utcfromtimestamp(int(master_token['expiration']))
+        present = datetime.now()
+        difference = valid_until - present
+        difference = difference.total_seconds() / 60 / 60
+        # If token expires in less then 10 hours or is expires renew it
+        if difference < 10:
+            self.__load_rsa_keys()
+            self.__perform_key_handshake()
+            return
+
         self.__set_master_token(msl_data['tokens']['mastertoken'])
         self.encryption_key = base64.standard_b64decode(msl_data['encryption_key'])
         self.sign_key = base64.standard_b64decode(msl_data['sign_key'])
diff --git a/resources/media/fanart.xcf b/resources/media/fanart.xcf
new file mode 100644 (file)
index 0000000..48296e3
Binary files /dev/null and b/resources/media/fanart.xcf differ
diff --git a/resources/media/netflix_logo.xcf b/resources/media/netflix_logo.xcf
new file mode 100644 (file)
index 0000000..b1db718
Binary files /dev/null and b/resources/media/netflix_logo.xcf differ