diff --git a/src/trackers/MTV.py b/src/trackers/MTV.py index 4aa0ceac4..46f43a994 100644 --- a/src/trackers/MTV.py +++ b/src/trackers/MTV.py @@ -51,17 +51,15 @@ async def upload_with_retry(self, meta, cookiefile, common, img_host_index=1): # Call handle_image_upload and pass the updated meta with the current image host index image_list, retry_mode = await self.handle_image_upload(meta, img_host_index, approved_image_hosts) - # If retry_mode is True, switch to the next host - if retry_mode: - console.print(f"[yellow]Switching to the next image host. Current index: {img_host_index}") - img_host_index += 1 - continue - - # If we successfully uploaded images, break out of the loop - if image_list is not None: + # If we successfully uploaded images or are already using an approved host, break out of the loop + if not retry_mode: break - if image_list is None: + # If retry_mode is True, switch to the next host + console.print(f"[yellow]Switching to the next image host. Current index: {img_host_index}") + img_host_index += 1 + + if not image_list: console.print("[red]All image hosts failed. Please check your configuration.") return