2021-07-10 17:47:49 +02:00
|
|
|
import os, subprocess, sys, argparse, signal
|
2021-07-09 22:10:10 +02:00
|
|
|
|
2021-07-10 16:12:12 +02:00
|
|
|
# required files
|
2021-10-31 21:14:21 +01:00
|
|
|
DN = os.path.dirname(os.path.realpath(__file__)) # get current directory of the script
|
|
|
|
GOOD_TITLES = open(DN + "/good_title.txt").readlines() # the list of good titles
|
|
|
|
PROBLEMATIC_TITLES = open(DN + "/problem_title.txt").readlines() # list of problematic titles
|
|
|
|
FZF_FILE = open(DN + "/fzf.txt", "w+") # temp file for fzf
|
|
|
|
FZF_FILE_PATH = DN +"/fzf.txt" # path of the temp file
|
|
|
|
PRINT_FZF_PATH = "python " + DN + "/print_fzf.py" # print the fzf file
|
2021-08-12 11:29:34 +02:00
|
|
|
|
2021-07-13 15:49:34 +02:00
|
|
|
# exit function
|
|
|
|
def exit_adl():
|
2021-10-31 21:14:21 +01:00
|
|
|
FZF_FILE.close()
|
|
|
|
os.remove(FZF_FILE_PATH)
|
2021-07-13 15:49:34 +02:00
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
def interupt_command(signum, frame):
|
|
|
|
exit_adl()
|
|
|
|
|
2021-10-31 21:14:21 +01:00
|
|
|
|
2021-07-13 15:49:34 +02:00
|
|
|
|
2021-07-09 22:10:10 +02:00
|
|
|
# colored print
|
|
|
|
def color_print(text):
|
|
|
|
print("\033[0;36m" + text + " \033[0m")
|
|
|
|
|
|
|
|
# colored watch primpt
|
2021-10-31 21:14:21 +01:00
|
|
|
def watch_prompt(title, episode, msg):
|
2021-07-09 22:10:10 +02:00
|
|
|
print("Now " + msg + " \033[0;34m" + title + "\033[0m, episode \033[0;34m" + str(episode) + " \033[0m")
|
|
|
|
|
|
|
|
# colored input
|
|
|
|
def color_prommpt(text):
|
|
|
|
return input("\033[0;34m" + text + "\033[0m")
|
|
|
|
|
|
|
|
# retrieve new list
|
2021-10-31 21:14:21 +01:00
|
|
|
def retrieve_list(account):
|
2021-07-09 22:10:10 +02:00
|
|
|
color_print ("Running trackma retrieve for account " + account + "...")
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call("trackma -a " + account + " retrieve")
|
|
|
|
subprocess.call("cls", shell=True)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# retrieve updated list
|
2021-10-31 21:14:21 +01:00
|
|
|
def retrieve_list_update(account):
|
2021-07-09 22:10:10 +02:00
|
|
|
color_print("Running trackma retrieve for account " + account + " to get the updated list...")
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call("trackma -a " + account + " retrieve")
|
|
|
|
subprocess.call("cls", shell=True)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# load list
|
2021-10-31 21:14:21 +01:00
|
|
|
def load_list(account):
|
2021-07-09 22:10:10 +02:00
|
|
|
alist = subprocess.getoutput("trackma -a " + account + " list").splitlines()
|
|
|
|
alist.pop(0)
|
|
|
|
alist.pop()
|
|
|
|
return alist
|
|
|
|
|
|
|
|
# write list to a file
|
|
|
|
def list2file(list, file):
|
|
|
|
for line in list:
|
|
|
|
file.write(line)
|
|
|
|
if not list.index(line) == len(list) - 1 :
|
|
|
|
file.write("\n")
|
|
|
|
|
|
|
|
# exit prompt
|
|
|
|
def exit_ask():
|
|
|
|
while True:
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call("cls", shell=True)
|
2021-07-09 22:10:10 +02:00
|
|
|
choice = color_prommpt("Want to watch another anime? [Y/n]: ")
|
2021-07-13 15:49:34 +02:00
|
|
|
if choice == "N" or choice == "n":
|
2021-07-09 22:10:10 +02:00
|
|
|
exit_adl()
|
2021-07-13 15:49:34 +02:00
|
|
|
elif choice == "Y" or choice == "y" or choice == "":
|
2021-07-09 22:10:10 +02:00
|
|
|
return
|
|
|
|
|
|
|
|
# check for problematic title
|
|
|
|
def check_title(title):
|
2021-10-31 21:14:21 +01:00
|
|
|
for problem in PROBLEMATIC_TITLES:
|
2021-07-09 22:10:10 +02:00
|
|
|
if problem.__contains__(title):
|
2021-10-31 21:14:21 +01:00
|
|
|
title = GOOD_TITLES[PROBLEMATIC_TITLES.index(problem)]
|
2021-07-09 22:10:10 +02:00
|
|
|
return title
|
|
|
|
|
|
|
|
# get your title
|
2021-07-10 16:12:12 +02:00
|
|
|
def get_title(choice):
|
2021-08-12 11:29:34 +02:00
|
|
|
choice = choice[9:96]
|
2021-07-10 16:12:12 +02:00
|
|
|
choice = choice.rstrip(".")
|
|
|
|
title = check_title(choice)
|
2021-07-09 22:10:10 +02:00
|
|
|
return title
|
|
|
|
|
|
|
|
# get episode
|
2021-07-10 16:12:12 +02:00
|
|
|
def get_episode(choice):
|
2021-08-12 11:29:34 +02:00
|
|
|
choice = choice[98:100]
|
2021-07-10 16:12:12 +02:00
|
|
|
return int(choice)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# get score
|
2021-07-10 16:12:12 +02:00
|
|
|
def get_score(choice):
|
2021-08-12 11:29:34 +02:00
|
|
|
choice = choice[108:110]
|
2021-07-10 16:12:12 +02:00
|
|
|
return choice
|
2021-07-09 22:10:10 +02:00
|
|
|
|
2021-07-10 17:47:49 +02:00
|
|
|
# watch animes
|
2021-10-31 21:14:21 +01:00
|
|
|
def watch(title, episode, download, provider, player):
|
2021-07-30 20:15:24 +02:00
|
|
|
cmd = 'anime dl "' + title + '" --episodes ' + episode
|
|
|
|
|
2021-07-13 16:33:43 +02:00
|
|
|
if not download:
|
2021-07-30 20:15:24 +02:00
|
|
|
cmd += ' --play ' + player
|
|
|
|
|
|
|
|
if not provider == "":
|
|
|
|
cmd += ' --provider ' + provider
|
|
|
|
|
|
|
|
subprocess.run(cmd)
|
2021-07-10 17:25:43 +02:00
|
|
|
|
2021-07-09 22:10:10 +02:00
|
|
|
# next episode
|
2021-10-31 21:14:21 +01:00
|
|
|
def next_episode(title,episode, msg, download, provider, player):
|
2021-07-09 22:10:10 +02:00
|
|
|
if not download:
|
|
|
|
watch_next = True
|
|
|
|
while watch_next:
|
|
|
|
episode = episode + 1
|
2021-10-31 21:14:21 +01:00
|
|
|
watch_prompt(title, str(episode), msg)
|
|
|
|
watch(title, str(episode), download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
while True:
|
|
|
|
color_print("Current watched episode: " + str(episode))
|
|
|
|
yn = color_prommpt("Wanna watch next episode? [Y/n]: ")
|
2021-07-13 15:49:34 +02:00
|
|
|
if yn == "Y" or yn == "y" or yn == "":
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
|
|
|
elif yn == "N" or yn == "n":
|
|
|
|
watch_next = False
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
episode = episode + 1
|
2021-10-31 21:14:21 +01:00
|
|
|
watch_prompt(title, str(episode), msg)
|
|
|
|
watch(title, str(episode), download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# all from last watched
|
2021-10-31 21:14:21 +01:00
|
|
|
def all_from_last(title,episode, msg, download, provider, player):
|
|
|
|
watch_prompt(title, str(episode) + " all left episodes", msg)
|
|
|
|
watch(title, str(episode + 1) + ':', download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# all episode
|
2021-10-31 21:14:21 +01:00
|
|
|
def all_episodes(title, msg, download, provider, player):
|
|
|
|
watch_prompt(title, "all", msg)
|
|
|
|
watch(title, '1:', download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# watch from custom range
|
2021-10-31 21:14:21 +01:00
|
|
|
def custom_episode_range(title, msg, download, provider, player):
|
2021-07-09 22:10:10 +02:00
|
|
|
begginig = color_prommpt("Beggining of interval?: ")
|
|
|
|
end = color_prommpt("End of interval?: ")
|
2021-10-31 21:14:21 +01:00
|
|
|
watch_prompt(title, begginig + " to " + end, msg)
|
|
|
|
watch(title, begginig + ':' + end, download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# add to last watched m
|
2021-10-31 21:14:21 +01:00
|
|
|
def next_plus_n(title, episode, action, msg, download, provider, player):
|
|
|
|
watch_prompt(title, str(episode + int(action)), msg)
|
|
|
|
watch(title, str(episode + int(action)), download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# rewatch current episode
|
2021-10-31 21:14:21 +01:00
|
|
|
def rewatch_episode(title, episode, msg, download, provider, player):
|
|
|
|
watch_prompt(title, str(episode), msg)
|
|
|
|
watch(title, str(episode), download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# watch custom episode
|
2021-10-31 21:14:21 +01:00
|
|
|
def custom_episode(title, msg, download,provider, player):
|
2021-07-09 22:10:10 +02:00
|
|
|
episode = color_prommpt("Enter custom episode: ")
|
2021-10-31 21:14:21 +01:00
|
|
|
watch_prompt(title, episode, msg)
|
|
|
|
watch(title, episode, download, provider, player)
|
2021-07-09 22:10:10 +02:00
|
|
|
|
|
|
|
# update title
|
2021-10-31 21:14:21 +01:00
|
|
|
def update_title(title, episode, account):
|
2021-07-09 22:10:10 +02:00
|
|
|
color_print("Current episode for " + title + " is " + str(episode))
|
|
|
|
custom = color_prommpt("Enter updated episode number: ")
|
|
|
|
if custom != "":
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call('trackma -a ' + account + ' update "' + title + '" ' + custom)
|
|
|
|
subprocess.call('trackma -a' + account + ' send')
|
2021-10-31 21:14:21 +01:00
|
|
|
retrieve_list_update(account)
|
2021-07-09 22:10:10 +02:00
|
|
|
else:
|
|
|
|
color_print("Skipping updating...")
|
|
|
|
|
|
|
|
# update score
|
2021-10-31 21:14:21 +01:00
|
|
|
def update_score(title, score, account):
|
2021-07-09 22:10:10 +02:00
|
|
|
color_print("Current score for " + title + " is " + score)
|
|
|
|
custom = color_prommpt("Enter updated score: ")
|
|
|
|
if custom != "":
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call('trackma -a ' + account + ' score "' + title + '" ' + custom)
|
|
|
|
subprocess.call('trackma -a' + account + ' send')
|
2021-10-31 21:14:21 +01:00
|
|
|
retrieve_list_update(account)
|
2021-07-09 22:10:10 +02:00
|
|
|
else:
|
|
|
|
color_print("Skipping updating...")
|
|
|
|
|
|
|
|
# update question
|
2021-10-31 21:14:21 +01:00
|
|
|
def update_question(title, episode, score, account):
|
2021-07-09 22:10:10 +02:00
|
|
|
while True:
|
|
|
|
color_print("Skipping watching episodes. Modifing entry.")
|
|
|
|
choice = color_prommpt("Update episode number or update score [E/s]: ")
|
2021-07-13 15:49:34 +02:00
|
|
|
if choice == "e" or choice == "E" or choice == "":
|
2021-10-31 21:14:21 +01:00
|
|
|
update_title(title, episode, account)
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
|
|
|
elif choice == "s" or choice == "S":
|
2021-10-31 21:14:21 +01:00
|
|
|
update_score(title, score, account)
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
|
|
|
|
|
|
|
# ask if you wanna continus watching
|
2021-10-31 21:14:21 +01:00
|
|
|
def wanna_continu_watch(download):
|
2021-07-09 22:10:10 +02:00
|
|
|
while True:
|
|
|
|
if not download:
|
|
|
|
yn = color_prommpt("Wanna continue watching? [Y/n]: ")
|
|
|
|
else:
|
|
|
|
yn = color_prommpt("Wanna continue downloading? [Y/n]: ")
|
2021-07-13 15:49:34 +02:00
|
|
|
if yn == "y" or yn == "Y" or yn == "":
|
2021-07-09 22:10:10 +02:00
|
|
|
return True
|
|
|
|
elif yn == "n" or yn == "N":
|
|
|
|
return False
|
|
|
|
|
|
|
|
# ask if you wanna update title meta after watch
|
2021-10-31 21:14:21 +01:00
|
|
|
def wanna_update_title_after_watch(title, episode, score, download, account):
|
2021-07-09 22:10:10 +02:00
|
|
|
if not download:
|
|
|
|
while True:
|
|
|
|
yn = color_prommpt("Wanna update episode number or update score of watched anime? [N/e/s]: ")
|
|
|
|
if yn == "E" or yn == "e":
|
2021-10-31 21:14:21 +01:00
|
|
|
update_title(title, episode, account)
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
|
|
|
elif yn == "S" or yn == "s":
|
2021-10-31 21:14:21 +01:00
|
|
|
update_score(title, score, account)
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
2021-07-13 15:49:34 +02:00
|
|
|
elif yn == "N" or yn == "n" or yn == "":
|
2021-07-09 22:10:10 +02:00
|
|
|
break
|
|
|
|
|
|
|
|
# choose what to do with episode
|
|
|
|
def choose_episode():
|
2021-07-10 15:31:34 +02:00
|
|
|
subprocess.call("cls", shell=True)
|
2021-07-09 22:10:10 +02:00
|
|
|
color_print("Enter lowercase or uppercase to issue command:")
|
|
|
|
color_print(" N - Next episode (default, press <ENTER>)")
|
|
|
|
color_print(" L - from current to Last known:")
|
|
|
|
color_print(" A - All available, from episode 1")
|
|
|
|
color_print(" I - custom Interval (range) of episodes")
|
|
|
|
color_print(" 0-9 - Plus n episodes relative to last seen (type number)")
|
|
|
|
color_print(" R - Rewatch/redownload current episode in list")
|
|
|
|
color_print(" C - Custom episode")
|
|
|
|
color_print(" U - Update entry chosen instead of streaming")
|
|
|
|
color_print(" S - Skip. Choose another show.")
|
|
|
|
return color_prommpt("Your choice? [N/l/a/i/0-9/r/c/u/s]: ")
|
|
|
|
|
2021-07-30 20:15:24 +02:00
|
|
|
def choose_episode_specific_show():
|
|
|
|
subprocess.call("cls", shell=True)
|
|
|
|
color_print("Enter lowercase or uppercase to issue command:")
|
|
|
|
color_print(" A - All available, from episode 1")
|
|
|
|
color_print(" I - custom Interval (range) of episodes")
|
|
|
|
color_print(" C - Custom episode")
|
|
|
|
color_print(" S - Skip. Exit adl.")
|
|
|
|
return color_prommpt("Your choice? [A/i/c/s]: ")
|
2021-08-28 17:04:09 +02:00
|
|
|
|
2021-10-31 21:14:21 +01:00
|
|
|
def main():
|
|
|
|
signal.signal(signal.SIGINT, interupt_command)
|
|
|
|
|
|
|
|
# setup env variables for better readability of outputs
|
|
|
|
os.environ['LINES'] = '25'
|
|
|
|
os.environ['COLUMNS'] = '120'
|
|
|
|
|
|
|
|
# argument parser
|
|
|
|
ap = argparse.ArgumentParser()
|
|
|
|
|
|
|
|
ap.add_argument("-p", "--player", required=False,
|
|
|
|
help="Define player used for streaming. Ex: \033[0;36mpyadl -p mpv\033[0m")
|
|
|
|
ap.add_argument("-i", "--provider", required=False,
|
|
|
|
help="Define provider used for streaming (check \033[0;36m$anime dl --help\033[0m for providers list)")
|
|
|
|
ap.add_argument("-s", "--show", required=False,
|
|
|
|
help='Watch custom show. Ep nr optional, careful with the quotes. Ex: \033[0;36m$adl -s "gegege 2018"\033[0m')
|
|
|
|
ap.add_argument("-n", "--number", required=False,
|
|
|
|
help='Specify episode number that will be used with "-s / --show" option. Ex: \033[0;36m$adl -s "gegege 2018" -n "4"\033[0m')
|
|
|
|
ap.add_argument("-a", "--account", required=False,
|
|
|
|
help="By default trackma will use account 1. Use '-a 2' for example to change trackma account")
|
|
|
|
ap.add_argument("-d", "--download", required=False, type=bool, nargs='?', const=True, default=False,
|
|
|
|
help="Download instead of streaming")
|
|
|
|
ap.add_argument("-v", "--version", required=False, nargs='?', const=True,
|
|
|
|
help="Display version and exit")
|
|
|
|
|
|
|
|
args = vars(ap.parse_args())
|
|
|
|
|
|
|
|
# print(args)
|
|
|
|
|
|
|
|
# get player
|
|
|
|
if args["player"]:
|
|
|
|
player = str(args["player"]) # get player from user
|
|
|
|
else:
|
|
|
|
player = "mpv" # default player
|
|
|
|
|
|
|
|
# get provider
|
|
|
|
if args['provider']:
|
|
|
|
provider = str(args["provider"])
|
|
|
|
else:
|
|
|
|
provider = ""
|
|
|
|
|
|
|
|
# get show
|
|
|
|
if args['show']:
|
|
|
|
show = str(args["show"])
|
|
|
|
else:
|
|
|
|
show = ""
|
|
|
|
|
|
|
|
# get episode
|
|
|
|
if args['number']:
|
|
|
|
if args['number'] and args['show']:
|
|
|
|
episode = int(args['number'])
|
|
|
|
else:
|
|
|
|
print("You need to also specify a show name to use this option")
|
|
|
|
sys.exit()
|
|
|
|
else:
|
|
|
|
episode = 0
|
|
|
|
|
|
|
|
# get account
|
|
|
|
if args['account']:
|
|
|
|
account = str(int(args["account"]) - 1) # take the account from input
|
|
|
|
else:
|
|
|
|
account = "0" # default account
|
|
|
|
|
|
|
|
# enable downloading
|
|
|
|
if args["download"]:
|
|
|
|
download = True # enable downloading
|
|
|
|
msg = "downloading" # download message
|
|
|
|
else:
|
|
|
|
download = False # specify whether to download or not
|
|
|
|
msg = "watching" # msg for the watch prompt
|
|
|
|
|
|
|
|
# print the version
|
|
|
|
if args["version"]:
|
|
|
|
print("Py-adl version 1.1")
|
|
|
|
sys.exit()
|
|
|
|
|
|
|
|
retrieve = True
|
|
|
|
|
|
|
|
if not show == "" and not episode == 0:
|
|
|
|
watch(show, str(episode), download, provider, player)
|
|
|
|
elif not show == "":
|
|
|
|
while True:
|
|
|
|
# choose what to do with the choosen anime
|
|
|
|
action = choose_episode_specific_show()
|
|
|
|
if action == "a" or action == "A" or action == "":
|
|
|
|
all_episodes(show, msg, download, provider, player)
|
2021-08-12 10:49:41 +02:00
|
|
|
exit_adl()
|
2021-10-31 21:14:21 +01:00
|
|
|
# custom range of episodes
|
|
|
|
elif action == "i" or action == "I":
|
|
|
|
custom_episode_range(show, msg, download, provider, player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
exit_adl()
|
|
|
|
# watch custom episode
|
|
|
|
elif action == "c" or action == "C":
|
|
|
|
custom_episode(show, msg, download, provider, player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
exit_adl()
|
|
|
|
# skip the anime
|
|
|
|
elif action == "s" or action == "S":
|
2021-08-12 10:49:41 +02:00
|
|
|
exit_adl()
|
2021-10-31 21:14:21 +01:00
|
|
|
else:
|
|
|
|
# main loop
|
|
|
|
while True:
|
|
|
|
# retrieving the list on start
|
|
|
|
if retrieve:
|
|
|
|
retrieve_list(account)
|
|
|
|
retrieve = False
|
2021-07-30 20:15:24 +02:00
|
|
|
|
2021-10-31 21:14:21 +01:00
|
|
|
# get the list of anime
|
|
|
|
alist = load_list(account)
|
|
|
|
|
|
|
|
# write list to file
|
|
|
|
list2file(alist, FZF_FILE)
|
|
|
|
|
|
|
|
# reload file (I Guess ??)
|
|
|
|
FZF_FILE.seek(0)
|
|
|
|
|
|
|
|
# get choice from fzf
|
|
|
|
choice = subprocess.getoutput(PRINT_FZF_PATH + ' | fzf --ansi --reverse --prompt "Choose anime to watch: "')
|
|
|
|
|
|
|
|
if choice:
|
|
|
|
# get the title
|
|
|
|
title = get_title(choice)
|
|
|
|
# get current episode
|
|
|
|
episode = get_episode(choice)
|
|
|
|
# get current score
|
|
|
|
score = get_score(choice)
|
|
|
|
|
|
|
|
# the watch loop
|
|
|
|
while True:
|
|
|
|
# choose what to do with the choosen anime
|
|
|
|
action = choose_episode()
|
|
|
|
# watch next episode
|
|
|
|
if action == "n" or action == "N" or action == "":
|
|
|
|
next_episode(title, episode, msg, download,provider,player)
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
2021-07-30 20:15:24 +02:00
|
|
|
exit_ask()
|
|
|
|
break
|
2021-10-31 21:14:21 +01:00
|
|
|
# watch all left episodes
|
|
|
|
elif action == "l" or action == "L":
|
|
|
|
all_from_last(title, episode, msg, download,provider,player)
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
2021-07-30 20:15:24 +02:00
|
|
|
exit_ask()
|
|
|
|
break
|
2021-10-31 21:14:21 +01:00
|
|
|
# watch every episode available
|
|
|
|
elif action == "a" or action == "A":
|
|
|
|
all_episodes(title, msg, download,provider,player)
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
2021-07-30 20:15:24 +02:00
|
|
|
exit_ask()
|
|
|
|
break
|
2021-10-31 21:14:21 +01:00
|
|
|
# custom range of episodes
|
|
|
|
elif action == "i" or action == "I":
|
|
|
|
custom_episode_range(title, msg, download,provider,player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
|
|
|
exit_ask()
|
|
|
|
break
|
|
|
|
# something?
|
|
|
|
elif action == "1" or action == "2" or action == "3" or action == "4" or action == "5" or action == "6" or action == "7" or action == "8" or action == "9":
|
|
|
|
next_plus_n(title, episode, action, msg, download,provider,player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
|
|
|
exit_ask()
|
|
|
|
break
|
|
|
|
# rewatch current episode
|
|
|
|
elif action == "r" or action == "R":
|
|
|
|
rewatch_episode(title, episode, msg, download,provider,player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
|
|
|
exit_ask()
|
|
|
|
break
|
|
|
|
# watch custom episode
|
|
|
|
elif action == "c" or action == "C":
|
|
|
|
custom_episode(title, msg, download,provider,player)
|
|
|
|
if wanna_continu_watch(download):
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
wanna_update_title_after_watch(title, episode, score, download, account)
|
|
|
|
exit_ask()
|
|
|
|
break
|
|
|
|
# update anime meta
|
|
|
|
elif action == "u" or action == "U":
|
|
|
|
update_question(title, episode, score, account)
|
2021-07-30 20:15:24 +02:00
|
|
|
exit_ask()
|
|
|
|
break
|
2021-10-31 21:14:21 +01:00
|
|
|
# skip the anime
|
|
|
|
elif action == "s" or action == "S":
|
|
|
|
break
|
|
|
|
else:
|
|
|
|
exit_ask()
|
|
|
|
|
|
|
|
exit_adl()
|
2021-08-28 17:04:09 +02:00
|
|
|
|
2021-10-31 21:14:21 +01:00
|
|
|
if __name__ == "__main__" :
|
|
|
|
main()
|