Skip to content

Reference for youtube_dl_scraper/core/exceptions.py

youtube_dl_scraper.core.exceptions.YouTubeDLScraperError

Bases: Exception

Base class for all exceptions





youtube_dl_scraper.core.exceptions.ScraperNotFoundError

ScraperNotFoundError(scraper_type, scraper_name)

Bases: YouTubeDLScraperError

Raised when a requested scraper is not found.

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, scraper_type, scraper_name):
    message = f"No {scraper_type} scraper found with name '{scraper_name}'."
    super().__init__(message)





youtube_dl_scraper.core.exceptions.ScraperExecutionError

ScraperExecutionError(scraper_name, details='An error occurred during scraping.')

Bases: YouTubeDLScraperError

Raised when a scraper fails during execution.

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, scraper_name, details="An error occurred during scraping."):
    message = f"Error in scraper '{scraper_name}': {details}"
    super().__init__(message)





youtube_dl_scraper.core.exceptions.VideoNotFoundError

VideoNotFoundError(scraper_name, details='An error occurred during scraping.')

Bases: ScraperExecutionError

Raised when no captions were found

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, scraper_name, details="An error occurred during scraping."):
    message = f"Error in scraper '{scraper_name}': {details}"
    super().__init__(message)





youtube_dl_scraper.core.exceptions.CaptionsNotFoundError

CaptionsNotFoundError(scraper_name, details='An error occurred during scraping.')

Bases: ScraperExecutionError

Raised when no captions were found

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, scraper_name, details="An error occurred during scraping."):
    message = f"Error in scraper '{scraper_name}': {details}"
    super().__init__(message)





youtube_dl_scraper.core.exceptions.UnsupportedScraperMethodError

UnsupportedScraperMethodError(scraper_name, method_name)

Bases: YouTubeDLScraperError

Raised when a scraper does not support the requested method.

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, scraper_name, method_name):
    message = (
        f"Scraper '{scraper_name}' does not support the method '{method_name}'."
    )
    super().__init__(message)





youtube_dl_scraper.core.exceptions.FileExistsError

FileExistsError(file_exist, path)

Bases: YouTubeDLScraperError

Reaised when a file exists

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(self, file_exist, path):
    message = f"{file_exist} in {path}"
    super().__init__(message)





youtube_dl_scraper.core.exceptions.PlaywrightError

PlaywrightError(message, status_code=200, successfull_process=False, error='', output='')

Bases: YouTubeDLScraperError

Raised when Playwright payload execution fails

Source code in youtube_dl_scraper/core/exceptions.py
def __init__(
    self, message, status_code=200, successfull_process=False, error="", output=""
):
    self.message = f"Reason: {message} Status code: {status_code}"
    self.status_code = status_code
    self.successfull_process = successfull_process
    self.error = error or message
    self.output = output

    super().__init__(self.message)