fix: fix file details
This commit is contained in:
parent
91ccd8c595
commit
fd18d89808
@ -17,7 +17,7 @@ from ..flv.helpers import is_valid_flv_file
|
|||||||
from ..flv.metadata_analysis import analyse_metadata
|
from ..flv.metadata_analysis import analyse_metadata
|
||||||
from ..flv.metadata_injection import InjectingProgress, inject_metadata
|
from ..flv.metadata_injection import InjectingProgress, inject_metadata
|
||||||
from ..logging.room_id import aio_task_with_room_id
|
from ..logging.room_id import aio_task_with_room_id
|
||||||
from ..path import extra_metadata_path
|
from ..path import danmaku_path, extra_metadata_path
|
||||||
from ..utils.mixins import AsyncCooperationMixin, AsyncStoppableMixin, SupportDebugMixin
|
from ..utils.mixins import AsyncCooperationMixin, AsyncStoppableMixin, SupportDebugMixin
|
||||||
from .ffmpeg_metadata import make_metadata_file
|
from .ffmpeg_metadata import make_metadata_file
|
||||||
from .helpers import copy_files_related, discard_dir, discard_file, get_extra_metadata
|
from .helpers import copy_files_related, discard_dir, discard_file, get_extra_metadata
|
||||||
@ -172,6 +172,9 @@ class Postprocessor(
|
|||||||
remuxing_result,
|
remuxing_result,
|
||||||
) = await self._remux_video_to_mp4(video_path)
|
) = await self._remux_video_to_mp4(video_path)
|
||||||
await copy_files_related(video_path)
|
await copy_files_related(video_path)
|
||||||
|
if result_path != video_path:
|
||||||
|
self._completed_files.append(danmaku_path(result_path))
|
||||||
|
self._completed_files.remove(danmaku_path(video_path))
|
||||||
if not self._debug:
|
if not self._debug:
|
||||||
if self._should_delete_source_files(remuxing_result):
|
if self._should_delete_source_files(remuxing_result):
|
||||||
await discard_dir(os.path.dirname(video_path))
|
await discard_dir(os.path.dirname(video_path))
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import PurePath
|
||||||
from typing import Iterator, Optional
|
from typing import Iterator, Optional
|
||||||
|
|
||||||
from blrec.bili.danmaku_client import DanmakuClient
|
from blrec.bili.danmaku_client import DanmakuClient
|
||||||
@ -133,7 +133,10 @@ class RecordTask:
|
|||||||
size = os.path.getsize(path)
|
size = os.path.getsize(path)
|
||||||
exists = True
|
exists = True
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
mp4_path = str(Path(path).with_suffix('.mp4'))
|
if path.endswith('.m3u8'):
|
||||||
|
mp4_path = str(PurePath(path).parent.with_suffix('.mp4'))
|
||||||
|
else:
|
||||||
|
mp4_path = str(PurePath(path).with_suffix('.mp4'))
|
||||||
try:
|
try:
|
||||||
size = os.path.getsize(mp4_path)
|
size = os.path.getsize(mp4_path)
|
||||||
exists = True
|
exists = True
|
||||||
@ -174,6 +177,12 @@ class RecordTask:
|
|||||||
try:
|
try:
|
||||||
size = os.path.getsize(path)
|
size = os.path.getsize(path)
|
||||||
exists = True
|
exists = True
|
||||||
|
except FileNotFoundError:
|
||||||
|
_path = str(PurePath(path).parent.with_suffix('.xml'))
|
||||||
|
try:
|
||||||
|
size = os.path.getsize(_path)
|
||||||
|
exists = True
|
||||||
|
path = _path
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
size = 0
|
size = 0
|
||||||
exists = False
|
exists = False
|
||||||
|
Loading…
Reference in New Issue
Block a user