Skip to content

Commit ac48b9a

Browse files
committed
refactor: update file path parse
1 parent f07998e commit ac48b9a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Author: Hmily
55
GitHub: https://github.com/ihmily
66
Date: 2023-07-17 23:52:05
7-
Update: 2024-10-04 20:40:00
7+
Update: 2024-10-05 00:57:00
88
Copyright (c) 2023-2024 by Hmily, All Rights Reserved.
99
Function: Record live stream video.
1010
"""
@@ -167,7 +167,7 @@ def converts_mp4(address: str, is_original_delete: bool = True):
167167
"ffmpeg", "-i", address,
168168
"-c:v", "copy",
169169
"-c:a", "copy",
170-
"-f", "mp4", address.split('.')[0] + ".mp4",
170+
"-f", "mp4", address.rsplit('.', maxsplit=1)[0] + ".mp4",
171171
], stderr=subprocess.STDOUT)
172172
if is_original_delete:
173173
time.sleep(1)
@@ -180,7 +180,7 @@ def converts_m4a(address: str, is_original_delete: bool = True):
180180
"ffmpeg", "-i", address,
181181
"-n", "-vn",
182182
"-c:a", "aac", "-bsf:a", "aac_adtstoasc", "-ab", "320k",
183-
address.split('.')[0] + ".m4a",
183+
address.rsplit('.', maxsplit=1)[0] + ".m4a",
184184
], stderr=subprocess.STDOUT)
185185
if is_original_delete:
186186
time.sleep(1)

0 commit comments

Comments
 (0)