Fixing #508 in dl

master
Blatzar 2020-09-13 10:08:09 +02:00 committed by GitHub
parent 2f403d4b2e
commit b4d281a527
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -6,7 +6,7 @@ import requests_cache
from anime_downloader import session, util from anime_downloader import session, util
from anime_downloader.__version__ import __version__ from anime_downloader.__version__ import __version__
from anime_downloader.sites import get_anime_class, ALL_ANIME_SITES from anime_downloader.sites import get_anime_class, ALL_ANIME_SITES, exceptions
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -47,7 +47,7 @@ sitenames = [v[1] for v in ALL_ANIME_SITES]
metavar='FORMAT STRING' metavar='FORMAT STRING'
) )
@click.option( @click.option(
'-p','--provider', '-p', '--provider',
help='The anime provider (website) for search.', help='The anime provider (website) for search.',
type=click.Choice(sitenames) type=click.Choice(sitenames)
) )
@ -69,13 +69,13 @@ sitenames = [v[1] for v in ALL_ANIME_SITES]
help='Disable verifying the SSL certificate, if flag is set' help='Disable verifying the SSL certificate, if flag is set'
) )
@click.option( @click.option(
'--choice', '-c',type=int, '--choice', '-c', type=int,
help='Choice to start downloading given anime number ' help='Choice to start downloading given anime number '
) )
@click.option("--skip-fillers", is_flag=True, help="Skip downloading of fillers.") @click.option("--skip-fillers", is_flag=True, help="Skip downloading of fillers.")
@click.option( @click.option(
"--speed-limit", "--speed-limit",
type=str, type=str,
help="Set the speed limit (in KB/s or MB/s) for downloading when using aria2c", help="Set the speed limit (in KB/s or MB/s) for downloading when using aria2c",
metavar='<int>K/M' metavar='<int>K/M'
) )
@ -103,6 +103,9 @@ def command(ctx, anime_url, episode_range, url, player, skip_download, quality,
logger.info('Found anime: {}'.format(anime.title)) logger.info('Found anime: {}'.format(anime.title))
animes = util.parse_ep_str(anime, episode_range) animes = util.parse_ep_str(anime, episode_range)
if not animes:
# Issue #508.
raise exceptions.NotFoundError('No episodes found within index.')
# TODO: # TODO:
# Two types of plugins: # Two types of plugins:
@ -122,7 +125,7 @@ def command(ctx, anime_url, episode_range, url, player, skip_download, quality,
if episode.ep_no in fillers: if episode.ep_no in fillers:
logger.info("Skipping episode {} because it is a filler.".format(episode.ep_no)) logger.info("Skipping episode {} because it is a filler.".format(episode.ep_no))
continue continue
if url: if url:
util.print_episodeurl(episode) util.print_episodeurl(episode)