I'm back again after getting the XML API working with Python2. I need Python3's urllib3 to read gzipped RSS feeds and then collect podcast episodes and upload them to my Centova server.
So far so good, I can collect the episodes and get them staged, tagged and ready. What's failing is any attempt to talk to the Centova server via the api.
Here's what I have:
import urllib3
def addToPlaylist(playlist,fileToAdd):
# add the file to the scheduled show
additem = '<?xml version="1.0" encoding="UTF-8"?>\
<centovacast>\
<request class="server" method="playlist">\
<action>add</action>\
<playlistname>%s</playlistname>\
<trackpath>%s</trackpath>\
<password>my_password</password>\
<username>my_username</username>\
</request>\
</centovacast>' % (playlist,fileToAdd)
URL = '
http://mystation.com:2199/api.php?'
pageEngineForAdding = urllib3.PoolManager()
response = pageEngineForAdding.request('GET',URL,)
result = str(response.data,encoding='utf-8')
--------
What I'm sending as a URL is:
http://mystation.com:2199/api.php?<?xml version="1.0" encoding="UTF-8"?> <centovacast> <request class="server" method="playlist"> <action>add</action> <playlistname>The Two Gay Geeks 3 pm Tue</playlistname> <trackpath>thetwogaygeeks_prerecorded/TG-Geeks-Webcast-Episode-201.mp3</trackpath> <password>my_password</password> <username>my_username</username> </request> </centovacast>
And what I get back as an error code when this runs is:
<?xml version="1.0" encoding="UTF-8"?><centovacast version="3.2.10" host="mystation.com:2199"><response type="error"><message>XML root tag not found.</message></response></centovacast>
Anybody have any ideas on what might be happening on this, and what I might do to fix this?