HTTP.Get troubles

I am trying to use the Http.Get and GetCached methods but I keep getting an error message and I cannot figure out what is going on. It must be sonmething silly, here is my code :



[codebox]



import PMS

from PMS import Plugin, Log, XML, HTTP

from PMS.Objects import *

from PMS.Shortcuts import *

import re



(… CUT TOP OF THE SOURCE …)



def sub_category (sender, path , title = None, replaceParent=False, values=None):



dir = MediaContainer(title1="", title2=title, replaceParent=replaceParent)



player_address = WEB_ROOT+’/player/’+path

html = PMS.HTTP.Get(player_address)



[/codebox]



and I get the following error in the log :



[codebox]

13:03:52.493237: com.plexapp.plugins.PLUGIN : (Framework) Calling named function ‘sub_category’

13:03:52.498725: com.plexapp.plugins.PLUGIN : (Framework) An exception happened:

Traceback (most recent call last):

File “/Library/Application Support/Plex Media Server/Plug-ins/Framework.bundle/Contents/Resources/Versions/1/Python/PMS/Plugin.py”, line 464, in __call

return function(*args, **kwargs)

File “/Library/Application Support/Plex Media Server/Plug-ins/JTFrance2.bundle/Contents/Code/init.py”, line 105, in sub_category

html = PMS.HTTP.Get(player_address)

AttributeError: ‘module’ object has no attribute ‘Get’



13:03:52.501979: com.plexapp.plugins.PLUGIN : (Framework) Request not handled by plug-in

[/codebox]

I took a peek at other plugins and I do not see what I am doing different



I have tried HTTP.Get, HTTP.GetCached, PMS.HTTP.Get, PMS.HTTP.GetCached , no luck, I am about to try banging my head harder on my desk but I am not sure it will help … :slight_smile:



Any suggestion ?

Sorry it took so long for an answer!



For a V1 plug-in use HTTP.Request, which automatically caches. HTTP.Get / HTTP.GetCached were older V0 API calls.

no worries and thanks for the answer I will try it ASAP.

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