diff options
Diffstat (limited to 'blenderkit')
-rw-r--r-- | blenderkit/download.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/blenderkit/download.py b/blenderkit/download.py index c6d22749..296a7639 100644 --- a/blenderkit/download.py +++ b/blenderkit/download.py @@ -741,17 +741,16 @@ def get_download_url(asset_data, scene_id, api_key, tcom=None): data = { 'scene_uuid': scene_id } - r = None try: r = rerequests.get(asset_data['download_url'], params=data, headers=headers) except Exception as e: print(e) if tcom is not None: tcom.error = True - if r == None: - tcom.report = 'Connection Error' - tcom.error = True + if tcom is not None: + tcom.report = 'Connection Error' + tcom.error = True return 'Connection Error' if r.status_code < 400: @@ -763,14 +762,17 @@ def get_download_url(asset_data, scene_id, api_key, tcom=None): if r.status_code == 403: r = 'You need Full plan to get this item.' - tcom.report = r r1 = 'All materials and brushes are available for free. Only users registered to Standard plan can use all models.' tasks_queue.add_task((ui.add_report, (r1, 5, colors.RED))) - tcom.error = True + if tcom is not None: + tcom.report = r + tcom.error = True elif r.status_code >= 500: - tcom.report = 'Server error' - tcom.error = True + utils.p(r.text) + if tcom is not None: + tcom.report = 'Server error' + tcom.error = True return False |