torah_dl
ContentExtractionError
Bases: ExtractionError
Raised when required content cannot be extracted from the page.
Source code in src/torah_dl/core/exceptions.py
19 20 21 22 |
|
DownloadError
Bases: TorahDLError
Raised when there are issues during the download process.
Source code in src/torah_dl/core/exceptions.py
43 44 45 46 |
|
DownloadURLError
Bases: ContentExtractionError
Raised when the download URL cannot be found or extracted.
Source code in src/torah_dl/core/exceptions.py
25 26 27 28 |
|
Extraction
Bases: BaseModel
Represents the extracted data from a source.
Source code in src/torah_dl/core/models.py
8 9 10 11 12 13 14 |
|
ExtractionError
Bases: TorahDLError
Base class for all extraction-related errors.
Source code in src/torah_dl/core/exceptions.py
7 8 9 10 |
|
ExtractorNotFoundError
Bases: ExtractionError
Raised when no extractor is found for a given URL.
Source code in src/torah_dl/core/exceptions.py
37 38 39 40 |
|
NetworkError
Bases: ExtractionError
Raised when there are network-related issues during content extraction.
Source code in src/torah_dl/core/exceptions.py
13 14 15 16 |
|
TitleExtractionError
Bases: ContentExtractionError
Raised when the title cannot be found or decoded.
Source code in src/torah_dl/core/exceptions.py
31 32 33 34 |
|
TorahDLError
Bases: Exception
Base exception class for all torah-dl errors.
Source code in src/torah_dl/core/exceptions.py
1 2 3 4 |
|
can_handle
can_handle(url: str) -> bool
Checks if a given URL can be handled by any extractor.
Source code in src/torah_dl/core/extract.py
28 29 30 |
|
download
download(url: str, output_path: Path, timeout: int = 30)
Download a file from a given URL and save it to the specified output path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
The URL to download from |
required |
output_path
|
Path
|
The path to save the downloaded file to |
required |
timeout
|
int
|
The timeout for the request |
30
|
Source code in src/torah_dl/core/download.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
|
extract
extract(url: str) -> Extraction
Extracts the download URL, title, and file format from a given URL.
Source code in src/torah_dl/core/extract.py
19 20 21 22 23 24 25 |
|
list_extractors
list_extractors() -> dict[str, str]
List all available extractors.
Source code in src/torah_dl/core/list.py
4 5 6 |
|