2021-12-09 Fred Gleason <fredg@paravelsystems.com>

* Added a 'PostImage()' method to the 'rivwebpyapi' API.

Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
Fred Gleason
2021-12-09 16:02:13 -05:00
parent 6409a778a1
commit 1287cce718
4 changed files with 105 additions and 0 deletions

View File

@@ -1730,6 +1730,35 @@ class rivwebpyapi(object):
return handler.output()[0]
def PostImage(self,image_id):
"""
Upload a podcast image to the remote archive.
Takes the following argument:
image_id - ID of the image (integer).
"""
if(image_id<0):
raise ValueError('invalid image ID')
#
# Build the WebAPI arguments
#
postdata={
'COMMAND': '44',
'LOGIN_NAME': self.__connection_username,
'PASSWORD': self.__connection_password,
'ID': str(image_id)
}
#
# Fetch the audio data
#
r=requests.post(self.__connection_url,data=postdata)
if(r.status_code!=requests.codes.ok):
self.__throwError(response=r)
def PostPodcast(self,cast_id):
"""
Upload podcast audio from the Rivendell audio store to the