FlickrAPI<Element 'rsp' at 0x2f25830> Error: 99: Insufficient permissions. Method requires delete privileges; write granted.
から実行しようとすると、エラーが発生し続けます。groups_leave()
私は を使用して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.
>>>