<Element 'rsp' at 0x2f25830> Error: 99: Insufficient permissions. Method requires delete privileges; write granted.
当我尝试groups_leave()
从 FlickrAPI运行时,我不断收到错误消息。
我使用people_getGroups()
它,它像冠军一样运行,所以我使用相同的代码,更改people_getGroups()
为groups_leave()
它只是弯腰和月亮我。:(
## 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')
# group = '1569978@N25 '
for group in InFile:
group = group [:-1] # gets rid of{CR}{LF}
g += 1
if '@N' in group:
try:
Grp = flickr.groups_leave(group_id = group)
fErr = ''
tup = 'Left Group {0}\n'.format(Grp)
OutFile.write(tup.encode('utf-8'))
except flickrapi.FlickrError as fErr:
tup = str(Grp) + '\t' + str(fErr) + '\n'
OutFile.write(tup.encode('utf-8'))
print('Left group: {0} \t {1}'.format (Grp, str(fErr)))
group = ''
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()
我尝试从控制台运行它,它给了我:
>>> group = '1389232@N25'
>>> Grp = flickr.groups_leave(group_id = group)
Traceback (most recent 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
return 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.
>>>