Fix stuff

This commit is contained in:
sepro 2024-11-22 23:22:14 +01:00
parent d14a82dfc6
commit 8ed7a5343c
3 changed files with 4 additions and 4 deletions

View File

@ -125,7 +125,7 @@ def format_seconds(seconds):
time = timetuple_from_msec(seconds * 1000)
if time.hours > 99:
return '--:--:--'
return '{:02d}:{:02d}:{:02d}'.format(*time[:-1])
return '{:02d}:{:02d}:{:02d}'.format(*map(int, time[:-1]))
@classmethod
def format_eta(cls, seconds):

View File

@ -2230,7 +2230,7 @@ def build_stream_name():
# format_id intact.
if not live:
stream_name = build_stream_name()
format_id[1] = stream_name or f'{tbr or len(formats)}'
format_id[1] = stream_name or f'{int(tbr) or len(formats)}'
f = {
'format_id': join_nonempty(*format_id),
'format_index': idx,

View File

@ -3380,12 +3380,12 @@ def parse_dfxp_time_expr(time_expr):
def srt_subtitles_timecode(seconds):
return '{:02d}:{:02d}:{:02d},{:03d}'.format(*timetuple_from_msec(seconds * 1000))
return '{:02d}:{:02d}:{:02d},{:03d}'.format(*map(int, timetuple_from_msec(seconds * 1000)))
def ass_subtitles_timecode(seconds):
time = timetuple_from_msec(seconds * 1000)
return '{:01d}:{:02d}:{:02d}.{:02d}'.format(*time[:-1], int(time.milliseconds / 10))
return '{:01d}:{:02d}:{:02d}.{:02d}'.format(*map(int, time[:-1]), int(time.milliseconds / 10))
def dfxp2srt(dfxp_data):