pigskin / kodi-gamepass

NFL Game Pass add-on for Kodi
Other
123 stars 83 forks source link

Gamelist for current week error after exiting and re-entering add-on #414

Closed kneespan closed 5 years ago

kneespan commented 5 years ago

I have the patched version from here: https://github.com/aqw/xbmc-gamepass/issues/410#issuecomment-423767878

On libreelec (raspberry). Fresh start in the morning - no hanging log in on other device or such. Game list for the current week doesn't show up. When i click the current week or future weeks I get an error. Past weeks show and play without problems.

09:40:26.433 T:1945448448   DEBUG: ------ Window Init (MyVideoNav.xml) ------
09:40:26.438 T:1945448448   DEBUG: CGUIMediaWindow::GetDirectory (addons://sources/video/)
09:40:26.438 T:1945448448   DEBUG:   ParentPath = [addons://sources/video/]
09:40:26.474 T:1086321568   DEBUG: Thread BackgroundLoader start, auto delete: false
09:40:26.494 T:1086321568 WARNING: CreateLoader - unsupported protocol(script) in script://plugin.video.nfl.gamepass/-poster.jpg
09:40:26.495 T:1086321568 WARNING: CreateLoader - unsupported protocol(script) in script://plugin.video.nfl.gamepass/-poster.png
09:40:26.496 T:1086321568 WARNING: CreateLoader - unsupported protocol(script) in script://plugin.video.nfl.gamepass/-banner.jpg
09:40:26.497 T:1086321568 WARNING: CreateLoader - unsupported protocol(script) in script://plugin.video.nfl.gamepass/-banner.png
09:40:26.498 T:1086321568   DEBUG: Thread BackgroundLoader 1086321568 terminating
09:40:26.532 T:1086321568   DEBUG: Thread JobWorker start, auto delete: true
09:40:26.535 T:1077932960   DEBUG: Previous line repeats 1 times.
09:40:26.535 T:1077932960   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.image_decode input port 320 output port 321 m_handle 0x636ffa98
09:40:26.537 T:1077932960   DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.image_decode) - port(320), nBufferCountMin(2), nBufferCountActual(2), nBufferSize(83760), nBufferAlignmen(16)
09:40:26.542 T:1094710176   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.image_decode input port 320 output port 321 m_handle 0x4fb242b8
09:40:26.544 T:1077932960   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.egl_render input port 220 output port 221 m_handle 0x645e66c0
09:40:26.544 T:1094710176   DEBUG: COMXCoreComponent::AllocInputBuffers component(OMX.broadcom.image_decode) - port(320), nBufferCountMin(2), nBufferCountActual(2), nBufferSize(81920), nBufferAlignmen(16)
09:40:26.547 T:1077932960   DEBUG: COMXCoreComponent::UseEGLImage component(OMX.broadcom.egl_render) - port(221), nBufferCountMin(1), nBufferCountActual(1), nBufferSize(15360) nBufferAlignmen(16)
09:40:26.574 T:1094710176   DEBUG: COMXCoreComponent::Initialize OMX.broadcom.egl_render input port 220 output port 221 m_handle 0x505f73b8
09:40:26.576 T:1094710176   DEBUG: COMXCoreComponent::UseEGLImage component(OMX.broadcom.egl_render) - port(221), nBufferCountMin(1), nBufferCountActual(1), nBufferSize(15360) nBufferAlignmen(16)
09:40:26.583 T:1077932960   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.image_decode handle 0x636ffa98
09:40:26.586 T:1077932960   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.egl_render handle 0x645e66c0
09:40:26.587 T:1077932960   DEBUG: DecodeJpegToTexture: decoded special://masterprofile/Thumbnails/d/d0faa1aa.jpg 1280x720
09:40:26.600 T:1094710176   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.image_decode handle 0x4fb242b8
09:40:26.603 T:1094710176   DEBUG: COMXCoreComponent::Deinitialize : OMX.broadcom.egl_render handle 0x505f73b8
09:40:26.604 T:1094710176   DEBUG: DecodeJpegToTexture: decoded special://masterprofile/Thumbnails/b/bd256dce.jpg 512x512
09:40:32.725 T:1782576032   DEBUG: PushCecKeypress - received key  b duration 0 (rep:0 size:0)
09:40:32.725 T:1782576032   DEBUG: PushCecKeypress - added key  b
09:40:32.747 T:1945448448   DEBUG: OnKey: 11 (0x0b, obc244) pressed, action is Select
09:40:32.749 T:1170207648   DEBUG: Thread LanguageInvoker start, auto delete: false
09:40:32.752 T:1170207648    INFO: initializing python engine.
09:40:32.752 T:1170207648   DEBUG: CPythonInvoker(210, /storage/.kodi/addons/plugin.video.nfl.gamepass/default.py): start processing
09:40:32.771 T:1077932960   DEBUG: CAddonDatabase::SetLastUsed[plugin.video.nfl.gamepass] took 22 ms
09:40:32.835 T:1170207648   DEBUG: -->Python Interpreter Initialized<--
09:40:32.835 T:1170207648   DEBUG: CPythonInvoker(210, /storage/.kodi/addons/plugin.video.nfl.gamepass/default.py): the source file to load is "/storage/.kodi/addons/plugin.video.nfl.gamepass/default.py"
09:40:32.839 T:1170207648   DEBUG: CPythonInvoker(210, /storage/.kodi/addons/plugin.video.nfl.gamepass/default.py): setting the Python path to /storage/.kodi/addons/plugin.video.nfl.gamepass:/storage/.kodi/addons/script.module.certifi/lib:/storage/.kodi/addons/script.module.chardet/lib:/storage/.kodi/addons/script.module.idna/lib:/storage/.kodi/addons/script.module.iso8601/lib:/storage/.kodi/addons/script.module.m3u8/lib:/storage/.kodi/addons/script.module.requests/lib:/storage/.kodi/addons/script.module.urllib3/lib:/usr/lib/python27.zip:/usr/lib/python2.7:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/lib/python2.7/site-packages:/usr/lib/python2.7/site-packages/gtk-2.0
09:40:32.839 T:1170207648   DEBUG: CPythonInvoker(210, /storage/.kodi/addons/plugin.video.nfl.gamepass/default.py): entering source directory /storage/.kodi/addons/plugin.video.nfl.gamepass
09:40:32.839 T:1170207648   DEBUG: CPythonInvoker(210, /storage/.kodi/addons/plugin.video.nfl.gamepass/default.py): instantiating addon using automatically obtained id of "plugin.video.nfl.gamepass" dependent on version 2.25.0 of the xbmc.python api
09:40:32.952 T:1782576032   DEBUG: PushCecKeypress - received key  b duration 228 (rep:0 size:0)
09:40:32.952 T:1782576032   DEBUG: PushCecKeypress - ignored key  b
09:40:34.647 T:1170207648   ERROR: EXCEPTION: Dialog not created.
09:40:34.738 T:1170207648   ERROR: No active NFL Game Pass Europe subscription was found.
09:40:34.739 T:1170207648   DEBUG: .
09:40:34.778 T:1170207648   ERROR: _gp_auth: server response is invalid
09:40:34.779 T:1170207648   DEBUG: .
09:40:34.780 T:1170207648   ERROR: Could not acquire GP tokens
09:40:34.780 T:1170207648   DEBUG: .
09:40:35.706 T:1170207648 WARNING: CSkinInfo: failed to load skin settings
09:40:36.503 T:1945448448   DEBUG: Activating window ID: 13001
09:40:37.047 T:1945448448   DEBUG: ------ Window Deinit (MyVideoNav.xml) ------
09:40:37.057 T:1945448448   DEBUG: ------ Window Init (/storage/.kodi/addons/plugin.video.nfl.gamepass/resources/skins/Default/1080i/script-gamepass.xml) ------
09:40:37.057 T:1945448448    INFO: Loading skin file: /storage/.kodi/addons/plugin.video.nfl.gamepass/resources/skins/Default/1080i/script-gamepass.xml, load type: LOAD_ON_GUI_INIT
09:40:37.182 T:1945448448   DEBUG: CGUIMediaWindow::GetDirectory ()
09:40:37.182 T:1945448448   DEBUG:   ParentPath = []
09:40:37.220 T:1170207648   ERROR: EXCEPTION: Dialog not created.
09:40:37.222 T:1945448448 WARNING: COMXImageFile::GetCodingType progressive images not supported by decoder
09:40:37.222 T:1945448448   DEBUG: COMXImageFile::ReadFile /storage/.kodi/addons/plugin.video.nfl.gamepass/resources/skins/Default/media/../../../art/fanart.jpg GetCodingType=0x7fffffff (1280x720)

Any other debug log needed?

Thank you.

kneespan commented 5 years ago

Is this project dead? That would be very sad - I used this add-on for years.

Ghoschdi commented 5 years ago

No, just download the latest master from github, install it via zip in Kodi, enable inputstream and it works like a charm.

aqw commented 5 years ago

Hey @kneespan This project is not dead, it's just that I don't have a lot of time.

I cannot reproduce your problem. If you want an immediate fix, you'll have to debug it yourself, or convince one of the other lurking devs. Otherwise, I can't promise much in the next 2 weeks.

---Alex

OnceUponALoop commented 5 years ago

@kneespan the debug logging for the add-on is currently broken, you'll need to add <setting id="debug" value="true" /> to your add-on settings.xml file to get any output that can be used for debugging.

!!! Don't submit the log without making sure your username, password, name, address, etc... are not removed

That's why the debugging issues hasn't been fixed yet, the add-on needs to be updated to anonymize the logs - reference #402 & #405

kneespan commented 5 years ago

First of all - thanks for a really great add-on !! And thanks for the inputs, guys.

I uninstalled everything, deleted all config, installed the latest master, enabled Input-stream. Unfortunately, the issue still exists as described:

Do you need additional debug log or something - how can I help? Is the debug log above inconclusive or incomplete? Do I need to insert the setting from the comment above and re-post a debug log? Thanks.

EDIT: I can confirm it is a Kodi with Libreelec issue. Tested on other Kodi installations and the add-on worked fine. Issue title edited accordingly.

OnceUponALoop commented 5 years ago

@kneespan you'll need to make the change from my last comment to get any useful log output - without that you're going to be shooting in the dark, the log you pasted in the first comment is just kodi boilerplate stuff with no log entries from gamepass.

kneespan commented 5 years ago

OK thank you @OnceUponALoop I will do that asap.

I have new results: I was able to reproduce the behavior on any Kodi installation with newest master and Inputstream enabled. The problem seems to occur only after exiting and re-entering the add-on. The first time after initially starting Kodi, the add-on works normally. After exiting the app and re-entering, the problem occurs on any installation of Kodi. On Windows after exiting Kodi and restarting Kodi, the add-on works again until exiting and re-entering the add-on. On Libreelec after restarting Libreelec, the add-on works again until exiting the add-on and re-entering the add-on.

kneespan commented 5 years ago

OK guys - I debugged it myself. The problem is here in pigskin:

    def nfldate_to_datetime(self, nfldate, localize=False):
        """Return a datetime object from an NFL Game Pass date string.

        Parameters
        ----------
        nfldata : str
            The DIVA config URL that you need parsed.
        localize : bool
            Whether the datetime object should be localized.

        Returns
        -------
        datetime
            A datetime object when successful, None otherwise.
        """
        nfldate_format = '%Y-%m-%dT%H:%M:%S.%fZ'

        try:
            dt_utc = datetime.strptime(nfldate, nfldate_format)
        except ValueError:
            self.logger.error('unable to parse the nfldate string')
            return None

        if localize:
            try:
                return dt_utc.replace(tzinfo=timezone.utc).astimezone(tz=None)
            except NameError:  # Python 2.7
                return self.utc_to_local(dt_utc)
            except Exception:
                self.logger.error('unable to localize the nfl datetime object')
                return None

        return dt_utc

when called after exiting and re-entering the add-on, datetime seems to be undefined here:

dt_utc = datetime.strptime(nfldate, nfldate_format)

I'm not able to step INTO the function and the error is TypeError: "attribute of type 'NoneType' is not callable"

I cannot explain, why it is undefined - all parameters seem identical. Something with initializing pigskin that happens only the first time the add-on is started?

I found an old thread with the exact same problem: https://forum.kodi.tv/showthread.php?tid=112916

But unfortunately the workaround from there is not working. Any ideas? @aqw ;) Thanks.

OnceUponALoop commented 5 years ago

@kneespan awesome work man. I can confirm I've seen this exact issue but haven't been able to pin down a scenario that would replicate it and kinda shrugged it off as a result of my fork being a work in progress.

How are you triggering this behavior? Does it happen every time? I've tried to just exit a working session and re-enter and couldn't replicate it. Now that i have a remote debugger setup it should be easy enough to nail it down.

suikerchiller commented 5 years ago

Thanks for the work @kneespan, I have the exact same issue with my kodi/libreelec setup. It would be great if someone knows a workaround as I'm stuck with laptop streaming atm.

OnceUponALoop commented 5 years ago

@suikerchiller If it's this specific issue then it can be resolved by just restarting kodi - the only time i've seen it was when relaunching the app.

@kneespan have you been able to replicate it at all today? I've tried it 10 different ways and i can't seem to get it to trigger the issue.

What i've tried 1- Start GP, play any game 2- Exit GP 3- Open GP, click gamepass

I tried playing a video from my library in between and it didn't seem to affect anything.

The last time I saw this issue was on Thursday, I wonder if it only shows up between thurs and sunday before the whole game list populates. If you're seeing it today please let me know, it'll at least eliminate that possibility.

kneespan commented 5 years ago

@OnceUponALoop since the error only occurs on future games, the error occurs only until all games of the current week have been played. yes - today I still have the error. Tomorrow it will be gone for week 10.

OnceUponALoop commented 5 years ago

@kneespan thanks a bunch for the input, the forum post you linked to was the key, should've paid more attention to your post initially instead of banging my head against it. I couldn't replicate because it doesn't show with a remote debugger attached 😕

I submitted a pull request (#417) for it, it'll be available when @aqw merges it in.