Refactor code style and improve documentation
- Standardized string quotes to single quotes across all files. - Added docstrings to several functions and classes for better clarity. - Updated mypy configuration in pyproject.toml for enhanced type checking. - Ignored specific linting rules for test files in ruff configuration. - Improved error messages in exception handling for better user feedback. - Cleaned up code formatting and structure for consistency.
This commit is contained in:
@@ -3,4 +3,4 @@ from __future__ import annotations
|
||||
from .download import DownloadedVideo
|
||||
from .session import SessionCookie, SessionValidation
|
||||
|
||||
__all__ = ["DownloadedVideo", "SessionCookie", "SessionValidation"]
|
||||
__all__ = ['DownloadedVideo', 'SessionCookie', 'SessionValidation']
|
||||
|
||||
@@ -5,6 +5,8 @@ from dataclasses import dataclass
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class DownloadedVideo:
|
||||
"""In-memory representation of a downloaded MP4 file."""
|
||||
|
||||
filename: str
|
||||
content: bytes
|
||||
media_type: str = "video/mp4"
|
||||
media_type: str = 'video/mp4'
|
||||
|
||||
@@ -5,6 +5,8 @@ from dataclasses import dataclass
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class SessionCookie:
|
||||
"""Normalized cookie parsed from a Netscape session file."""
|
||||
|
||||
domain: str
|
||||
include_subdomains: bool
|
||||
path: str
|
||||
@@ -16,6 +18,8 @@ class SessionCookie:
|
||||
|
||||
@dataclass(frozen=True, slots=True)
|
||||
class SessionValidation:
|
||||
"""Validation result for a candidate session cookie file."""
|
||||
|
||||
exists: bool
|
||||
structurally_valid: bool
|
||||
fresh: bool
|
||||
|
||||
Reference in New Issue
Block a user