Kodi Community Forum

Full Version: Netflix Add-on [input-stream]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2021-08-14, 19:36)knappster Wrote: [ -> ]
(2021-08-03, 04:46)knappster Wrote: [ -> ]@CastagnaIT absolutely. Here is a log for 59.94 Hz:
https://paste.kodi.tv/xunobeboxu.kodi

The playback hesitated when the video showed 56.30 seconds on the screen.

@CastagnaIT I am not sure if it is something you have changed, but I have played the test video at 23.976 fps for over 10 minutes without a frame skip now. Thanks for your help!

there are no changes, the video decoding is not managed by this addon but from kodi/inputstream addon
 
(2021-08-16, 20:12)hlloyge Wrote: [ -> ]Hello!
I have Kodi 19 on Ubuntu Server 18, all updated to last version. 
Netflix autoupdated to 1.17.0, but couldn't start anything with it, it would complain about "No module named 'contextvars'".
I've downgraded it to 1.16.2, and it works as it did before.
InputStream Adaptive is 2.6.23
inputStream Helper is 0.57
I've noticed that there is no message about starting background services with new version of Kodi plugin.
Here is the log after the system update (sudo apt update && sudo apt upgrade) and reboot, you can see failed browsing, downgrading and successful playing afterwards:
https://paste.kodi.tv/duqohalika.kodi
(2021-08-18, 20:04)darkdude18 Wrote: [ -> ]Just want to confirm the "contextvars" error on 1.17.0 and Ubuntu 18.04.5.

ensure to have at least python version 3.7 or above
Can't log in. Email correct, password correct, can log in using a web browser.
(2021-08-21, 21:59)YeahWhatever Wrote: [ -> ]Can't log in. Email correct, password correct, can log in using a web browser.

YeahWhatever - Did you try to follow the information in the wiki - https://github.com/CastagnaIT/plugin.vid...cation-key
After installing repo 1.0.0 for matrix
i try to run netflix addon i get error: no module named 'crypto'
(2021-08-20, 17:58)CastagnaIT Wrote: [ -> ]ensure to have at least python version 3.7 or above
Not that easy with Ubuntu LTS, without breaking stuff. AFAIR, I can break system to the point it won't boot - and just installing it side by side won't work as apps won't pick up default Python installation.
Is it necessary to use that version of Python for building plugin? If it is, I'll have to reinstall whole system to have newer updates.
In my case a HTPC is also a a smart home controller and at least form now I can't risk breaking it during distro upgrade. I know that the world is going forward. But if you could include a warning in the changelog that 1.17+ require Python >=3.7 and will not work on Ubuntu 18.04 based systems, it will save some people from searching for the cause.
(2021-08-23, 00:23)hlloyge Wrote: [ -> ]
(2021-08-20, 17:58)CastagnaIT Wrote: [ -> ]ensure to have at least python version 3.7 or above
Not that easy with Ubuntu LTS, without breaking stuff. AFAIR, I can break system to the point it won't boot - and just installing it side by side won't work as apps won't pick up default Python installation.
Is it necessary to use that version of Python for building plugin? If it is, I'll have to reinstall whole system to have newer updates.

it is possible that the problem is focused only on contextvars module,
there is this backport for python 3.6
https://github.com/MagicStack/contextvars
if you have a certain level of python knowledge you can try install it
but i do not know if will works or will cause other problems
(2021-08-23, 00:23)hlloyge Wrote: [ -> ]
(2021-08-20, 17:58)CastagnaIT Wrote: [ -> ]ensure to have at least python version 3.7 or above
Not that easy with Ubuntu LTS, without breaking stuff. AFAIR, I can break system to the point it won't boot - and just installing it side by side won't work as apps won't pick up default Python installation.
Is it necessary to use that version of Python for building plugin? If it is, I'll have to reinstall whole system to have newer updates.

Yes, that is why I suggested to move to Ubuntu 20.04 LTS.
Kodi 19 works on Python 3.7.5 or above 3.6 or above (Thanks Fuzzard) and on Windows and Android comes with 3.8.5. On linux it relies on System Python and with Ubuntu 18.04LTS stuck at Python 3.6 can't do much. SO if you want to use Ubuntu 18.04LTS, then stick with Kodi 18.9 and if you want to move to Kodi19.x move to Ubuntu 20.04LTS first
(2021-08-24, 01:45)gujal Wrote: [ -> ]
(2021-08-23, 00:23)hlloyge Wrote: [ -> ]
(2021-08-20, 17:58)CastagnaIT Wrote: [ -> ]ensure to have at least python version 3.7 or above
Not that easy with Ubuntu LTS, without breaking stuff. AFAIR, I can break system to the point it won't boot - and just installing it side by side won't work as apps won't pick up default Python installation.
Is it necessary to use that version of Python for building plugin? If it is, I'll have to reinstall whole system to have newer updates.

Yes, that is why I suggested to move to Ubuntu 20.04 LTS.
Kodi 19 relies on Python 3.7.5 or above and on Windows and Android comes with it. On linux it relies on System Python and with Ubuntu 18.04LTS stuck at Python 3.6 can't do much. SO if you want to use Ubuntu 18.04LTS, then stick with Kodi 18.9 and if you want to move to Kodi19.x move to Ubuntu 20.04LTS first



Just to clarify, kodi itself doesnt rely on python 3.7 as minimum. It will work with 3.6. However if addon devs utilise features/modules that arent available in 3.6 (which this sounds like the case) then you are going to come across these issues.

Any platform that isnt linux currently uses 3.8.5 as a static library, but linux uses system shared libs. We have kept 3.6+ compatiblity with the python capi because of the linux usecase. Addon devs can do as they wish around module usage.

The advise by castagnaIT regarding the backport module of contextvars to 3.6 may be the best work around for this user.
(2021-08-23, 19:54)CastagnaIT Wrote: [ -> ]it is possible that the problem is focused only on contextvars module,
there is this backport for python 3.6
https://github.com/MagicStack/contextvars
if you have a certain level of python knowledge you can try install it
but i do not know if will works or will cause other problems
Unfortunately, I don't have enough Python knowledge, I've tried "pip install contextvars" as it says on page, but it drops out with an error.
(2021-08-24, 01:45)gujal Wrote: [ -> ]On linux it relies on System Python and with Ubuntu 18.04LTS stuck at Python 3.6 can't do much. SO if you want to use Ubuntu 18.04LTS, then stick with Kodi 18.9 and if you want to move to Kodi19.x move to Ubuntu 20.04LTS first
Yeah, well, I didn't expect to fall out of date so soon. I've installed the system almost exactly two years and one month ago. Went from Kodi v18 to v19.
(2021-08-24, 03:19)Fuzzard Wrote: [ -> ]Any platform that isnt linux currently uses 3.8.5 as a static library, but linux uses system shared libs. We have kept 3.6+ compatiblity with the python capi because of the linux usecase. Addon devs can do as they wish around module usage.
The advise by castagnaIT regarding the backport module of contextvars to 3.6 may be the best work around for this user.
I understand the idea, but: wouldn't it be better for addons to support the Python version Kodi supports for that particular version? I understand that with (example) Kodi 20 Python version required could be upped to, dunno, v4 (if it comes out) so I'll have to reinstall if I want newest Kodi version, but as long as Kodi supports 3.6, I think the addons should also support 3.6. Doesn't make sense if it's different requirement, plugin is made for version 19, and it doesn't work on version 19.
As for the backport module, I can't install it, I don't really know how - and couldn't find anything on that git to help me with it, so I'll freeze last good version of plugin and use it until it either breaks or new version of Kodi goes out, and I'll have to reinstall system anyway.
> I understand the idea, but: wouldn't it be better for addons to support the Python version Kodi supports for that particular version?
> but as long as Kodi supports 3.6, I think the addons should also support 3.6

unfortunately, the things cannot always work that way

when you develop and you need to add support to new technologies you have two possibilities,
keep legacy dependecies/code and continue to have problems until everything breaks down,
or switch to new dependencies with the possible side effect of cutting off users with older versions of python

limit addons to always ensure compatibility with older python versions is not always feasible or a good choice,
this depends on the complexity of addon source code and what needs are required in some specific contexts

however this is also news to me that python 3.6 is no longer fully supported by some dependencies
it is possible that this premature choice (made by those who develop those dependencies) is because python 3.6 will be discontinued at the end of this year
(2021-08-24, 15:54)CastagnaIT Wrote: [ -> ]> I understand the idea, but: wouldn't it be better for addons to support the Python version Kodi supports for that particular version?
> but as long as Kodi supports 3.6, I think the addons should also support 3.6

unfortunately, the things cannot always work that way

when you develop and you need to add support to new technologies you have two possibilities,
keep legacy dependecies/code and continue to have problems until everything breaks down,
or switch to new dependencies with the possible side effect of cutting off users with older versions of python

limit addons to always ensure compatibility with older python versions is not always feasible or a good choice,
this depends on the complexity of addon source code and what needs are required in some specific contexts

however this is also news to me that python 3.6 is no longer fully supported by some dependencies
it is possible that this premature choice (made by those who develop those dependencies) is because python 3.6 will be discontinued at the end of this year

Python3 is a moving target. The cpython Devs do not ensure complete backwards compat, and they are actively deprecating and removing features/modules in their point releases.
This really has nothing to do with Kodi, it's how python is being developed.
We actively made sure python 3.6 can be used as at the time of release, the lts version of Ubuntu included 3.6. we aim to have the 2 latest versions of Ubuntu lts supported (with whatever default system libs it ships with), but this still requires python Devs to accommodate any differences in the python language across cpython versions

As for the contextvars usage, it's just it was only brought into python3 with 3.7. so I guess add-on Devs either need to have a try block to fallback to some other codepath that doesn't use it, or you will need to say to Linux users your add-on requires python3.7+.

Again, this isn't an issue Team Kodi can solve sorry.
(2021-08-24, 21:39)Fuzzard Wrote: [ -> ]As for the contextvars usage, it's just it was only brought into python3 with 3.7. so I guess add-on Devs either need to have a try block to fallback to some other codepath that doesn't use it, or you will need to say to Linux users your add-on requires python3.7+.

this is a native py dependency of another dependency of a module used by the addon
i will not spend time trying to circumvent the problem
i have already updated the addon wiki install instructions,
if someone else wants to investigate for a solution then i will be pleased to add the instructions in the wiki on how solve it
Totally acceptable. Thats your call as the addon dev. Im just wanting to let people know its not something team kodi can change, and indeed as time marches on, more scenarios like this may occur with other modules.
OK, so, an update to the situation - I've managed to install that contextvars, this time I tried with pip3, but first I had to install pip3, and it pulled up a lot of dependencies - and it managed to install contextvars without any errors.
I've rebooted the machine and reinstalled latest Netflix plugin, but "background services" just wouldn't start.
Rebooted once more to be sure, nothing. Reverted to last known good version and it works.

Backported contextvars solution doesn't work - at least not in the way I've installed it. Maybe someone with more python knowledge could make it work, but I suspect that there is more things that are not compatible, not just contextvars.
So, as it is now, Netflix plugin (as of version 1.17) doesn't support Ubuntu 18.04.5 LTS any more, 1.16.2 is the last version that works.