python-qBittorrent
python-qBittorrent copied to clipboard
url encoding
Hi
I modified the client to add a new method for renaming torrents.
def set_name(self, infohash, name): headers = {'content-type': 'application/x-www-form-urlencoded'} return self._post('api/v2/torrents/rename', data={'hash': infohash.lower(),'name': name}, headers=headers)
However, I seem unable to avoid having all spaces ( ) be turned into plus signs (+).
The qBittorrent Web API documentation includes the example
hash=8c212779b4abde7c6bc608063a0d008b7e40ce32&name=This%20is%20a%20test
But using %20 does not decode to space ( ), but it includes the text '%20' in the name of the torrent.
This is my first time modifying an already existing library, so I do not know whether I'm explaining this correctly. Please forgive if not.