Monday, 15 September 2014

python - flickrAPI groups_leave() gives error -



python - flickrAPI groups_leave() gives error -

i maintain getting <element 'rsp' @ 0x2f25830> error: 99: insufficient permissions. method requires delete privileges; write granted. error when seek run groups_leave() flickrapi.

i utilize people_getgroups() , runs champ, used same code, changing people_getgroups() groups_leave() , bends on & moons me. :(

## python 2.73 ## ## patterned after http://stackoverflow.com/questions/3182269/retrieving-flickr-favorites ## import fileinput import time import flickrapi start = time.time() g = 0 api_key = 'thisisnotreallyit' api_secret = "ifitoldyou,i'dhavetokillyou" flickr = flickrapi.flickrapi(api_key, api_secret) unsidfile = '\flickrapi\test\grpleave.ttxt' infile = open(unsidfile) outfile = open('c:\flickrapi\test\leftgrp.ttxt', mode='w') # grouping = '1569978@n25 ' grouping in infile: grouping = grouping [:-1] # gets rid of{cr}{lf} g += 1 if '@n' in group: try: grp = flickr.groups_leave(group_id = group) ferr = '' tup = 'left grouping {0}\n'.format(grp) outfile.write(tup.encode('utf-8')) except flickrapi.flickrerror ferr: tup = str(grp) + '\t' + str(ferr) + '\n' outfile.write(tup.encode('utf-8')) print('left group: {0} \t {1}'.format (grp, str(ferr))) grouping = '' else: pass print('{0} groups \n'.format (g)) print(" processing time: {1}:{0}".format ( int(( time.time()-start) % 60), int((time.time()-start)/60))) infile.close() outfile.close()

i tried running console & gives me:

>>> grouping = '1389232@n25' >>> grp = flickr.groups_leave(group_id = group) traceback (most recent phone call last): file "<console>", line 1, in <module> ## file "c:\python27\lib\site-packages\flickrapi\flickrapi\__init__.py", line 349, in handler parse_format=args['format'], **args) file "c:\python27\lib\site-packages\flickrapi\flickrapi\__init__.py", line 435, in __wrap_in_parser homecoming parser(self, data) file "c:\python27\lib\site-packages\flickrapi\flickrapi\__init__.py", line 278, in parse_etree raise flickrerror(u'error: %(code)s: %(msg)s' % err.attrib) flickrerror: error: 99: insufficient permissions. method requires delete privileges; write granted. >>>

ok, 1 time more have 'blonde moment!'

at services website http://www.flickr.com/services/api/flickr.groups.leave.html states: note: method requires http post request.

i haven't yet learned how format those, day, eh?

python python-2.7 flickr-api

No comments:

Post a Comment