Skip to content

Commit

Permalink
VP9 optional / fix subs for ipsa < 2.3.8 / language identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
liberty-developer committed Nov 30, 2018
1 parent 5342284 commit fe53bce
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
14 changes: 9 additions & 5 deletions resources/lib/MSLv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ def __init__(self, nx_common):
"""
self.nx_common = nx_common

self.locale_id = []
locale_id = nx_common.get_setting('locale_id')
self.locale_id.append(locale_id if locale_id else 'en-US')

self.crypto = MSLHandler(nx_common)

if self.nx_common.file_exists(self.nx_common.data_path, 'msl_data.json'):
Expand All @@ -82,7 +86,7 @@ def load_manifest(self, viewable_id, dolby, hevc, hdr, dolbyvision, vp9):
'url': '/manifest',
'id': 15423166626396,
'esn': esn,
'languages': ['de-US'],
'languages': self.locale_id,
'uiVersion': 'shakti-vb45817f4',
'clientVersion': '6.0011.474.011',
'params': {
Expand Down Expand Up @@ -117,7 +121,7 @@ def load_manifest(self, viewable_id, dolby, hevc, hdr, dolbyvision, vp9):

# subtitles
addon = xbmcaddon.Addon('inputstream.adaptive')
if addon and self.nx_common.compare_versions(map(int, addon.getAddonInfo('version').split('.')), [2, 3, 8]):
if addon and self.nx_common.compare_versions(map(int, addon.getAddonInfo('version').split('.')), [2, 3, 8]) >= 0:
profiles.append('webvtt-lssdh-ios8')
else:
profiles.append('simplesdh')
Expand Down Expand Up @@ -189,7 +193,7 @@ def load_manifest(self, viewable_id, dolby, hevc, hdr, dolbyvision, vp9):
profiles.append(dv5 + 'L50-' + prk)
profiles.append(dv5 + 'L51-' + prk)

if hevc is False or vp9 is True:
if vp9 is True:
profiles.append('vp9-profile0-L30-dash-cenc')
profiles.append('vp9-profile0-L31-dash-cenc')
profiles.append('vp9-profile0-L32-dash-cenc')
Expand Down Expand Up @@ -253,7 +257,7 @@ def get_license(self, challenge, sid):
'url': self.last_license_url,
'id': id,
'esn': esn,
'languages': ['de-US'],
'languages': self.locale_id,
'uiVersion': 'shakti-v25d2fa21',
'clientVersion': '6.0011.511.011',
'params': [{
Expand All @@ -270,7 +274,7 @@ def get_license(self, challenge, sid):
'licenseType': 'STANDARD',
'clientVersion': '4.0004.899.011',
'uiVersion': 'akira',
'languages': ['de-DE'],
'languages': self.locale_id,
'playbackContextId': self.last_playback_context,
'drmContextIds': [self.last_drm_context],
'challenges': [{
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/NetflixCommon.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ def compare_versions(v1, v2):
if len(v1) != len(v2):
return len(v1) - len(v2)
for i in range(0, len(v1)):
if v1[i] > v2[1]:
if v1[i] > v2[i]:
return 1
elif v1[i] < v2[1]:
elif v1[i] < v2[i]:
return -1
return 0
6 changes: 5 additions & 1 deletion resources/lib/NetflixSession.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ class NetflixSession(object):
'models/esnGeneratorModel/data/esn',
'gpsModel',
'models/userInfo/data/countryOfSignup',
'models/userInfo/data/membershipStatus'
'models/userInfo/data/membershipStatus',
'models/memberContext/data/geo/preferredLocale'
]

def __init__(self, cookie_path, data_path, verify_ssl, nx_common):
Expand Down Expand Up @@ -2130,6 +2131,9 @@ def _parse_page_contents(self, content):
return None
self.user_data = user_data
self.esn = self._parse_esn_data(user_data)
if 'preferredLocale' in user_data:
self.nx_common.set_setting('locale_id', user_data['preferredLocale']['id'])

self.api_data = {
'API_BASE_URL': user_data.get('API_BASE_URL'),
'API_ROOT': user_data.get('API_ROOT'),
Expand Down
3 changes: 2 additions & 1 deletion resources/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
<setting id="enable_hevc_profiles" type="bool" label="30060" default="false"/>
<setting id="enable_hdr_profiles" type="bool" label="30084" default="false" visible="eq(-1,true)" subsetting="true"/>
<setting id="enable_dolbyvision_profiles" type="bool" label="30085" default="false" visible="eq(-2,true)" subsetting="true"/>
<setting id="enable_vp9_profiles" type="bool" label="30086" default="false" visible="eq(-3,true)" subsetting="true"/>
<setting id="enable_vp9_profiles" type="bool" label="30086" default="false"/>
<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="locale_id" visible="false" value="en-US" />
<setting id="msl_service_port" value="8000" visible="false"/>
<setting id="netflix_service_port" value="8001" visible="false"/>
<setting id="show_update_db" type="bool" default="false" visible="false"/>
Expand Down

0 comments on commit fe53bce

Please sign in to comment.