updates fetched from Aciidisco
authorItay Shechter <ItayLcars@hotmail.com>
Wed, 2 Aug 2017 16:07:26 +0000 (19:07 +0300)
committerItay Shechter <ItayLcars@hotmail.com>
Wed, 2 Aug 2017 16:07:26 +0000 (19:07 +0300)
updated code based on AciiDisco (19/7/2017)

16 files changed:
README.md
addon.xml
resources/language/Dutch/strings.po
resources/language/English/strings.po
resources/language/German/strings.po
resources/language/Hebrew/strings.po
resources/language/Polish/strings.po
resources/language/Portugese/strings.po
resources/language/Slovak/strings.po
resources/language/Spanish/strings.po
resources/language/Swedish/strings.po
resources/lib/KodiHelper.py
resources/lib/NetflixHttpSubRessourceHandler.py
resources/lib/NetflixSession.py
resources/lib/utils.py
resources/settings.xml

index ce3656c3d1e9c126abb15aa8481f95872d58cc06..0eae3a045aed2e7a10f5e3e2f99b4c65683cc628 100644 (file)
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
 
 ## Netflix Plugin for Kodi 18
 
 
 ## Netflix Plugin for Kodi 18
 
+<span class="badge-bitcoin"><a href="https://blockchain.info/address/1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF" title="Donate to this project using Bitcoin"><img src="https://img.shields.io/badge/bitcoin-donate-yellow.svg" alt="Bitcoin donate button" /></a></span>
+
 Disclaimer
 -------------
 This plugin is not officially commisioned/supported by Netflix.
 Disclaimer
 -------------
 This plugin is not officially commisioned/supported by Netflix.
@@ -10,9 +12,9 @@ The trademark "Netflix" is registered by "Netflix, Inc."
 Prerequisites
 -------------
 
 Prerequisites
 -------------
 
-- Kodi 18 [agile build](https://github.com/FernetMenta/kodi-agile)
+- Kodi 18 [nightlybuild](http://mirrors.kodi.tv/nightlies/)
 - 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/))
 - 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)
+- Inputstream.adaptive [v2.0.4](https://github.com/peak3d/inputstream.adaptive)
 
 FAQ
 ---
 
 FAQ
 ---
@@ -54,12 +56,18 @@ If something doesn't work for you, please:
 - Enable verbose logging in the plugin settings
 - Enable the Debug log in you Kodi settings
 - Open an issue with a titles that summarises your problems and include:
 - Enable verbose logging in the plugin settings
 - Enable the Debug log in you Kodi settings
 - Open an issue with a titles that summarises your problems and include:
-       - Kodi version (git sha as long as we´re on agile only)
-       - Inputstream.adaptive version (git sha as long as we´re on the agile branch)
+       - Kodi version (git sha if possible)
+       - Inputstream.adaptive version (git sha if possible)
        - Your OS and OS version
        - Libwedevine version
        - A Kodi debug log that represents your issue
 
        - Your OS and OS version
        - Libwedevine version
        - A Kodi debug log that represents your issue
 
+Donate
+------
+
+If you like this project feel free to buy us some cups of coffee.
+Our bitcoin address is: 1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF
+
 Licence
 -------
 
 Licence
 -------
 
index 6fb3a89385b6d669020a48bfac9c5bcd275c8391..4d56cb48a9933b507f21f6d3c5ebb344155e946b 100644 (file)
--- a/addon.xml
+++ b/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.netflix" name="Netflix" version="0.11.14" provider-name="libdev + jojo + asciidisco">
+<addon id="plugin.video.netflix" name="Netflix" version="0.11.18" provider-name="libdev + jojo + asciidisco">
   <requires>
     <import addon="xbmc.python" version="2.24.0"/>
     <import addon="script.module.beautifulsoup4" version="4.3.2"/>
   <requires>
     <import addon="xbmc.python" version="2.24.0"/>
     <import addon="script.module.beautifulsoup4" version="4.3.2"/>
     <license>MIT</license>
     <forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>
     <source>https://github.com/asciidisco/plugin.video.netflix</source>
     <license>MIT</license>
     <forum>http://www.kodinerds.net/index.php/Thread/55607-Inputstream-Agile-Betatest-Netflix/</forum>
     <source>https://github.com/asciidisco/plugin.video.netflix</source>
-    <news>v0.11.14 (2017-07-02)
+    <news>v0.11.16 (2017-07-19)
+    - Fix error on *nix devices
+    
+    v0.11.15 (2017-07-19)
+    - Fix issue with Slovak, Polish &amp; Swedish language files
+    - Add calculation of ESN for Android
+    - Logout in settings now also deletes Manifest data
+    - Add hidden ESN field in config &amp; delete Manifest data if it doesn't fit the public one
+    
+    v0.11.14 (2017-07-02)
     - Fix issue with Unicode escaping
 
     v0.11.13 (2017-07-02)
     - Fix issue with Unicode escaping
 
     v0.11.13 (2017-07-02)
@@ -46,9 +55,6 @@
     v0.11.10 (2017-4-10)
     - Adds subtitle support
     - Polish translations
     v0.11.10 (2017-4-10)
     - Adds subtitle support
     - Polish translations
-
-    v0.11.9 (2017-4-5)
-    - Fix issues with persisted msl manifests
     </news>
   </extension>
 </addon>
     </news>
   </extension>
 </addon>
index 962d90739622fa5a279100cb6a149e8ba29ec4b2..8bc942bcbea25f0436088efcb3e391ab6bb2e185 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 6779545e64310e16c74b790d887e09db6b275e53..d8df2d71dcf2d722b17fa2bca674e7d5b04794b4 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 76decf5c9ffec1e281565ec6196a9821a39e19cc..1e9f74b537393ed3d099bb4e335c58f0c369cbda 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 16cfd8004979878df5b08b871bb874827de257e2..9472edcc8bb17826d0b42a558f88a0f51880075f 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 # Translated by: Itayshechter
 msgid ""
 # Addon Provider: libdev + jojo + asciidisco
 # Translated by: Itayshechter
 msgid ""
index 4ac70c8f12065a18791b643532cb3c855280700f..05cd78638d850ee5dab1e6e04eab450cdb4c7e3c 100644 (file)
@@ -1,14 +1,14 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 "Project-Id-Version: XBMC-Addons\n"
 "Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
 "POT-Creation-Date: 2015-09-21 11:01+0000\n"
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 "Project-Id-Version: XBMC-Addons\n"
 "Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
 "POT-Creation-Date: 2015-09-21 11:01+0000\n"
-"PO-Revision-Date: 2017-04-13 17:05+0200\n"
+"PO-Revision-Date: 2017-07-17 20:27+0200\n"
 "Last-Translator: Marcin W.\n"
 "Language: pl\n"
 "Language-Team: Polish (Poland) (http://www.transifex.com/teamxbmc/kodi-main/language/pl_PL/)\n"
 "Last-Translator: Marcin W.\n"
 "Language: pl\n"
 "Language-Team: Polish (Poland) (http://www.transifex.com/teamxbmc/kodi-main/language/pl_PL/)\n"
@@ -16,7 +16,7 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-"X-Generator: Poedit 2.0.1\n"
+"X-Generator: Poedit 2.0.2\n"
 
 msgctxt "Addon Summary"
 msgid "Netflix"
 
 msgctxt "Addon Summary"
 msgid "Netflix"
@@ -136,7 +136,7 @@ msgstr "Błąd odtwarzania"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
-msgstr "Brakuje zainstalowanej wtyczki strumieniowej"
+msgstr "Brakuje wtyczki strumieniowej InputStream Adaptive"
 
 msgctxt "#30030"
 msgid "Remove from library"
 
 msgctxt "#30030"
 msgid "Remove from library"
index 0bca0c4fd93b3fbffcf99d891b7f601c2da6c54b..3f0f81326977e11f24782b7131379de337c9795b 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index cf87ce29fc75152985b7e9f155e71eec92b7c794..ee553e4b2161742133605b05283fa51f15d8914d 100644 (file)
@@ -1,14 +1,14 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 "Project-Id-Version: XBMC-Addons\n"
 "Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
 "POT-Creation-Date: 2017-01-01 12:00+0000\n"
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 "Project-Id-Version: XBMC-Addons\n"
 "Report-Msgid-Bugs-To: alanwww1@xbmc.org\n"
 "POT-Creation-Date: 2017-01-01 12:00+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"PO-Revision-Date: 2017-05-14 19:55+0000\n"
 "Last-Translator: Matej Moško <matej.mosko@gmail.com>\n"
 "Language-Team: Slovak\n"
 "MIME-Version: 1.0\n"
 "Last-Translator: Matej Moško <matej.mosko@gmail.com>\n"
 "Language-Team: Slovak\n"
 "MIME-Version: 1.0\n"
@@ -19,11 +19,11 @@ msgstr ""
 
 msgctxt "Addon Summary"
 msgid "Netflix"
 
 msgctxt "Addon Summary"
 msgid "Netflix"
-msgstr "Netlflix"
+msgstr "Netflix"
 
 msgctxt "Addon Description"
 msgid "Netflix VOD Services Addon"
 
 msgctxt "Addon Description"
 msgid "Netflix VOD Services Addon"
-msgstr "Doplnok služby Netflix"
+msgstr "Doplnok na prehrávanie obsahu služby Netflix"
 
 msgctxt "Addon Disclaimer"
 msgid "Some parts of this addon may not be legal in your country of residence - please check with your local laws before installing."
 
 msgctxt "Addon Disclaimer"
 msgid "Some parts of this addon may not be legal in your country of residence - please check with your local laws before installing."
@@ -135,7 +135,7 @@ msgstr "Chyba prehrávania"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
-msgstr "Nenašiel sa doplnok Inputstream"
+msgstr "Nepodarilo sa nájsť doplnok Inputstream"
 
 msgctxt "#30030"
 msgid "Remove from library"
 
 msgctxt "#30030"
 msgid "Remove from library"
@@ -155,7 +155,7 @@ msgstr "Použiť Dolby Sound"
 
 msgctxt "#30034"
 msgid "ESN (set automatically, can be changed manually)"
 
 msgctxt "#30034"
 msgid "ESN (set automatically, can be changed manually)"
-msgstr "ESN (nastavené automaticky, môžete to ručne zmeniť"
+msgstr "ESN (nastavené automaticky, môžete to ručne zmeniť)"
 
 msgctxt "#30035"
 msgid "Inputstream Addon Settings..."
 
 msgctxt "#30035"
 msgid "Inputstream Addon Settings..."
index d019e8a9dda1f403cfcb1feccb04c6b0036a748d..902eb9baf381ea228ca1faee60812b59a4a54b1d 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
index 540fc1de68608571b67bc9bc8af1c1dff39a384f..04d30903ebc5c7c97196dac56142bbd11620b36c 100644 (file)
@@ -1,7 +1,7 @@
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
 # Kodi Media Center language file
 # Addon Name: Netflix
 # Addon id: plugin.video.netflix
-# Addon version: 0.11.14
+# Addon version: 0.11.18
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
 # Addon Provider: libdev + jojo + asciidisco
 msgid ""
 msgstr ""
@@ -23,11 +23,11 @@ msgstr "Netflix"
 
 msgctxt "Addon Description"
 msgid "Netflix VOD Services Addon"
 
 msgctxt "Addon Description"
 msgid "Netflix VOD Services Addon"
-msgstr "Netflix VOD Service Addon"
+msgstr "Netflix VOD-tjänstetillägg"
 
 msgctxt "Addon Disclaimer"
 msgid "Some parts of this addon may not be legal in your country of residence - please check with your local laws before installing."
 
 msgctxt "Addon Disclaimer"
 msgid "Some parts of this addon may not be legal in your country of residence - please check with your local laws before installing."
-msgstr "Vissa delar av detta addon kanske inte är fullt lagliga att använda i ditt land - kontrollera dina lokala lagar innan du installerar."
+msgstr "Vissa delar av detta tillägg kanske inte är fullt lagliga att använda i ditt land - kontrollera dina lokala lagar innan du installerar."
 
 msgctxt "#30001"
 msgid "Recommendations"
 
 msgctxt "#30001"
 msgid "Recommendations"
@@ -35,7 +35,7 @@ msgstr "Rekommendationer"
 
 msgctxt "#30002"
 msgid "Adult Pin"
 
 msgctxt "#30002"
 msgid "Adult Pin"
-msgstr "Vuxen-pinkod"
+msgstr "Barnskydd"
 
 msgctxt "#30003"
 msgid "Search term"
 
 msgctxt "#30003"
 msgid "Search term"
@@ -51,15 +51,15 @@ msgstr "E-post"
 
 msgctxt "#30006"
 msgid "Adult verification failed"
 
 msgctxt "#30006"
 msgid "Adult verification failed"
-msgstr "Vuxen-pinkod verifiering misslyckades"
+msgstr "Verifiering av barnskyddet misslyckades"
 
 msgctxt "#30007"
 msgid "Please Check your adult pin"
 
 msgctxt "#30007"
 msgid "Please Check your adult pin"
-msgstr "Kontrollera din Vuxen-pinkod"
+msgstr "Kontrollera koden till barnskyddet"
 
 msgctxt "#30008"
 msgid "Login failed"
 
 msgctxt "#30008"
 msgid "Login failed"
-msgstr "Inloggning misslyckades"
+msgstr "Inloggningen misslyckades"
 
 msgctxt "#30009"
 msgid "Please Check your credentials"
 
 msgctxt "#30009"
 msgid "Please Check your credentials"
@@ -115,7 +115,7 @@ msgstr "Expert"
 
 msgctxt "#30024"
 msgid "SSL verification"
 
 msgctxt "#30024"
 msgid "SSL verification"
-msgstr "SSL kontroll"
+msgstr "SSL-kontroll"
 
 msgctxt "#30025"
 msgid "Library"
 
 msgctxt "#30025"
 msgid "Library"
@@ -127,15 +127,15 @@ msgstr "Aktivera anpassad biblioteksmapp"
 
 msgctxt "#30027"
 msgid "Custom library path"
 
 msgctxt "#30027"
 msgid "Custom library path"
-msgstr "Ändra bibliotek genväg"
+msgstr "Anpassad bibliotekssökväg"
 
 msgctxt "#30028"
 msgid "Playback error"
 
 msgctxt "#30028"
 msgid "Playback error"
-msgstr "Uppspelnings error"
+msgstr "Uppspelningsfel"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
 
 msgctxt "#30029"
 msgid "Missing Inputstream addon"
-msgstr "Saknar 'InputStream' addon"
+msgstr "Saknar tillägget InputStream"
 
 msgctxt "#30030"
 msgid "Remove from library"
 
 msgctxt "#30030"
 msgid "Remove from library"
@@ -143,7 +143,7 @@ msgstr "Ta bort från biblioteket"
 
 msgctxt "#30031"
 msgid "Change library title"
 
 msgctxt "#30031"
 msgid "Change library title"
-msgstr "Ändra bibliotektiteln"
+msgstr "Ändra bibliotekstiteln"
 
 msgctxt "#30032"
 msgid "Tracking"
 
 msgctxt "#30032"
 msgid "Tracking"
@@ -151,7 +151,7 @@ msgstr "Spårning"
 
 msgctxt "#30033"
 msgid "Use Dolby Sound"
 
 msgctxt "#30033"
 msgid "Use Dolby Sound"
-msgstr "Använd Dolby Digital ljud"
+msgstr "Använd Dolby Digital-ljud"
 
 msgctxt "#30034"
 msgid "ESN (set automatically, can be changed manually)"
 
 msgctxt "#30034"
 msgid "ESN (set automatically, can be changed manually)"
@@ -159,4 +159,4 @@ msgstr "ESN (ändra automatiskt, kan ändras manuellt)"
 
 msgctxt "#30035"
 msgid "Inputstream Addon Settings..."
 
 msgctxt "#30035"
 msgid "Inputstream Addon Settings..."
-msgstr "InputStream Addon inställningar..."
+msgstr "Inställningar för tillägget InputStream..."
index a75f2e71f6ee3fb234ce7b90d4fa9743a13823c8..7e1811339ed923cedf094679763af94a451571a9 100644 (file)
@@ -13,6 +13,7 @@ from os.path import join, isfile
 from urllib import urlencode
 from xbmcaddon import Addon
 from uuid import uuid4
 from urllib import urlencode
 from xbmcaddon import Addon
 from uuid import uuid4
+from utils import get_user_agent_for_current_platform
 from UniversalAnalytics import Tracker
 try:
    import cPickle as pickle
 from UniversalAnalytics import Tracker
 try:
    import cPickle as pickle
@@ -204,7 +205,7 @@ class KodiHelper:
         """
         Returns the esn from settings
         """
         """
         Returns the esn from settings
         """
-        stored_esn = self.get_esn()
+        stored_esn = self.get_esn()        
         if not stored_esn and esn:
             self.set_setting('esn', esn)
             self.delete_manifest_data()            
         if not stored_esn and esn:
             self.set_setting('esn', esn)
             self.delete_manifest_data()            
@@ -693,6 +694,9 @@ class KodiHelper:
         # inputstream addon properties
         msl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port'))
         play_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id)
         # inputstream addon properties
         msl_service_url = 'http://localhost:' + str(addon.getSetting('msl_service_port'))
         play_item = xbmcgui.ListItem(path=msl_service_url + '/manifest?id=' + video_id)
+        play_item.setContentLookup(False)
+        play_item.setMimeType('application/dash+xml')
+        play_item.setProperty(inputstream_addon + '.stream_headers', 'user-agent=' + get_user_agent_for_current_platform())        
         play_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha')
         play_item.setProperty(inputstream_addon + '.manifest_type', 'mpd')
         play_item.setProperty(inputstream_addon + '.license_key', msl_service_url + '/license?id=' + video_id + '||b{SSM}!b{SID}|')
         play_item.setProperty(inputstream_addon + '.license_type', 'com.widevine.alpha')
         play_item.setProperty(inputstream_addon + '.manifest_type', 'mpd')
         play_item.setProperty(inputstream_addon + '.license_key', msl_service_url + '/license?id=' + video_id + '||b{SSM}!b{SID}|')
index 55d95cada2161d58bdaa91402c67e30224d14347..43eb5370e799f2f64d9b6d027df04c21affe30ca 100644 (file)
@@ -74,6 +74,8 @@ class NetflixHttpSubRessourceHandler:
         """
         self.profiles = []
         self.credentials = {'email': '', 'password': ''}
         """
         self.profiles = []
         self.credentials = {'email': '', 'password': ''}
+        # delete esn data
+        self.kodi_helper.delete_manifest_data()
         return self.netflix_session.logout()
 
     def login (self, params):
         return self.netflix_session.logout()
 
     def login (self, params):
index d2be1cdd9ba7ea92dfa7a318e9a0dcba510d25ef..dd81914db06474c2ae9408c611704bdee5b29ab2 100644 (file)
@@ -10,7 +10,7 @@ from urllib import quote, unquote
 from time import time
 from base64 import urlsafe_b64encode
 from bs4 import BeautifulSoup, SoupStrainer
 from time import time
 from base64 import urlsafe_b64encode
 from bs4 import BeautifulSoup, SoupStrainer
-from utils import noop
+from utils import noop, get_user_agent_for_current_platform
 try:
    import cPickle as pickle
 except:
 try:
    import cPickle as pickle
 except:
@@ -103,7 +103,7 @@ class NetflixSession:
         # start session, fake chrome on the current platform (so that we get a proper widevine esn) & enable gzip
         self.session = session()
         self.session.headers.update({
         # start session, fake chrome on the current platform (so that we get a proper widevine esn) & enable gzip
         self.session = session()
         self.session.headers.update({
-            'User-Agent': self._get_user_agent_for_current_platform(),
+            'User-Agent': get_user_agent_for_current_platform(),
             'Accept-Encoding': 'gzip'
         })
 
             'Accept-Encoding': 'gzip'
         })
 
@@ -1880,24 +1880,6 @@ class NetflixSession:
         """
         return urlsafe_b64encode(account['email'])
 
         """
         return urlsafe_b64encode(account['email'])
 
-    def _get_user_agent_for_current_platform (self):
-        """Determines the user agent string for the current platform (to retrieve a valid ESN)
-
-        Returns
-        -------
-        :obj:`str`
-            User Agent for platform
-        """
-        import platform
-        self.log(msg='Building User Agent for platform: ' + str(platform.system()) + ' - ' + str(platform.machine()))
-        if platform.system() == 'Darwin':
-            return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
-        if platform.system() == 'Windows':
-            return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
-        if platform.machine().startswith('arm'):
-            return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36'
-        return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36'
-
     def _session_post (self, component, type='document', data={}, headers={}, params={}):
         """Executes a get request using requests for the current session & measures the duration of that request
 
     def _session_post (self, component, type='document', data={}, headers={}, params={}):
         """Executes a get request using requests for the current session & measures the duration of that request
 
@@ -2299,11 +2281,31 @@ class NetflixSession:
             :obj:`str` of :obj:`str
             ESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME
         """
             :obj:`str` of :obj:`str
             ESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME
         """
-        esn = ''
+        # we generate an esn from device strings for android
+        import subprocess
+        try:
+            manufacturer = subprocess.check_output(["/system/bin/getprop", "ro.product.manufacturer"])
+            if manufacturer:
+                esn = 'NFANDROID1-PRV-'
+                input = subprocess.check_output(["/system/bin/getprop", "ro.nrdp.modelgroup"])
+                if not input:
+                    esn = esn + 'T-L3-'
+                else:
+                    esn = esn + input.strip(' \t\n\r') + '-'
+                esn = esn + '{:5}'.format(manufacturer.strip(' \t\n\r').upper())
+                input = subprocess.check_output(["/system/bin/getprop" ,"ro.product.model"])
+                esn = esn + input.strip(' \t\n\r').replace(' ', '=').upper()
+                self.log(msg='Android generated ESN:' + esn)
+                return esn
+        except OSError as e:
+            self.log(msg='Ignoring exception for non Android devices')
+
         # values are accessible via dict (sloppy parsing successfull)
         if type(netflix_page_data) == dict:
             return netflix_page_data.get('esn', '')
 
         # values are accessible via dict (sloppy parsing successfull)
         if type(netflix_page_data) == dict:
             return netflix_page_data.get('esn', '')
 
+        esn = ''
+
         # values are stored in lists (returned from JS parser)
         for item in netflix_page_data:
             if 'esnGeneratorModel' in dict(item).keys():
         # values are stored in lists (returned from JS parser)
         for item in netflix_page_data:
             if 'esnGeneratorModel' in dict(item).keys():
index afb056f7994fa7c5a9483bd1a06ca70fad3029c8..a1b1a2db38adef45120768bc957ca92ee002073f 100644 (file)
@@ -3,6 +3,8 @@
 # Module: utils
 # Created on: 13.01.2017
 
 # Module: utils
 # Created on: 13.01.2017
 
+import platform
+
 # Takes everything, does nothing, classic no operation function
 def noop (**kwargs):
     return True
 # Takes everything, does nothing, classic no operation function
 def noop (**kwargs):
     return True
@@ -27,3 +29,20 @@ def log(f, name=None):
         return result
     wrapped.__doc__ = f.__doc__
     return wrapped
         return result
     wrapped.__doc__ = f.__doc__
     return wrapped
+
+def get_user_agent_for_current_platform():
+    """Determines the user agent string for the current platform (to retrieve a valid ESN)
+
+    Returns
+    -------
+    :obj:`str`
+        User Agent for platform
+    """
+    system = platform.system()
+    if system == 'Darwin':
+        return 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
+    if system == 'Windows':
+        return 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
+    if platform.machine().startswith('arm'):
+        return 'Mozilla/5.0 (X11; CrOS armv7l 7647.78.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
+    return 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
index 5c0faabbbf55f5f7df888cbdf199ed82daf42a8a..bd9b27a49e9b12c61b7653077ec875f8d72828a4 100644 (file)
@@ -15,6 +15,7 @@
     <setting id="ssl_verification" type="bool" label="30024" default="true"/>
     <setting id="enable_tracking" type="bool" label="30032" default="true"/>
     <setting id="esn" type="text" label="30034" value="" default=""/>
     <setting id="ssl_verification" type="bool" label="30024" default="true"/>
     <setting id="enable_tracking" type="bool" label="30032" default="true"/>
     <setting id="esn" type="text" label="30034" value="" default=""/>
+    <setting id="hidden_esn" visible="false" value="" />
     <setting id="tracking_id" value="" visible="false"/>
     <setting id="msl_service_port" value="8000" visible="false"/>
     <setting id="netflix_service_port" value="8001" visible="false"/>
     <setting id="tracking_id" value="" visible="false"/>
     <setting id="msl_service_port" value="8000" visible="false"/>
     <setting id="netflix_service_port" value="8001" visible="false"/>