Я пытаюсь использовать модуль python-wordpress-xmlrpc для редактирования заголовка моего сообщения.Но ошибка в последней строке.Не знаю использование «EditPost».Может кто-нибудь объяснить с примером?
#find allpost 'movie'
allpost = client.call(posts.GetPosts({'post_type':'movie'}))
#find post title 'Bumblebee' n change 'Bumblebee 2018'
for post in allpost:
if post.title =='Bumblebee':
post.title = 'Bumblebee 2018'
client.call(posts.EditPost(post.id, post))
Ошибка:
Traceback (most recent call last):
File "D:\Movie Website\remote upload\post.py", line 28, in <module>
wp.call(EditPost(post.id,post))
File "C:\Python27\lib\site-packages\wordpress_xmlrpc\base.py", line 37,
in call
raw_result = server_method(*args)
File "C:\Python27\lib\xmlrpclib.py", line 1243, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1602, in __request
verbose=self.__verbose
File "C:\Python27\lib\xmlrpclib.py", line 1283, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python27\lib\xmlrpclib.py", line 1316, in single_request
return self.parse_response(response)
File "C:\Python27\lib\xmlrpclib.py", line 1493, in parse_response
return u.close()
File "C:\Python27\lib\xmlrpclib.py", line 800, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 404: 'Invalid attachment ID.'>