diff --git a/Pipfile b/Pipfile index d8fc199..9a64d88 100644 --- a/Pipfile +++ b/Pipfile @@ -10,3 +10,4 @@ anime-downloader = {editable = true, path = ".", extras = ["cloudflare"]} twine = "*" sphinx = "*" sphinx-rtd-theme = "*" +radon = "*" diff --git a/Pipfile.lock b/Pipfile.lock index 5b57b0c..4b319ea 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "b39a35608ce09e57197e0564221771979dcb36be0f7866a5c73298da5a98b4d5" + "sha256": "f182f386e6ad648cfa47633b4e6b6e48511e18e06eb0f602c6d0b2c449e57ca7" }, "pipfile-spec": 6, "requires": {}, @@ -56,6 +56,13 @@ ], "version": "==7.0" }, + "coloredlogs": { + "hashes": [ + "sha256:34fad2e342d5a559c31b6c889e8d14f97cb62c47d9a2ae7b5ed14ea10a79eff8", + "sha256:b869a2dda3fa88154b9dd850e27828d8755bfab5a838a1c97fbc850c6e377c36" + ], + "version": "==10.0" + }, "fuzzywuzzy": { "hashes": [ "sha256:5ac7c0b3f4658d2743aa17da53a55598144edbc5bee3c6863840636e6926f254", @@ -63,6 +70,13 @@ ], "version": "==0.17.0" }, + "humanfriendly": { + "hashes": [ + "sha256:23057b10ad6f782e7bc3a20e3cb6768ab919f619bbdc0dd75691121bbde5591d", + "sha256:33ee8ceb63f1db61cce8b5c800c531e1a61023ac5488ccde2ba574a85be00a85" + ], + "version": "==4.18" + }, "idna": { "hashes": [ "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", @@ -77,6 +91,13 @@ ], "version": "==2.21.0" }, + "requests-cache": { + "hashes": [ + "sha256:e9270030becc739b0a7f7f834234c73a878b2d794122bf76f40055a22419eb67", + "sha256:fe561ca119879bbcfb51f03a35e35b425e18f338248e59fd5cf2166c77f457a2" + ], + "version": "==0.4.13" + }, "soupsieve": { "hashes": [ "sha256:afa56bf14907bb09403e5d15fbed6275caa4174d36b975226e3b67a3bb6e2c4b", @@ -128,6 +149,13 @@ ], "version": "==3.0.4" }, + "colorama": { + "hashes": [ + "sha256:05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", + "sha256:f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48" + ], + "version": "==0.4.1" + }, "docutils": { "hashes": [ "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", @@ -136,6 +164,27 @@ ], "version": "==0.14" }, + "entrypoints": { + "hashes": [ + "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", + "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451" + ], + "version": "==0.3" + }, + "flake8": { + "hashes": [ + "sha256:859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", + "sha256:a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8" + ], + "version": "==3.7.7" + }, + "flake8-polyfill": { + "hashes": [ + "sha256:12be6a34ee3ab795b19ca73505e7b55826d5f6ad7230d31b18e106400169b9e9", + "sha256:e44b087597f6da52ec6393a709e7108b2905317d0c0b744cdca6208e670d8eda" + ], + "version": "==1.0.2" + }, "idna": { "hashes": [ "sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", @@ -157,6 +206,13 @@ ], "version": "==2.10" }, + "mando": { + "hashes": [ + "sha256:4ce09faec7e5192ffc3c57830e26acba0fd6cd11e1ee81af0d4df0657463bd1c", + "sha256:79feb19dc0f097daa64a1243db578e7674909b75f88ac2220f1c065c10a0d960" + ], + "version": "==0.6.4" + }, "markupsafe": { "hashes": [ "sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", @@ -190,6 +246,13 @@ ], "version": "==1.1.1" }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" + ], + "version": "==0.6.1" + }, "packaging": { "hashes": [ "sha256:0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", @@ -204,6 +267,20 @@ ], "version": "==1.5.0.1" }, + "pycodestyle": { + "hashes": [ + "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", + "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c" + ], + "version": "==2.5.0" + }, + "pyflakes": { + "hashes": [ + "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", + "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2" + ], + "version": "==2.1.1" + }, "pygments": { "hashes": [ "sha256:5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a", @@ -225,6 +302,14 @@ ], "version": "==2018.9" }, + "radon": { + "hashes": [ + "sha256:6d8f40b02141bb94c6b87cc4fdb6ca1f8ff6ab4128f4f0b155d4bab08736ca40", + "sha256:ecb54053f8c2ead7226c5c7d06134305c44af410ddcf79689c796e4f8af6d428" + ], + "index": "pypi", + "version": "==3.0.1" + }, "readme-renderer": { "hashes": [ "sha256:bb16f55b259f27f75f640acf5e00cf897845a8b3e4731b5c1a436e4b8529202f", diff --git a/anime_downloader/cli.py b/anime_downloader/cli.py index 12bb132..784b993 100644 --- a/anime_downloader/cli.py +++ b/anime_downloader/cli.py @@ -52,3 +52,4 @@ def main(): raise click.echo(click.style('ERROR:', fg='black', bg='red') + ' '+click.style(str(e), fg='red')) + os.exit(1) diff --git a/anime_downloader/commands/dl.py b/anime_downloader/commands/dl.py index e8a07b6..6131aaf 100644 --- a/anime_downloader/commands/dl.py +++ b/anime_downloader/commands/dl.py @@ -91,6 +91,10 @@ def command(ctx, anime_url, episode_range, url, player, skip_download, quality, animes = util.parse_ep_str(anime, episode_range) + # TODO: + # Two types of plugins: + # - Aime plugin: Pass the whole anime + # - Ep plugin: Pass each episode if url or player: skip_download = True diff --git a/anime_downloader/commands/watch.py b/anime_downloader/commands/watch.py index 341e4d5..d0384fb 100644 --- a/anime_downloader/commands/watch.py +++ b/anime_downloader/commands/watch.py @@ -13,7 +13,7 @@ logger = logging.Logger(__name__) echo = click.echo -@cli.command() +@click.command() @click.argument('anime_name', required=False) @click.option( '--new', '-n', type=bool, is_flag=True, @@ -25,8 +25,7 @@ echo = click.echo '--remove', '-r', 'remove', type=bool, is_flag=True, help="Remove the specified anime") @click.option( - '--update-all', '-u', 'update_all', type=bool, is_flag=True, - help="Update the episodes of all anime in your list" + '--update-all', '-u', 'update_all', type=bool, is_flag=True, help="Update the episodes of all anime in your list" ) @click.option( '--quality', '-q', type=click.Choice(['360p', '480p', '720p', '1080p']), diff --git a/anime_downloader/util.py b/anime_downloader/util.py index 900783e..7ba7ca7 100644 --- a/anime_downloader/util.py +++ b/anime_downloader/util.py @@ -18,6 +18,20 @@ from anime_downloader.const import desktop_headers logger = logging.getLogger(__name__) +__all__ = [ + 'check_in_path', + 'setup_logger', + 'format_search_results', + 'search', + 'split_anime', + 'parse_episode_range', + 'parse_ep_str', + 'print_episodeurl', + 'download_episode', + 'play_episode', + 'print_info', +] + def check_in_path(app): """ @@ -72,7 +86,7 @@ def search(query, provider): except IndexError: logger.error('Only maximum of {} search results are allowed.' ' Please input a number less than {}'.format( - len(search_results), len(search_results)+1)) + len(search_results), len(search_results)+1)) sys.exit(1) logger.info('Selected {}'.format(title))