Compare commits
2 Commits
c250e679f8
...
aade02d763
| Author | SHA1 | Date | |
|---|---|---|---|
| aade02d763 | |||
| 343bc69d6c |
@ -60,9 +60,9 @@ def download(anime: Anime): # pylint: disable=too-many-branches
|
|||||||
try:
|
try:
|
||||||
subprocess.run(command, check=True, timeout=timeout)
|
subprocess.run(command, check=True, timeout=timeout)
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
logging.error(f"Download timed out after {timeout} seconds: {' '.join(str(item) for item in command)}")
|
download_error_logger.error(f"Download timed out after {timeout} seconds: {' '.join(str(item) for item in command)}")
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
logging.error(f"Error running command: {' '.join(str(item) for item in command)}")
|
download_error_logger.error(f"Error running command: {' '.join(str(item) for item in command)}")
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
logging.warning("Download interrupted by user.")
|
logging.warning("Download interrupted by user.")
|
||||||
output_dir = os.path.dirname(output_path)
|
output_dir = os.path.dirname(output_path)
|
||||||
|
|||||||
3
main.py
3
main.py
@ -168,7 +168,7 @@ class Loader:
|
|||||||
logging.error(f"Error downloading episode {episode} of season {season} for anime {key}: {e}")
|
logging.error(f"Error downloading episode {episode} of season {season} for anime {key}: {e}")
|
||||||
|
|
||||||
# Using ThreadPoolExecutor to run downloads in parallel
|
# Using ThreadPoolExecutor to run downloads in parallel
|
||||||
with ThreadPoolExecutor(max_workers=1) as executor: # Adjust number of workers as needed
|
with ThreadPoolExecutor(max_workers=2) as executor: # Adjust number of workers as needed
|
||||||
for folder, mp4_files in result:
|
for folder, mp4_files in result:
|
||||||
try:
|
try:
|
||||||
key = self.__check_and_generate_key(folder)
|
key = self.__check_and_generate_key(folder)
|
||||||
@ -177,6 +177,7 @@ class Loader:
|
|||||||
logging.info(f"Missing episodes for {key}\nSeason {str(season)}: Episodes: " + ",".join(f"{''.join(str(v))}" for v in missing_episodes))
|
logging.info(f"Missing episodes for {key}\nSeason {str(season)}: Episodes: " + ",".join(f"{''.join(str(v))}" for v in missing_episodes))
|
||||||
for episode in missing_episodes:
|
for episode in missing_episodes:
|
||||||
executor.submit(download_episode, folder, season, episode, key)
|
executor.submit(download_episode, folder, season, episode, key)
|
||||||
|
#download_episode(folder, season, episode, key)
|
||||||
except NoKeyFoundException as nkfe:
|
except NoKeyFoundException as nkfe:
|
||||||
noKeyFound_logger.error(f"Error processing folder '{folder}': {nkfe}")
|
noKeyFound_logger.error(f"Error processing folder '{folder}': {nkfe}")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user