python api

somes's Avatar

somes

17 Feb, 2011 08:16 PM via web

Trying to use the follow snippet

folderlist = api.get_folder_list()
if folderlist:

for f in folderlist: print f.name

but it generates the following error

Traceback (most recent call last):
File "/home/ms/putfiles.py", line 37, in

AttributeError: 'Folder' object has no attribute 'name'

anyone know why

is it possible to download files using python - if so how :)

tks
M

  1. 2 Posted by tunix on 17 Feb, 2011 11:27 PM

    tunix's Avatar

    Hello somes,

    Please have a look at [this](
    https://github.com/tunix/xbmc.put.io/blob/master/plugin.video.putio/resources/lib/common.py)
    where you can find a sample usage of it. That error might be related with
    some bug in the API. We'll have a look at that too.

    Thanks for reporting!

    ---
    Quis custodiet ipsos custodes?

  2. 3 Posted by aft on 18 Feb, 2011 08:31 AM

    aft's Avatar

    Hello somes,
    You are right. There is a bug in the python library. To fix it, open putio.py with an editor and go to line 1226. You'll see

    Item.__init__(self, dictionary, **args)
    

    Change this line to:

    Item.__init__(self, api, dictionary, **args)
    

    and save the file.

    The code should work after this change.

    You can find common usage samples on http://code.google.com/p/putio-api/source/browse/trunk/sample/pytho...

    You can download items with curl or pycurl. I can recommend jacktasia's putiodl app as a sample. https://github.com/jacktasia/putiodl

    Best regards,
    Cem

  3. aft closed this discussion on 18 Feb, 2011 08:31 AM.

Comments are currently closed for this discussion. You can start a new one.