22import sys
33import logging
44import requests
5+ import urllib .parse
56import hashlib
67import datetime
78import gzip
@@ -250,8 +251,9 @@ def get_auth_ids(self):
250251
251252 def delete_file (self , file : SyncFile ):
252253 self .logger .info (f"Deleting { file .relative_path } " )
254+ fpath = urllib .parse .quote (file .relative_path )
253255 response = self .session .delete (
254- f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ file . relative_path } " ,
256+ f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ fpath } " ,
255257 )
256258
257259 def upload_file (self , file : SyncFile ):
@@ -264,8 +266,9 @@ def upload_file(self, file: SyncFile):
264266 "Content-Encoding" : "gzip" ,
265267 }
266268
269+ fpath = urllib .parse .quote (file .relative_path )
267270 response = self .session .put (
268- f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ file . relative_path } " ,
271+ f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ fpath } " ,
269272 data = compressed_data ,
270273 headers = headers ,
271274 )
@@ -278,8 +281,9 @@ def upload_file(self, file: SyncFile):
278281
279282 def download_file (self , file : SyncFile , retries = 3 ):
280283 try :
284+ fpath = urllib .parse .quote (file .relative_path )
281285 response = self .session .get (
282- f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ file . relative_path } " ,
286+ f"{ constants .GOG_CLOUDSTORAGE } /v1/{ self .credentials ['user_id' ]} /{ self .client_id } /{ self .cloud_save_dir_name } /{ fpath } " ,
283287 stream = True ,
284288 )
285289 except :
0 commit comments