[RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 2
I've traced the source of the "No JSON object could be decoded" issue that a few of you have been having. Was experiencing it too so took a look at the logs and tried the JSON queries myself so I could see what the responses were.

The issue appears to be related to availability of shows in the US compared to where we are located.

When NetfliXBMC submits a request to Netflix's JSON API it splits the language listed in it's settings file by the '-' and uses that as language and region. It appears to default to en-US, and I can't see any way to change it in the config in Kodi. This means if it submits a request for a show that isn't available in the US but is in your region it doesn't get given any seasons to list.

So, for Better Call Saul, which isn't available on Netflix in the US
Code:
Request: http://api-global.netflix.com/desktop/odp/episodes?languages=en&forceEpisodes=true&routing=redirect&video=80021955&country=US
Response:
{
    "creators": [
        "Vince Gilligan",
        "Peter Gould"
    ],
    "episodes": [
    ],
    "nextEpisode": {
    },
    "numSeasons": 0,
    "rating": "TV-MA",
    "synopses": [
    ],
    "title": "Better Call Saul",
    "videoId": 80021955,
    "year": 2015
}

Compared to the following if I use GB (where it is available)

Code:
Request: http://api-global.netflix.com/desktop/odp/episodes?languages=en&forceEpisodes=true&routing=redirect&video=80021955&country=GB
Response:
{
    "creators": [
        "Vince Gilligan",
        "Peter Gould"
    ],
    "episodes": [
        [
            {
                "availabilityMessage": null,
                "availableForED": true,
                "bookmarkPosition": null,
                "episode": 1,
                "episodeId": 80021956,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 53,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so0.akam.nflximg.com/soa1/832/1720089832.jpg",
                        "width": 180
                    },
                    {
                        "height": 480,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so0.akam.nflximg.com/soa1/053/1720088053.jpg",
                        "width": 853
                    }
                ],
                "synopsis": "Struggling lawyer Jimmy McGill tries to leave his seedy past behind him, but old habits die hard when a big opportunity presents itself.",
                "title": "Uno",
                "videoId": 80021955
            },
            {
                "availabilityMessage": null,
                "availableForED": true,
                "bookmarkPosition": null,
                "episode": 2,
                "episodeId": 80021957,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 46,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so1.akam.nflximg.com/soa4/104/1719579104.jpg",
                        "width": 180
                    },
                    {
                        "height": 480,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so1.akam.nflximg.com/soa3/058/1719577058.jpg",
                        "width": 853
                    }
                ],
                "synopsis": "In a tense and violent standoff with dangerous criminals, Jimmy will live or die based on his own powers of persuasion.",
                "title": "Mijo",
                "videoId": 80021955
            },
            {
                "availabilityMessage": null,
                "availableForED": true,
                "bookmarkPosition": null,
                "episode": 3,
                "episodeId": 80021958,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 47,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so0.akam.nflximg.com/soa5/832/1879311832.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "With the cops holding his dangerous new client, Jimmy tries to point the police in another direction while saving his own skin in the process.",
                "title": "Nacho",
                "videoId": 80021955
            },
            {
                "availabilityMessage": null,
                "availableForED": true,
                "bookmarkPosition": null,
                "episode": 4,
                "episodeId": 80021959,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 47,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 1,
                        "type": "INTERESTING",
                        "url": "http://so1.akam.nflximg.com/soa6/037/1888237037.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "A desperate Jimmy gets creative in order to drum up new business and manages to sneak in a little revenge for good measure.",
                "title": "Hero",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Available March 3",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 5,
                "episodeId": 80021960,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 44,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "Jimmy tests the waters in a new area of law practice while doing his best to keep his brother out of harm's way.",
                "title": "Alpine Shepherd Boy",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Available March 10",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 6,
                "episodeId": 80021961,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 0,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "",
                "title": "Episode 6",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Available March 17",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 7,
                "episodeId": 80021962,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 0,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "",
                "title": "Episode 7",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Available March 24",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 8,
                "episodeId": 80021963,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 0,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "",
                "title": "Episode 8",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Available March 31",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 9,
                "episodeId": 80021964,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 0,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "",
                "title": "Episode 9",
                "videoId": 80021955
            },
            {
                "availabilityMessage": "Coming in April",
                "availableForED": false,
                "bookmarkPosition": null,
                "episode": 10,
                "episodeId": 80021965,
                "lastModified": null,
                "nonMemberViewable": false,
                "runtime": 0,
                "season": 1,
                "seasonId": 80021755,
                "seasonYear": 2015,
                "stills": [
                    {
                        "height": 101,
                        "offset": 0,
                        "sequence": 0,
                        "type": "INTERESTING",
                        "url": "http://cdn0.nflximg.net/images/7120/12117120.jpg",
                        "width": 180
                    }
                ],
                "synopsis": "",
                "title": "Episode 10",
                "videoId": 80021955
            }
        ]
    ],
    "nextEpisode": {
    },
    "numSeasons": 1,
    "rating": "15",
    "synopses": [
        "Jimmy McGill was a small-time lawyer, hustling to make ends meet. This is how the search for his destiny and the story of Saul Goodman collide."
    ],
    "title": "Better Call Saul",
    "videoId": 80021955,
    "year": 2015
}

Modifying my settings file (userdata/addon_data/plugin.video.netflixbmc/settings.xml if you use the master profile, userdata/profiles/[profile name]/addon_data/plugin.video.netflixbmc/settings.xml if you use multiple profiles) so that language is en-GB rather than en-US gets me into the list of seasons, but then it won't let me into the season of Better Call Saul. It does however work perfectly now for me with shows like QI that aren't available in the US, but are in the UK, and have multiple seasons. I'll need to find a single season UK show to see if it is to do with only having one season, or Saul's listing things that aren't available to play yet.

[EDIT] Ok, found a single season series of documentaries that seem to be not available in the US, but are in the UK, and they work fine, so it appears Saul has it's own specific problems in addition to the original ones.
[EDIT AGAIN] Looks like this is the same Division by Zero issue Carst was getting. It's happening in default.py on line 455 which appears to check if the episode has already been played by checking if the bookmarkPosition is past 90% of the play time, Carst's guess was exactly what the source of the problem was. changing line 455 to be
Code:
if float(duration)>0 and (float(bookmarkPosition)/float(duration))>=0.9:
is a good enough workaround for now, but the yet to air episodes are still listed as available to watch for us and when selected result in "an error occurred" page in chrome so long term it'd be better to also run checks on the "availabilityMessage" field, which seems to be null once available and "Available {DATE}" if not yet available, and hide anything that isn't watchable yet.

You'll need to use your own country code, so for example en-NL should work if you are in the Netherlands (not tested what changing the en to represent a different language would do, I suspect return the description in that language. en-NL definitely returns an acceptable JSON response for Better Call Saul. Not sure what is exclusively available in any non-English countries, so can't test what happens with shows that might not have English descriptions available). I suspect they are using the ISO country codes.
Reply


Messages In This Thread
Who's Watching is empty? - by RiverBend - 2015-01-08, 18:55
RE: [RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 2 - by Lastof - 2015-03-01, 16:45
Full-screen mode - by oakertood - 2015-03-29, 01:08
25% - by Mattlock - 2015-07-06, 03:56
Additional/Original Browser Option? - by durv - 2015-09-07, 05:07
[RELEASE] NetfliXBMC - EMPTY LISTS - by Nibar - 2015-12-08, 03:38
Logout Mark Read Team Forum Stats Members Help
[RELEASE] NetfliXBMC - Unofficial Netflix Add-on (Win/OSX/Linux) - Thread 217