## 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.
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/))
-- 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
---
- 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
+Donate
+------
+
+If you like this project feel free to buy us some cups of coffee.
+Our bitcoin address is: 1DHGftMkFXXsDY7UnqQuatWwxQzKVu88sF
+
Licence
-------
<?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"/>
<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 & Swedish language files
+ - Add calculation of ESN for Android
+ - Logout in settings now also deletes Manifest data
+ - Add hidden ESN field in config & 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)
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>
# 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 ""
# 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 ""
# 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 ""
# 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 ""
# 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"
-"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"
"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 "#30029"
msgid "Missing Inputstream addon"
-msgstr "Brakuje zainstalowanej wtyczki strumieniowej"
+msgstr "Brakuje wtyczki strumieniowej InputStream Adaptive"
msgctxt "#30030"
msgid "Remove from library"
# 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 ""
# 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"
-"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"
msgctxt "Addon Summary"
msgid "Netflix"
-msgstr "Netlflix"
+msgstr "Netflix"
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 "#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 "#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..."
# 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 ""
# 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 ""
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."
-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 "#30002"
msgid "Adult Pin"
-msgstr "Vuxen-pinkod"
+msgstr "Barnskydd"
msgctxt "#30003"
msgid "Search term"
msgctxt "#30006"
msgid "Adult verification failed"
-msgstr "Vuxen-pinkod verifiering misslyckades"
+msgstr "Verifiering av barnskyddet misslyckades"
msgctxt "#30007"
msgid "Please Check your adult pin"
-msgstr "Kontrollera din Vuxen-pinkod"
+msgstr "Kontrollera koden till barnskyddet"
msgctxt "#30008"
msgid "Login failed"
-msgstr "Inloggning misslyckades"
+msgstr "Inloggningen misslyckades"
msgctxt "#30009"
msgid "Please Check your credentials"
msgctxt "#30024"
msgid "SSL verification"
-msgstr "SSL kontroll"
+msgstr "SSL-kontroll"
msgctxt "#30025"
msgid "Library"
msgctxt "#30027"
msgid "Custom library path"
-msgstr "Ändra bibliotek genväg"
+msgstr "Anpassad bibliotekssökväg"
msgctxt "#30028"
msgid "Playback error"
-msgstr "Uppspelnings error"
+msgstr "Uppspelningsfel"
msgctxt "#30029"
msgid "Missing Inputstream addon"
-msgstr "Saknar 'InputStream' addon"
+msgstr "Saknar tillägget InputStream"
msgctxt "#30030"
msgid "Remove from library"
msgctxt "#30031"
msgid "Change library title"
-msgstr "Ändra bibliotektiteln"
+msgstr "Ändra bibliotekstiteln"
msgctxt "#30032"
msgid "Tracking"
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 "#30035"
msgid "Inputstream Addon Settings..."
-msgstr "InputStream Addon inställningar..."
+msgstr "Inställningar för tillägget InputStream..."
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
"""
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()
# 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}|')
"""
self.profiles = []
self.credentials = {'email': '', 'password': ''}
+ # delete esn data
+ self.kodi_helper.delete_manifest_data()
return self.netflix_session.logout()
def login (self, params):
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:
# 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'
})
"""
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
: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', '')
+ esn = ''
+
# values are stored in lists (returned from JS parser)
for item in netflix_page_data:
if 'esnGeneratorModel' in dict(item).keys():
# Module: utils
# Created on: 13.01.2017
+import platform
+
# Takes everything, does nothing, classic no operation function
def noop (**kwargs):
return True
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'
<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"/>