refactor(downloader): 🔧 reorganize TrackStreamInfo class and imports
* Moved `TrackStreamInfo` class definition from `download.py` to `downloader.py`. * Removed redundant `dataclass` import from `download.py`. * Updated import statements to maintain clarity and organization.
This commit is contained in:
+1
-12
@@ -16,7 +16,6 @@ import tempfile
|
|||||||
import time
|
import time
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
from dataclasses import dataclass
|
|
||||||
from threading import Event
|
from threading import Event
|
||||||
from uuid import uuid4
|
from uuid import uuid4
|
||||||
|
|
||||||
@@ -72,20 +71,10 @@ from tidal_dl_ng.helper.tidal import (
|
|||||||
name_builder_title,
|
name_builder_title,
|
||||||
)
|
)
|
||||||
from tidal_dl_ng.metadata import Metadata
|
from tidal_dl_ng.metadata import Metadata
|
||||||
from tidal_dl_ng.model.downloader import DownloadSegmentResult
|
from tidal_dl_ng.model.downloader import DownloadSegmentResult, TrackStreamInfo
|
||||||
from tidal_dl_ng.model.gui_data import ProgressBars
|
from tidal_dl_ng.model.gui_data import ProgressBars
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
|
||||||
class TrackStreamInfo:
|
|
||||||
"""Container for track stream information."""
|
|
||||||
|
|
||||||
stream_manifest: StreamManifest | None
|
|
||||||
file_extension: str
|
|
||||||
requires_flac_extraction: bool
|
|
||||||
media_stream: Stream | None
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Set appropriate client string and use it for video download.
|
# TODO: Set appropriate client string and use it for video download.
|
||||||
# https://github.com/globocom/m3u8#using-different-http-clients
|
# https://github.com/globocom/m3u8#using-different-http-clients
|
||||||
class RequestsClient:
|
class RequestsClient:
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import pathlib
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from requests import HTTPError
|
from requests import HTTPError
|
||||||
|
from tidalapi.media import Stream, StreamManifest
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@dataclass
|
||||||
@@ -11,3 +12,13 @@ class DownloadSegmentResult:
|
|||||||
path_segment: pathlib.Path
|
path_segment: pathlib.Path
|
||||||
id_segment: int
|
id_segment: int
|
||||||
error: HTTPError | None = None
|
error: HTTPError | None = None
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class TrackStreamInfo:
|
||||||
|
"""Container for track stream information."""
|
||||||
|
|
||||||
|
stream_manifest: StreamManifest | None
|
||||||
|
file_extension: str
|
||||||
|
requires_flac_extraction: bool
|
||||||
|
media_stream: Stream | None
|
||||||
|
|||||||
Reference in New Issue
Block a user