Skip to content

Commit

Permalink
Fix encoding torrent content to base64/utf-8
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Jan 3, 2019
1 parent ab8f5a9 commit a17eb92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aria2p/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def add_torrent(self, torrent_file_path, uris=None, options=None, position=None)
else:
client_options = options

with open(torrent_file_path) as stream:
with open(torrent_file_path, "rb") as stream:
torrent_contents = stream.read()
encoded_contents = b64encode(torrent_contents)
encoded_contents = b64encode(torrent_contents).decode("utf8")

gid = self.client.add_torrent(encoded_contents, uris, client_options, position)

Expand Down

0 comments on commit a17eb92

Please sign in to comment.