Skip to content

Commit

Permalink
Merge pull request #1692 from CastagnaIT/changes
Browse files Browse the repository at this point in the history
Updates to new website changes
  • Loading branch information
CastagnaIT authored Apr 16, 2024
2 parents feb1351 + 61ae167 commit f5ae089
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
6 changes: 4 additions & 2 deletions resources/lib/kodi/infolabels.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,20 @@ def parse_art(videoid, item):
paths.ART_PARTIAL_PATHS[2] + ['url'], item)
fanart = common.get_path_safe(
paths.ART_PARTIAL_PATHS[3] + [0, 'url'], item)
fallback = common.get_path_safe(['itemSummary', 'value', 'boxArt', 'url'], item)
return _assign_art(videoid,
boxart_large=boxarts.get(paths.ART_SIZE_FHD),
boxart_small=boxarts.get(paths.ART_SIZE_SD),
poster=boxarts.get(paths.ART_SIZE_POSTER),
interesting_moment=interesting_moment.get(paths.ART_SIZE_FHD),
clearlogo=clearlogo,
fanart=fanart)
fanart=fanart,
fallback=fallback)


def _assign_art(videoid, **kwargs):
"""Assign the art available from Netflix to appropriate Kodi art"""
art = {'poster': _best_art([kwargs['poster']]),
art = {'poster': _best_art([kwargs['poster'], kwargs['fallback']]),
'fanart': _best_art([kwargs['fanart'],
kwargs['interesting_moment'],
kwargs['boxart_large'],
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/services/nfsession/msl/msl_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

ENDPOINTS = {
'manifest_v1': CHROME_BASE_URL + 'pbo_manifests/%5E1.0.0/router', # "pbo_manifests/^1.0.0/router"
'manifest': CHROME_PLAYAPI_URL + 'licensedmanifest',
'manifest': CHROME_PLAYAPI_URL + 'licensedmanifest/1',
'license': CHROME_BASE_URL + 'pbo_licenses/%5E1.0.0/router',
'events': CHROME_PLAYAPI_URL + 'event/1',
'logblobs': CHROME_PLAYAPI_URL + 'logblob/1'
Expand Down
4 changes: 2 additions & 2 deletions resources/lib/services/nfsession/session/access.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def login_auth_data(self, data=None, password=None):
'If you have just done "Sign out of all devices" from Netflix account settings '
'wait about 10 minutes before generating a new AuthKey.') from exc
# Get the account e-mail
page_response = self.get('your_account').decode('utf-8')
email_match = re.search(r'account-email[^<]+>([^<]+@[^</]+)</', page_response)
page_response = self.get('account_security').decode('utf-8')
email_match = re.search(r'>([^<]+@[^</]+)<', page_response)
email = email_match.group(1).strip() if email_match else None
if not email:
raise WebsiteParsingError('E-mail field not found')
Expand Down
6 changes: 3 additions & 3 deletions resources/lib/services/nfsession/session/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@
'use_default_params': False,
'add_auth_url': None,
'accept': 'text/html,application/xhtml+xml,application/xml'},
'your_account':
{'address': '/YourAccount',
'account_security':
{'address': '/account/security',
'is_api_call': False,
'use_default_params': False,
'add_auth_url': None,
Expand All @@ -82,7 +82,7 @@
'is_api_call': False,
'use_default_params': False,
'add_auth_url': None,
'accept': 'application/json, text/javascript, */*'},
'accept': '*/*'},
'profile_lock':
{'address': '/api/shakti/mre/profileLock',
'is_api_call': False,
Expand Down
2 changes: 1 addition & 1 deletion resources/lib/utils/api_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
[['requestId', 'summary', 'title', 'synopsis', 'regularSynopsis', 'evidence', 'queue', 'inRemindMeList',
'episodeCount', 'info', 'maturity', 'runtime', 'seasonCount', 'availability', 'trackIds',
'releaseYear', 'userRating', 'numSeasonsLabel', 'bookmarkPosition', 'creditsOffset',
'dpSupplementalMessage', 'watched', 'delivery', 'sequiturEvidence', 'promoVideo', 'availability']],
'dpSupplementalMessage', 'watched', 'delivery', 'sequiturEvidence', 'promoVideo', 'availability', 'itemSummary']],
[['genres', 'tags', 'creators', 'directors', 'cast'],
{'from': 0, 'to': 10}, ['id', 'name']]
] + ART_PARTIAL_PATHS
Expand Down
15 changes: 12 additions & 3 deletions resources/lib/utils/api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,25 @@ def login(ask_credentials=True):
try:
is_success = False
credentials = None
is_login_with_credentials = True
is_login_with_credentials = False
# The database 'isAdsPlan' value is stored after the login, so the first time we have None value
# this avoids to show the notice message multiple times if more login attempts will be done over the time
show_ads_notice = G.LOCAL_DB.get_value('is_ads_plan', None, table=TABLE_SESSION) is None
if ask_credentials:
is_login_with_credentials = ui.show_yesno_dialog('Login', common.get_local_string(30340),
yeslabel=common.get_local_string(30341),
nolabel=common.get_local_string(30342))
if is_login_with_credentials:
credentials = {'credentials': ui.ask_credentials()}
# if is_login_with_credentials:
# credentials = {'credentials': ui.ask_credentials()}
if is_login_with_credentials:
# The login page is changed now part of HTML seem protected by reCaptcha
# in the HTML page the reactContext data is added after the reCaptcha checks so at the moment
# it is not accessible by requesting the login page through python script,
# this prevents us to get the authURL code needed to perform the login request
ui.show_ok_dialog('Login',
'Due to new website protections at moment the login with credentials is not available.')
is_login_with_credentials = False

if is_login_with_credentials:
if common.make_call('login', credentials):
is_success = True
Expand Down

0 comments on commit f5ae089

Please sign in to comment.