@@ -74,11 +74,16 @@ def getUserDownloads(type: DownloadType):
7474 try :
7575 response = api_http_client .get (f"/{ type .value } /mylist" , params = params )
7676 except Exception as e :
77- logging .error (f"Error fetching { type .value } : { e } " )
78- return None , False , f"Error fetching { type .value } : { e } "
77+ logging .error (f"Error fetching { type .value } at offset { offset } : { e } " )
78+ return None , False , f"Error fetching { type .value } at offset { offset } : { e } "
7979 if response .status_code != 200 :
80- return None , False , f"Error fetching { type .value } . { response .status_code } "
81- data = response .json ().get ("data" , [])
80+ return None , False , f"Error fetching { type .value } at offset { offset } . { response .status_code } "
81+ try :
82+ data = response .json ().get ("data" , [])
83+ except Exception as e :
84+ logging .error (f"Error parsing { type .value } at offset { offset } : { e } " )
85+ logging .error (f"Response: { response .text } " )
86+ return None , False , f"Error parsing { type .value } at offset { offset } . { e } "
8287 if not data :
8388 break
8489 file_data .extend (data )
@@ -146,7 +151,7 @@ def searchMetadata(query: str, title_data: dict, file_name: str, full_title: str
146151 logging .error (f"Error searching metadata: { e } " )
147152 return base_metadata , False , f"Error searching metadata: { e } "
148153 if response .status_code != 200 :
149- logging .error (f"Error searching metadata: { response .status_code } " )
154+ logging .error (f"Error searching metadata: { response .status_code } . { response . text } " )
150155 return base_metadata , False , f"Error searching metadata. { response .status_code } "
151156 try :
152157 data = response .json ().get ("data" , [])[0 ]
0 commit comments