Skip to content

Commit

Permalink
Added new exception and sorted imports and exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
henrique-coder committed Dec 12, 2024
1 parent 9603e76 commit d7afdb0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
12 changes: 11 additions & 1 deletion streamsnapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@

# Local imports
from .downloader import Downloader
from .exceptions import DownloadError, EmptyDataError, InvalidDataError, MergeError, RequestError, ScrapingError, StreamBaseError
from .exceptions import (
DownloadError,
EmptyDataError,
FFmpegNotFoundError,
InvalidDataError,
MergeError,
RequestError,
ScrapingError,
StreamBaseError,
)
from .merger import Merger
from .platforms.youtube import YouTube, YouTubeExtractor

Expand All @@ -12,6 +21,7 @@
'Downloader',
'DownloadError',
'EmptyDataError',
'FFmpegNotFoundError',
'InvalidDataError',
'MergeError',
'RequestError',
Expand Down
22 changes: 14 additions & 8 deletions streamsnapper/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,32 @@ class StreamBaseError(Exception):
pass


class DownloadError(StreamBaseError):
"""Exception raised when an error occurs while downloading a file."""

pass


class EmptyDataError(StreamBaseError):
"""Exception raised when no data is available."""

pass


class InvalidDataError(StreamBaseError):
"""Exception raised when invalid data is provided."""
class FFmpegNotFoundError(StreamBaseError):
"""Exception raised when the FFmpeg executable is not found."""

pass


class ScrapingError(StreamBaseError):
"""Exception raised when an error occurs while scraping data."""
class InvalidDataError(StreamBaseError):
"""Exception raised when invalid data is provided."""

pass


class DownloadError(StreamBaseError):
"""Exception raised when an error occurs while downloading a file."""
class MergeError(StreamBaseError):
"""Exception raised when an error occurs while merging files."""

pass

Expand All @@ -34,7 +40,7 @@ class RequestError(StreamBaseError):
pass


class MergeError(StreamBaseError):
"""Exception raised when an error occurs while merging files."""
class ScrapingError(StreamBaseError):
"""Exception raised when an error occurs while scraping data."""

pass

0 comments on commit d7afdb0

Please sign in to comment.