Need help with plugin on Roku

Getting wierd error on callback
Hi,
I am using a TVShowObject

               oc.add(TVShowObject(<br />
                    key = Callback(GetEpisodes, id = id),<br />
                    rating_key = str(id) + TXT(item["name"]),<br />
                    title = TXT(item["name"]),<br />
                    rating = float(item["mark_total"]),<br />
                    originally_available_at = originally_available_at))<br />
                Log(">> Adding  Done")<br />


This works fine on my iphone and on my windows 7 client.



But accessing this object on Roku creates the following the error seen below, I have no reference to a query parameter

Please help i have no idea how to go about fixing this, I can share the full code if someone wants to help.

Thanks!!!





2012-05-01 23:19:33,358 (bb0) : DEBUG (core:324) - Handling request GET /video/etvnet3/:/function/GetEpisodes/493114

2012-05-01 23:19:33,358 (bb0) : DEBUG (core:324) - Calling function ‘GetEpisodes’

2012-05-01 23:19:33,358 (10c0) : DEBUG (prefskit:320) - Loaded the user preferences for com.plexapp.plugins.efnet3

2012-05-01 23:19:33,358 (bb0) : CRITICAL (core:324) - Exception when calling function ‘GetEpisodes’ (most recent call last):

File “C:\Users\denisber\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\code.py”, line 698, in call_named_function

result = f(*args, **kwargs)

TypeError: GetEpisodes() got an unexpected keyword argument ‘query’

Hi madnut,

Can you please post all of your code (using pastebin.com or a smimilar service) so we can have a look at it? Especially interested in how the GetEpisodes() function looks.

Link to full code



<br />
def GetEpisodes(id, page = 1):<br />
    Log(">> GetEpisodes id:%s" % id)<br />
    sortby = SORT_VALUES[0]<br />
    sortdir = DIR_VALUES[0]<br />
<br />
    oc = ObjectContainer()<br />
    url = API_URL +"media/details/"+str(id) + ".json?" + "per_page=" + PERPAGE + "&sort=" + sortby + "&dir=" + sortdir<br />
    if (page > 1):<br />
        url = url + "&page=" + str(page)<br />
<br />
    objMedia = JSON.ObjectFromURL(url)<br />
    <br />
    for item in objMedia["children"]:<br />
        eps = GetEpisodeOrSeason(id = item["id"])<br />
        if not eps == None:<br />
            oc.add(eps);<br />
<br />
    if (objMedia["media"]["children_page_info"]["current"] != objMedia["media"]["children_page_info"]["total"]):<br />
        oc.add(DirectoryObject(<br />
            key = Callback(GetEpisodes, id = id, page = page + 1),<br />
            title = objMedia["media"]["name"] + TXT(" -> Страница ") + str(page + 1),<br />
            thumb = R("next.png")))<br />
<br />
    return oc<br />


just rename “page” to “query”

This is bizarre :slight_smile: (probably not what you wanted to hear!)



If other clients are behaving correctly, I’m tempted to blame the Roku client, but I’d like a bit more information about what’s going on so I can hopefully point the developer in the right direction. The “query” parameter is a result of some backwards compatibility code - older plug-ins would append search queries to the end of the function URLs as another path component (rather than appending &query=), so the framework is translating the last path component in that URL to the query argument.



Can you post the XML returned by your GetCategories function?



Seemed bizarre to me :) BTW replacing TVShowObject with DirectoryObject makes it work as expected.
I am not sure how to capture the xml that GetCategories returns (quite new to plex/pyton), can you describe how to do so?

Thanks!

That’s especially strange, since they’re both directory types :slight_smile: It certainly points to a bug in the Roku code, though!



In the log, you can see the plug-in generating lines starting with “Handling request…” - this lets you know what path the client was requesting. You can view the XML in any web browser by hitting http://localhost:32400/(path from the log).

Hi,

I have a similar error while trying to connect to TOU.TV from the Plex client on Roku and on Windows XP. Here is the extract from the log while using the windows client, the error is exactly the same with the Roku client.




I tried your suggestion of opening http://localhost:32400/video/TOU.TV/ with a browser as you suggested to madnut, and I get this:


When I use the full string IE9 gives me a 404 error and Safari shows a blank page.


I have truncated the function_args since it is a huge string of 30927 characters for the first one and 30927 characters for the second one.

Any idea what might be wrong?

The error in the plugin log indicates that the plugin isn’t able to find the relevant details about how to get the video stream. Most likely, the website has hanged somewhat and the plugin needs updating.

when safari gives you a blank page has it actually started downloading the stream as a file download?



I wouldnt ever trust any error IE gives you. they hijack empty body responses or error pages that are less than a certain number of bytes.



No, safari has not started downloading.

This feels like there is a problem with the link.

The size of the parameter is close to 30K, this makes me wonder if it can be a problem with some of the string manipulation that the plugin has to do.

By the way, the browsing of the channel content works, it is only when I actually request a video that the error occurs.

I did a bit of testing on other channels yesterday, and noticed that for the CBC channel, some videos work and some don't. I cannot recall which ones just now, but if that helps someone I can make notes the next time I try.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.