Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Everend bulk download aborts on unavailable books #105

Closed
iuliiakr opened this issue May 10, 2024 · 1 comment
Closed

Everend bulk download aborts on unavailable books #105

iuliiakr opened this issue May 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@iuliiakr
Copy link

Installation method:
Github repo

Version:
Python 3.11.8
audiobook-dl 0.7.3

Describe the bug

I am using audiobook-dl for bulk download from Everend. There are thousands of items on my list, but some of the books are not available for my region. So the audiobook-dl aborts download every time when

  1. an exception is raised (in my case the most often is DataNotPresent)
  2. I answer "no" for the question if an existing folder should be re-written.
    It slows the scraping significantly, while amount of those unavailable books is insignificant compared to the number of available books. So we can skip them, no problem. But I guess an -ignore-errors (or -skip-unavailable) flag is not implemented yet.

Suggestion
It would be nice to have a kind of skip-unavailable flag.

Meanwhile, I changed my local version of audiobookdl/main.py

def main() -> None:
    # Parsing arguments
    options = args.parse_arguments()
    config = load_config(options.config_location)
    options.output_template = options.output_template or config.output_template
    # Applying arguments as global constants
    logging.debug_mode = options.debug
    logging.quiet_mode = options.quiet
    logging.ffmpeg_output = options.ffmpeg_output or options.debug
    logging.debug(f"audiobook-dl {__version__}", remove_styling=True)
    logging.debug(f"python {sys.version}", remove_styling=True)
    urls = args.get_urls(options)
    if not urls:
        logging.simple_help()
        exit()

#    try:
#        for url in urls:
#            process_url(url, options, config)
#    except AudiobookDLException as e:
#        e.print()
#        if logging.debug_mode:
#            logging.print_traceback()
#        exit(1)

# Here is the part that I changed
    for url in urls:
        try:
            process_url(url, options, config)
        except AudiobookDLException as e:
            e.print()
            if logging.debug_mode:
                logging.print_traceback()
# End of changed part

Maybe, you can suggest a better solution to this issue. Would be great to see what you think about it.

Another option was to filter out unavailable books on the stage of collecting book links. But somehow I haven't figured this out yet on Everend.

@iuliiakr iuliiakr added the bug Something isn't working label May 10, 2024
@jo1gi
Copy link
Owner

jo1gi commented May 10, 2024

I think it is a great suggestion and have added it in bbc2e53.

@jo1gi jo1gi closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants