Initial commit: Add webtoon downloader
This commit is contained in:
18
helper/missing_episode.py
Normal file
18
helper/missing_episode.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from pathlib import Path
|
||||
|
||||
def get_missing_episodes(path: Path):
|
||||
for first_level_path in path.iterdir():
|
||||
if first_level_path.is_dir():
|
||||
episodes = []
|
||||
missing_episodes = []
|
||||
for second_level_path in first_level_path.iterdir():
|
||||
if second_level_path.is_dir():
|
||||
episodes.append(second_level_path.name.split('.')[0])
|
||||
sorted_episodes = sorted(episodes, key=int)
|
||||
max_index = int(sorted_episodes[-1])
|
||||
for i in range(0, max_index):
|
||||
if str(i) not in episodes:
|
||||
missing_episodes.append(i)
|
||||
if len(missing_episodes) > 0:
|
||||
print(first_level_path.name)
|
||||
print(missing_episodes)
|
||||
Reference in New Issue
Block a user