1.0 Update

This commit is contained in:
CronyAkatsuki 2022-09-16 18:58:12 +02:00
parent 538fdc5b7d
commit b1ff88f03f
4 changed files with 14 additions and 41 deletions

View File

@ -1,33 +1,22 @@
# py-adl # py-adl
My python version of the popular adl wrapper for trackma and anime downloader that currently only works for windblows 10.
I created this program because I really like the idea of the original [adl](https://github.com/RaitaroH/adl) wrapper script for [anime-downloader](https://github.com/anime-dl/anime-downloader) and [trackma](https://github.com/z411/trackma), but wasn't able to use once I got over to windows and now here I'm trying to port it to python. I created this program because I really like the idea of the original [adl](https://github.com/RaitaroH/adl) wrapper script for [anime-downloader](https://github.com/anime-dl/anime-downloader) and [trackma](https://github.com/z411/trackma), but wasn't able to use once I got over to windows and now here I'm with a python port of it
This is not supposed to be one on one port so that it is easier on my sanity. ## Main differences
Current features: - The script is built to be natively used on both windows and linux.
- Choose trackma account - Instead of anime-downloader I'm using [animdl](https://github.com/justfoolingaround/animdl)
- retrieve list from trackma
- Choose what player to use from cli This is not supposped to be one on one port because some things just arent possible to be done in windows terminals (images).
- downloading
- watch next episode of an anime ## Features
- watch left episode
- watch all episodes - anime tracking using trackma
- watch custom interval - use different providers
- rewatch current episode - use multiple possible video players
- watch custom episode
- update anime meta - update anime meta
- use trackma for tracking your progress - watch/download anime
- use anime downloader for streaming and downloading
There is more I wanna do, and would love to add some screenshots. ### How to install
### How to use
To be able to use this python script you need to have python installed and have trackma and anime downloader installed. To download and install anime downloader on windows you should checkout out it's [install documentation](https://anime-downlader.readthedocs.io/en/latest/usage/installation.html#windows). To install trackma you have to simply run `pip install -U trackma`.
### How to compile
I have included an compile poweshell script that allows you to compile py-adl into a executable that you can find in the **dist** folder after running it. **But you need to have pyinstaller installed on your system**. To install it run `pip install pyinstaller`.
To run the compile.ps1 script all you have to do is open an powershell window in the directory of the script and type .\compile.ps1 **or** if you don't want to run the script you can run this command in a the powershell or cmd window `pyinstaller .\adl.py --onefile --add-data 'good_title.txt;.' --add-data '.\problem_title.txt;.' --add-data '.\print_fzf.py;.'` and that will compile it on any system.

14
adl.py
View File

@ -15,13 +15,11 @@ if sys.platform == "win32":
os.getlogin()), 'Documents', 'Adl', 'config.json') os.getlogin()), 'Documents', 'Adl', 'config.json')
DEFAULT_DOWNLOAD_LOCATION = os.path.join( DEFAULT_DOWNLOAD_LOCATION = os.path.join(
'C:\\', 'Users', str(os.getlogin()), 'Videos', 'Anime') 'C:\\', 'Users', str(os.getlogin()), 'Videos', 'Anime')
CLEAR = 'cls'
else: else:
CONFIG_FILE_PATH = os.path.join( CONFIG_FILE_PATH = os.path.join(
'/home', str(os.getlogin()), '.config', 'adl', 'config.json') '/home', str(os.getlogin()), '.config', 'adl', 'config.json')
DEFAULT_DOWNLOAD_LOCATION = os.path.join( DEFAULT_DOWNLOAD_LOCATION = os.path.join(
'/home', str(os.getlogin()), 'Videos', 'Anime') '/home', str(os.getlogin()), 'Videos', 'Anime')
CLEAR = 'clear'
PROBLEMATIC_TITLES = ['Komi-san wa, Komyushou desu ', PROBLEMATIC_TITLES = ['Komi-san wa, Komyushou desu ',
'SK∞'] 'SK∞']
@ -77,7 +75,6 @@ def color_prommpt(text):
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}...")
subprocess.run(["trackma", "-a", account, "retrieve"]) subprocess.run(["trackma", "-a", account, "retrieve"])
subprocess.run(CLEAR)
# retrieve updated list # retrieve updated list
@ -85,7 +82,6 @@ def retrieve_list_update(account):
color_print( color_print(
f"Running trackma retrieve for account {account} to get the updated list...") f"Running trackma retrieve for account {account} to get the updated list...")
subprocess.run(["trackma", "-a", account, "retrieve"]) subprocess.run(["trackma", "-a", account, "retrieve"])
subprocess.run(CLEAR)
# load list # load list
@ -101,7 +97,6 @@ def load_list(account):
# exit prompt # exit prompt
def exit_ask(): def exit_ask():
while True: while True:
subprocess.run(CLEAR)
choice = color_prommpt("Want to watch another anime? [Y/n]: ") choice = color_prommpt("Want to watch another anime? [Y/n]: ")
if choice == "N" or choice == "n": if choice == "N" or choice == "n":
exit_adl() exit_adl()
@ -292,13 +287,11 @@ def wanna_update_title_after_watch(index, title, episode, score, download, accou
# choose what to do with episode # choose what to do with episode
def choose_episode(): def choose_episode():
subprocess.run(CLEAR)
color_print(CHOOSE_EPISODE) color_print(CHOOSE_EPISODE)
return color_prommpt("Your choice? [N/l/a/i/0-9/r/c/u/s]: ") return color_prommpt("Your choice? [N/l/a/i/0-9/r/c/u/s]: ")
def choose_episode_specific_show(): def choose_episode_specific_show():
subprocess.run(CLEAR)
color_print(CHOOSE_EPISODE_SPECIFIC_SHOW) color_print(CHOOSE_EPISODE_SPECIFIC_SHOW)
return color_prommpt("Your choice? [A/i/c/s]: ") return color_prommpt("Your choice? [A/i/c/s]: ")
@ -329,8 +322,6 @@ def argument_and_config_parser():
help="Download instead of streaming") help="Download instead of streaming")
ap.add_argument("-l", "--download-location", required=False, ap.add_argument("-l", "--download-location", required=False,
help="Define downloads location, Default location is in 'User folder/Videos/Anime'") help="Define downloads location, Default location is in 'User folder/Videos/Anime'")
ap.add_argument("-t", "--test-providers", required=False, type=bool, nargs='?', const=True, default=False,
help="Check the state of possible providers")
ap.add_argument("-v", "--version", required=False, nargs='?', const=True, ap.add_argument("-v", "--version", required=False, nargs='?', const=True,
help="Display version and exit") help="Display version and exit")
@ -341,11 +332,6 @@ def argument_and_config_parser():
print(f"Py-adl version {VERSION}") print(f"Py-adl version {VERSION}")
sys.exit() sys.exit()
# check if providers are working
if args["test_providers"]:
subprocess.run(["animdl", "test"])
sys.exit()
# get provider # get provider
if args['provider']: if args['provider']:
provider = str(args["provider"]) provider = str(args["provider"])

View File

@ -1 +0,0 @@
pyinstaller .\adl.py --onefile --add-data 'good_title.txt;.' --add-data '.\problem_title.txt;.' --add-data '.\print_fzf.py;.'

View File

@ -18,7 +18,6 @@ setup(
}, },
keywords=['trackma', 'animld', 'anime', 'adl', 'linux', 'windows'], keywords=['trackma', 'animld', 'anime', 'adl', 'linux', 'windows'],
classifiers=[ classifiers=[
'Development Status :: 4 - Beta',
'License :: GPL-3.0 License', 'License :: GPL-3.0 License',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Operating System :: POSIX :: Linux :: Windows' 'Operating System :: POSIX :: Linux :: Windows'