Plugin.video.netflix: can not login: "ProfilesMissing"

Created on 3 Sep 2019  ·  52Comments  ·  Source: CastagnaIT/plugin.video.netflix

Bug report

Your Environment

  • Netflix add-on version: 15.2

Used Operating system:

  • [x ] Android
  • [ ] iOS
  • [ ] Linux
  • [ ] OSX
  • [ ] Raspberry-Pi
  • [ ] Windows

Describe the bug

Two days ago netflix addon had been working without any problems. Yesterday after trying to start addon information about email showed. After entering email and password there had been information about problem with decrypting credentials.
I tried to log out from netflix addon, then deleted ESN, uninstalled addon, uninstalled repository, installed again still getting info about problem with credentials. Then I deleted settings.xml, uninstalled addon, installed again...
Now I don't have settings.xml file and get "ProfilesMissing" error. This file is not creating itself. ESN in settings is still empty...

Debug log

The debug log can be found here:
https://paste.kodi.tv/dohezopoqo.kodi

Installation

I used daily build addon, older addon 14.0?, repository.castagnait-1.0.0.zip

Other information


Screenshots

Most helpful comment

So... ZIP downloaded from https://github.com/CastagnaIT/plugin.video.netflix/tree/master and renamed to plugin.video.netflix-0.15.2.zip installs just fine and now log in works, and I can see the profiles, enter them, and managed to start an episode from one of the series.

So it appears that whatever fix you did works.

Thank you so much - and apologies for the noise. Github has really confused me there.

In any case: Thank you all for your great work on this plugin!

All 52 comments

Same problem here on 2 devices.

I have same issue on my Mac, and I think something is wrong with encryption since I see:

019-09-02 22:44:40.617 T:8695   ERROR: [plugin.video.netflix (0)] Traceback (most recent call last):
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.netflix/resources/lib/common/credentials.py", line 87, in get_credentials
                                                'email': decrypt_credential(email),
                                              File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.netflix/resources/lib/common/credentials.py", line 73, in decrypt_credential
                                                block_size=__BLOCK_SIZE__).decode('utf-8')
                                              File "/data/app/org.xbmc.kodi-1/base.apk/assets/python2.7/lib/python2.7/site-packages/Cryptodome/Util/Padding.py", line 94, in unpad
                                                raise ValueError("Padding is incorrect.")
                                            ValueError: Padding is incorrect.

Deleting userdata/addon_data/plugin.video.netflix/database/nf_local.sqlite3 file should allow you to use the addon again, until we can understand what's going on.

You can backup the file for safety if you want.

No need to delete nf_shared.sqlite3.
More than no need, it's better to keep it!

Thank you. I'll try to delete it later. And this settings.xml is not needed anymore?

Settings.xml now contains only the settings you can change on screen, in the settings menu of the add-on. Username, password, and internal app settings are now in the database.

I also had the same problem. After deleting nf_local.sqlite3, I just logged in again, and the problem will still arise.

@chuds001 Can you please enable debug in Kodi, restart and provide full debug logs?

@Smeulf I deleted this file, opened the addon, entered email and password and the error about "ProfilesMissing" appeared. Tried to logout from addon settings and then appeared error "Existing credentials could not be decrypted"
log:https://paste.kodi.tv/uyijagesav.kodi

@ chuds001你能在Kodi中启用调试,重启并提供完整的调试日志吗?

kodi.log

@CastagnaIT I hope it's not related to __uniq_id() in credentials.py :/

i need someone make this test, it is not difficult but it is long to explain:

1-Uninstall prevoius netflix addon with all user data
2-Install this test version
3-Make sure that you have debug enabled
4-Do the Login to netflix addon
5-Extract the log (and save it separately)
6-Do some tests to intercept the error, when start to ask again the credentials so, close kodi, re-open kodi and the netflix addon without enter credentials
7-Extract the log (and save it separately)

so, if there is a problem with __uniq_id () so we should find out

This is the test addon file:
plugin.video.netflix_test1.zip

fresh install leila 18.4 arm7a 32bit / fresh android 6.0.1 on tvbox :

first log with test plugin (GUI error : you need to be logged in ...) : https://paste.kodi.tv/poducocihi
at the second launch of kodi it not ask for credentials , just open premium account box choice (not opened at first launch) , and just after that it open error box (missing profile).
2nd log : https://paste.kodi.tv/imusequqih

deepl english language sorry :(

However I can say that : after the problem suddenly appeared without any change on my boxtv or netflix account, I have flashing my rom (wipe all data) & installed kodi & the plugin and that didn't change anything (same error). I also installed kodi on my phone and the plugin works, as well as on my tablet. maybe banned ? mac adress ? dont known ;) thanks a lot for your great work !

Test logs
kodi1.log
kodi2.log

The same problem arose

Can someone take a look in userdata/addon_data/plugin.video.netflix/database/nf_local.sqlite3 and tell if there's something in the fields "email" and "password" inside the app_data table?

No need to disclose the values.

@Smeulf, I confirmed fields email and password.
However, I noticed that mac in __uniq_id() in credentials.py showed different value when set_credentials() and get_credentials() are invoked.

I noticed that mac in __uniq_id() in credentials.py showed different value when set_credentials() and get_credentials() are invoked.

Can you please post your logs? :)

App_data or app_config table
批注 2019-09-05 005526
批注 2019-09-05 005537

from the logs it is confirmed that on some android devices something strange happens in obtaining the mac address
I'll see how it can be done

maybe importing netifaces? Didn't check if it's in Kodi by default.
https://stackoverflow.com/questions/159137/getting-mac-address

sounds interesting, but no longer maintained i have saw a wrong link, better to look also at other solutions

i understand now that the uuid when failed to get mac address it generates one dynamically
and the code
if (mac >> 40) % 2:
say when is generated...
until now i didn't understand why the previous developer had put this condition

uuid.getnode()
Get the hardware address as a 48-bit positive integer. The first time this runs, it may launch a separate program, which could be quite slow. If all attempts to obtain the hardware address fail, we choose a random 48-bit number with its eighth bit set to 1 as recommended in RFC 4122. “Hardware address” means the MAC address of a network interface, and on a machine with multiple network interfaces the MAC address of any one of them may be returned.

https://docs.python.org/2/library/uuid.html for reference

yes, but i was not aware of the "random" part..

Just a warning if using netifaces:

We should not use the interface name, as in Windows, it may change.

What we can do is to loop over netifaces.interfaces() looking for the first Mac address at encryption.

At decryption, same process, but if it fails on the first, we can try any other Mac available before throwing an error and ask credentials again. This would ensure we can decrypt if the interface order had change.

Remains the issue where the interface is down, not sure how netifaces behave in this case, must be tested.

And also it will always be an issue if the network component is replaced :(

I'm still thinking about an another way to encrypt username and password, but not sure there's a real good way.

Netifaces cannot use it because it is not pure python but is compiled in C.
I need time to figure out the best way, or to change string type

@CastagnaIT it may have an impact on the auto export with MySQL enable too?

Same issue on OS X too

in the meantime I have hardcoded my tvbox mac address in credentials.py and it works, so you are right !
But I don't understand why uuid.getnode() failed now for get mac adress and not before ...

在此期间,我已经在credentials.py中硬编码了我的tvbox mac地址并且它有效,所以你是对的!
但我不明白为什么uuid.getnode()现在失败了获取mac地址而不是之前......

How to do it

I was looking at ANDROID_ID rather than the Mac address. However, I have no idea how to get it using Python.

https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID

Also, here.s an interesting topic about unique IDs:

https://stackoverflow.com/questions/36235807/fixed-identifier-for-a-machine-uuid-getnode

Maybe it can help to get some ideas ;)

unfortunately the MAC address is no longer good at least on new android versions,
starting from Android 9 may have been enabled by some brands the randomized MAC address, instead in Android 10 randomized mac address is enabled by default...

will be a nice mess for dedicated configurations with routers

Hi guys. Could someone please give more explanation on how to set a fixed mac address. Couldn't find credentials.py.

Thanks

on android : /android/data/org.xbmc.kodi/files/.kodi/addons/plugin.video.netflix/ressources/lib/common/credential.py

Below def __uniq_id() substitute :

if (mac >> 40) % 2:
        from platform import node
        mac =  node()

by

if mac >= 0:
        mac = YOUR MAC IN INTERGER FORMAT 

unsecure solution I think so.

Same here on Mac OS...
I confirm the temporary workaround of krom54 works.

unsecure solution I think so

Indeed totally unsecured.
Anyone using this workaround musk know in some way they're exposing the encryption key in case the system is attacked.

So please if you do it, do it with care and full knowledge.

Any way to make it work? Or do i have to keep deleting userdata/addon_data/plugin.video.netflix/database/nf_local.sqlite3 till i get a successful login?

I need someone who gives me availability to make a test
ONLY ON: APPLE devices like Macintosh and/or iphone and/or tablet

IMPORTANT!
SEND THE LOG FILE OR LINK IN PRIVATE FORM TO MY E-MAIL ADDRESS (first page of my github),
THE LOG CONTAINS PRIVATE INFORMATION OF THE DEVICE USED
THAT IS BETTER DO NOT MAKE THEM PUBLIC.

The test allows me to understand if i can get an ID of the device to encrypt your credentials,
i need to have TWO logs: one after opening the netflix addon, another one after a reboot of device in the same way.
Remember to enable kodi debug info

DONE

Done...

Same problem here on a new install on Arch Linux and kodi 18 (raise ProfilesMissing).

Edit: Although here, at least on a test py file, mac = uuid.getnode() does return my mac address in integer format (tried hex to dec and it's correct), so maybe it's not related to this thread.

My kodi log: https://paste.kodi.tv/abagojolol.kodi

Same issue here on an Intel NUC running Centos. Leia 18.4 compiled from source.

Got the issues with login & profiles missing.

Saw https://github.com/CastagnaIT/plugin.video.netflix/pull/192 and decided to try and download master as ZIP and install that way.

The password credential issue has been resolved for me in master.

Now seeing the profiles. But when trying to select a profile I get an error, here is the log:

https://paste.kodi.tv/liqemawidu.kodi

@greve can you please enable debug in kodi logging, restart Kodi, and reproduce the issue.
Then post your full debug logs. Thanks.

Here is the debug log of me entering the netflix plugin and trying to select my profile:

https://paste.kodi.tv/modenemuse.kodi

@greve @Smeulf That does not seem to be this code base. I don't find NetflixSession or Navigation.py. I think we are getting burnt for not appearing as the upstream project.

Maybe we should ask the other projects to fork ours instead?

greve use the deprecated version 0.13
this does not concern the addon of this repository

@greve @Smeulf That does not seem to be this code base.

This is with the plugin.video.netflix-master.zip I downloaded via "Clone or download > Download ZIP" from https://github.com/CastagnaIT/plugin.video.netflix about two hours ago.

You're saying I should be looking somewhere else? Or is Github somehow giving me the wrong thing? Typically I've been installing from the CastagnaIT repository, right now getting 0.15.2 there as latest version, but wanted to give master a try after I saw there had been movement on this issue, but no release.

I think we are getting burnt for not appearing as the upstream project.

FWIW, I think you guys are the upstream project.

Maybe we should ask the other projects to fork ours instead?

Which other projects are there? Most I could find looked dead like an ex-parrot.

@greve the log you have attached report files of version 0.13
i suggest you to uninstall your netflix addon also the addon user data

@greve @Smeulf That does not seem to be this code base.

This is with the plugin.video.netflix-master.zip I downloaded via "Clone or download > Download ZIP" from https://github.com/CastagnaIT/plugin.video.netflix about two hours ago.

Just reconfirmed.

When going to https://github.com/CastagnaIT/plugin.video.netflix I see the current master and the menu says that "Branch: master" is selected, but when doing "Download ZIP" I get the OLD version.

When going to https://github.com/CastagnaIT/plugin.video.netflix/tree/master I see the exact same thing, but "Download ZIP" gets me the NEW version.

WTF?

So... ZIP downloaded from https://github.com/CastagnaIT/plugin.video.netflix/tree/master and renamed to plugin.video.netflix-0.15.2.zip installs just fine and now log in works, and I can see the profiles, enter them, and managed to start an episode from one of the series.

So it appears that whatever fix you did works.

Thank you so much - and apologies for the noise. Github has really confused me there.

In any case: Thank you all for your great work on this plugin!

Let's use this opportunity to see what we can do to prevent this.

@CastagnaIT From a GitHub user's perspective it appears as if our repository is just another fork, and @asciidisco's repository is upstream. Most users end up on @asciidisco's repository as this is a first hit on Google anyway. Even though the README states it correctly, most users don't see that as it does not appear on-screen.

This confused me for a long time, and I was running @asciidisco's version for a long time assuming this was the latest and greatest version. I am unlikely to be alone in this.

I can see several solutions to this, but the easiest would be to:

  • Rename our current repo to e.g. plugin.video.netflix.orig
  • Transfer asciidisco's repo to your account (so people are redirected automatically and your's look authoritative)
  • Force-push your tree to the transferred plugin.video.netflix repository

Disadvantage: The current issues will be lost (we could migrate them)
Advantage: People will be redirected and the repository looks authoritative again

To me this looks as the best solution. And in the future it is always better to take over a project by transferring the project (incl. issues + PRs + projects, etc.) to the new location.

Even better would be to transfer it to a separate organisation, like: https://github.com/kodi-addons
so we get https://github.com/kodi-addons/plugin.video.netflix (and the location stays permanent and teams can get access to collaborate where needed, e.g. for translations or reviewing)

PS I tried to get Team Kodi involved to have such an organisation for kodi addons to collaborate, as we have already a few add-ons that would benefit from this, but Team Kodi is not interested and doesn't want another project to use Kodi in the name, so that has become a dead-end → https://forum.kodi.tv/showthread.php?tid=346818

I like the idea to transfer the original project to an organization (for this project only) and then force push this master. So if one day @CastagnaIT needs to quit, he can promote someone as the new maintainer.

But only @asciidisco and @CastagnaIT can find an agreement, and that means update the links again for every tutorials available on the internet...

first thing: this _issue is not the place to talk about this_

I will not adopt these solutions

Rename our current repo to e.g. plugin.video.netflix.orig
Transfer asciidisco's repo to your account (so people are redirected automatically and your's look authoritative)
Force-push your tree to the transferred plugin.video.netflix repository

the few inexperienced users who get confused just because they don't read what is written on the screen is not a valid reason to supplant a repository, there are also the right links on Kodi Forum.

the right thing to @smeulf, opening an organization can help you not create multiple fork repositories and you can assign different maintainers/administrators.
no need to consult asciidisco, i can try to create an organizazion there is to check which limitations the free version, so who wants to collaborate i can add when necessary

I was affected by this bug and can confirm that everything started working smoothly after downloading the master and installing it directly.
device :Minix Neo kodi 18

Was this page helpful?
0 / 5 - 0 ratings