🛠️ Fixed ffmpeg output file to str. Fixed segment parsing for videos while downloading segments. Lowered time delay span.
This commit is contained in:
@@ -208,7 +208,7 @@ class Download:
|
|||||||
result: bool = False
|
result: bool = False
|
||||||
path_segment: pathlib.Path = path_base / url_to_filename(url)
|
path_segment: pathlib.Path = path_base / url_to_filename(url)
|
||||||
# Calculate the segment ID based on the file name within the URL.
|
# Calculate the segment ID based on the file name within the URL.
|
||||||
id_segment: int = int(path_segment.stem)
|
id_segment: int = int(str(path_segment.stem).split("_")[-1])
|
||||||
error: HTTPError | None = None
|
error: HTTPError | None = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -386,7 +386,7 @@ class Download:
|
|||||||
# Whether a file was downloaded or skipped and the download delay is enabled, wait until the next download.
|
# Whether a file was downloaded or skipped and the download delay is enabled, wait until the next download.
|
||||||
# Only use this, if you have a list of several Track items.
|
# Only use this, if you have a list of several Track items.
|
||||||
if download_delay and not skip_file:
|
if download_delay and not skip_file:
|
||||||
time_sleep: float = round(random.SystemRandom().uniform(2, 5), 1)
|
time_sleep: float = round(random.SystemRandom().uniform(1.5, 4), 1)
|
||||||
|
|
||||||
self.fn_logger.debug(f"Next download will start in {time_sleep} seconds.")
|
self.fn_logger.debug(f"Next download will start in {time_sleep} seconds.")
|
||||||
time.sleep(time_sleep)
|
time.sleep(time_sleep)
|
||||||
@@ -608,7 +608,7 @@ class Download:
|
|||||||
path_file_out: pathlib.Path = path_file.with_suffix(AudioExtensions.MP4)
|
path_file_out: pathlib.Path = path_file.with_suffix(AudioExtensions.MP4)
|
||||||
result, _ = (
|
result, _ = (
|
||||||
ffmpeg.input(path_file)
|
ffmpeg.input(path_file)
|
||||||
.output(path_file_out, map=0, c="copy", loglevel="quiet")
|
.output(str(path_file_out), map=0, c="copy", loglevel="quiet")
|
||||||
.run(cmd=self.settings.data.path_binary_ffmpeg)
|
.run(cmd=self.settings.data.path_binary_ffmpeg)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -619,7 +619,12 @@ class Download:
|
|||||||
result, _ = (
|
result, _ = (
|
||||||
ffmpeg.input(path_media_src)
|
ffmpeg.input(path_media_src)
|
||||||
.output(
|
.output(
|
||||||
path_media_out, map=0, movflags="use_metadata_tags", acodec="copy", map_metadata="0:g", loglevel="quiet"
|
str(path_media_out),
|
||||||
|
map=0,
|
||||||
|
movflags="use_metadata_tags",
|
||||||
|
acodec="copy",
|
||||||
|
map_metadata="0:g",
|
||||||
|
loglevel="quiet",
|
||||||
)
|
)
|
||||||
.run(cmd=self.settings.data.path_binary_ffmpeg)
|
.run(cmd=self.settings.data.path_binary_ffmpeg)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user