Updated something random
This commit is contained in:
parent
3a2e380add
commit
b04b02f1e0
24
adl.py
24
adl.py
@ -29,7 +29,6 @@ GOOD_TITLES = ['Komi-san wa, Komyushou desu.',
|
|||||||
'SK∞']
|
'SK∞']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# exit function
|
# exit function
|
||||||
def exit_adl():
|
def exit_adl():
|
||||||
sys.exit()
|
sys.exit()
|
||||||
@ -39,26 +38,22 @@ def interupt_command(signum, frame):
|
|||||||
exit_adl()
|
exit_adl()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# colored print
|
# colored print
|
||||||
def color_print(text):
|
def color_print(text):
|
||||||
print(f"\033[0;36m{text } \033[0m")
|
print(f"\033[0;36m{text } \033[0m")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# colored watch primpt
|
# colored watch primpt
|
||||||
def watch_prompt(title, episode, msg):
|
def watch_prompt(title, episode, msg):
|
||||||
print(
|
print(
|
||||||
f"Now {msg} \033[0;34m{title}\033[0m, episode \033[0;34m{str(episode)} \033[0m")
|
f"Now {msg} \033[0;34m{title}\033[0m, episode \033[0;34m{str(episode)} \033[0m")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# colored input
|
# colored input
|
||||||
def color_prommpt(text):
|
def color_prommpt(text):
|
||||||
return input(f"\033[0;34m{text}\033[0m")
|
return input(f"\033[0;34m{text}\033[0m")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# retrieve new list
|
# retrieve new list
|
||||||
def retrieve_list(account):
|
def retrieve_list(account):
|
||||||
color_print(f"Running trackma retrieve for account {account}...")
|
color_print(f"Running trackma retrieve for account {account}...")
|
||||||
@ -66,7 +61,6 @@ def retrieve_list(account):
|
|||||||
subprocess.run(CLEAR)
|
subprocess.run(CLEAR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# retrieve updated list
|
# retrieve updated list
|
||||||
def retrieve_list_update(account):
|
def retrieve_list_update(account):
|
||||||
color_print(
|
color_print(
|
||||||
@ -75,7 +69,6 @@ def retrieve_list_update(account):
|
|||||||
subprocess.run(CLEAR)
|
subprocess.run(CLEAR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# load list
|
# load list
|
||||||
def load_list(account):
|
def load_list(account):
|
||||||
alist = subprocess.run(["trackma", "-a", account, "list"],
|
alist = subprocess.run(["trackma", "-a", account, "list"],
|
||||||
@ -86,7 +79,6 @@ def load_list(account):
|
|||||||
return alist
|
return alist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# exit prompt
|
# exit prompt
|
||||||
def exit_ask():
|
def exit_ask():
|
||||||
while True:
|
while True:
|
||||||
@ -98,7 +90,6 @@ def exit_ask():
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# check for problematic title
|
# check for problematic title
|
||||||
def check_title(title):
|
def check_title(title):
|
||||||
if title in PROBLEMATIC_TITLES:
|
if title in PROBLEMATIC_TITLES:
|
||||||
@ -108,7 +99,6 @@ def check_title(title):
|
|||||||
return title
|
return title
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# get chosen anime info
|
# get chosen anime info
|
||||||
def get_info(choice):
|
def get_info(choice):
|
||||||
# get index
|
# get index
|
||||||
@ -131,7 +121,6 @@ def get_info(choice):
|
|||||||
return index, title, episode, score
|
return index, title, episode, score
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# watch animes
|
# watch animes
|
||||||
def watch(title, episode, download, provider, download_location):
|
def watch(title, episode, download, provider, download_location):
|
||||||
cmd = ['animdl']
|
cmd = ['animdl']
|
||||||
@ -156,7 +145,6 @@ def watch(title, episode, download, provider, download_location):
|
|||||||
os.chdir(CURRENT_DIR)
|
os.chdir(CURRENT_DIR)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# next episode
|
# next episode
|
||||||
def next_episode(title, episode, msg, download, provider, download_location):
|
def next_episode(title, episode, msg, download, provider, download_location):
|
||||||
if not download:
|
if not download:
|
||||||
@ -179,21 +167,18 @@ def next_episode(title, episode, msg, download, provider, download_location):
|
|||||||
watch(title, str(episode), download, provider, download_location)
|
watch(title, str(episode), download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# all from last watched
|
# all from last watched
|
||||||
def all_from_last(title, episode, msg, download, provider, download_location):
|
def all_from_last(title, episode, msg, download, provider, download_location):
|
||||||
watch_prompt(title, f"{str(episode)} all left episodes", msg)
|
watch_prompt(title, f"{str(episode)} all left episodes", msg)
|
||||||
watch(title, f'{str(episode + 1)}:', download, provider, download_location)
|
watch(title, f'{str(episode + 1)}:', download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# all episode
|
# all episode
|
||||||
def all_episodes(title, msg, download, provider, download_location):
|
def all_episodes(title, msg, download, provider, download_location):
|
||||||
watch_prompt(title, "all", msg)
|
watch_prompt(title, "all", msg)
|
||||||
watch(title, '1:', download, provider, download_location)
|
watch(title, '1:', download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# watch from custom range
|
# watch from custom range
|
||||||
def custom_episode_range(title, msg, download, provider, download_location):
|
def custom_episode_range(title, msg, download, provider, download_location):
|
||||||
begginig = color_prommpt("Beggining of interval?: ")
|
begginig = color_prommpt("Beggining of interval?: ")
|
||||||
@ -202,7 +187,6 @@ def custom_episode_range(title, msg, download, provider, download_location):
|
|||||||
watch(title, f"{begginig}:{end}", download, provider, download_location)
|
watch(title, f"{begginig}:{end}", download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# add to last watched m
|
# add to last watched m
|
||||||
def next_plus_n(title, episode, action, msg, download, provider, download_location):
|
def next_plus_n(title, episode, action, msg, download, provider, download_location):
|
||||||
watch_prompt(title, str(episode + int(action)), msg)
|
watch_prompt(title, str(episode + int(action)), msg)
|
||||||
@ -210,14 +194,12 @@ def next_plus_n(title, episode, action, msg, download, provider, download_locati
|
|||||||
download, provider, download_location)
|
download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# rewatch current episode
|
# rewatch current episode
|
||||||
def rewatch_episode(title, episode, msg, download, provider, download_location):
|
def rewatch_episode(title, episode, msg, download, provider, download_location):
|
||||||
watch_prompt(title, str(episode), msg)
|
watch_prompt(title, str(episode), msg)
|
||||||
watch(title, str(episode), download, provider, download_location)
|
watch(title, str(episode), download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# watch custom episode
|
# watch custom episode
|
||||||
def custom_episode(title, msg, download, provider, download_location):
|
def custom_episode(title, msg, download, provider, download_location):
|
||||||
episode = color_prommpt("Enter custom episode: ")
|
episode = color_prommpt("Enter custom episode: ")
|
||||||
@ -225,7 +207,6 @@ def custom_episode(title, msg, download, provider, download_location):
|
|||||||
watch(title, episode, download, provider, download_location)
|
watch(title, episode, download, provider, download_location)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# update title
|
# update title
|
||||||
def update_title(index, title, episode, account):
|
def update_title(index, title, episode, account):
|
||||||
color_print(f"Current episode for {title} is {str(episode)}")
|
color_print(f"Current episode for {title} is {str(episode)}")
|
||||||
@ -239,7 +220,6 @@ def update_title(index, title, episode, account):
|
|||||||
color_print("Skipping updating...")
|
color_print("Skipping updating...")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# update score
|
# update score
|
||||||
def update_score(index, title, score, account):
|
def update_score(index, title, score, account):
|
||||||
color_print(f"Current score for {title} is {score}")
|
color_print(f"Current score for {title} is {score}")
|
||||||
@ -252,7 +232,6 @@ def update_score(index, title, score, account):
|
|||||||
color_print("Skipping updating...")
|
color_print("Skipping updating...")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# update question
|
# update question
|
||||||
def update_question(index, title, episode, score, account):
|
def update_question(index, title, episode, score, account):
|
||||||
while True:
|
while True:
|
||||||
@ -266,7 +245,6 @@ def update_question(index, title, episode, score, account):
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ask if you wanna continus watching
|
# ask if you wanna continus watching
|
||||||
def wanna_continu_watch(download):
|
def wanna_continu_watch(download):
|
||||||
while True:
|
while True:
|
||||||
@ -280,7 +258,6 @@ def wanna_continu_watch(download):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ask if you wanna update title meta after watch
|
# ask if you wanna update title meta after watch
|
||||||
def wanna_update_title_after_watch(index, title, episode, score, download, account):
|
def wanna_update_title_after_watch(index, title, episode, score, download, account):
|
||||||
if not download:
|
if not download:
|
||||||
@ -297,7 +274,6 @@ def wanna_update_title_after_watch(index, title, episode, score, download, accou
|
|||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# choose what to do with episode
|
# choose what to do with episode
|
||||||
def choose_episode():
|
def choose_episode():
|
||||||
subprocess.run(CLEAR)
|
subprocess.run(CLEAR)
|
||||||
|
Loading…
Reference in New Issue
Block a user