Added a check for problematic titles, with txt files and fixed typos

This commit is contained in:
CronyAkatsuki 2021-07-03 16:04:48 +02:00
parent d94ab5b7b1
commit 5446fe32d6
3 changed files with 19 additions and 5 deletions

14
adl.py
View File

@ -7,7 +7,9 @@ account = "0" # trackma account
retrieve = True # retrieve new list retrieve = True # retrieve new list
player = "mpv" # specific player player = "mpv" # specific player
download = False # specify whether to download or not download = False # specify whether to download or not
msg = "watching" msg = "watching" # msg for the watch prompt
good_title = open("good_title.txt").readlines() # the list of good titles
problematic_titles = open("problem_title.txt").readlines() # list of problematic titles
ap = argparse.ArgumentParser() ap = argparse.ArgumentParser()
@ -85,11 +87,19 @@ def exit_ask():
elif choice == "Y" or choice == "y": elif choice == "Y" or choice == "y":
return return
# check for problematic title
def check_title(title):
for problem in problematic_titles:
if problem.__contains__(title):
title = good_title[problematic_titles.index(problem)]
return title
# get your title # get your title
def get_title(full_choice): def get_title(full_choice):
full_choice = full_choice[9:55] full_choice = full_choice[9:55]
full_choice = full_choice.rstrip(".") full_choice = full_choice.rstrip(".")
return full_choice title = check_title(full_choice)
return title
# get episode # get episode
def get_episode(full_choice): def get_episode(full_choice):

2
good_title.txt Normal file
View File

@ -0,0 +1,2 @@
That Time I Got Reincarnated as a Slime Season 2
Komi-san wa, Komyushou desu.

2
problem_title.txt Normal file
View File

@ -0,0 +1,2 @@
That Time I Got Reincarnated as a Slime Season
Komi-san wa, Komyushou desu