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

View file

@ -2230,7 +2230,7 @@ def build_stream_name():
# format_id intact. # format_id intact.
if not live: if not live:
stream_name = build_stream_name() 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 = { f = {
'format_id': join_nonempty(*format_id), 'format_id': join_nonempty(*format_id),
'format_index': idx, 'format_index': idx,

View file

@ -3380,12 +3380,12 @@ def parse_dfxp_time_expr(time_expr):
def srt_subtitles_timecode(seconds): 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): def ass_subtitles_timecode(seconds):
time = timetuple_from_msec(seconds * 1000) 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): def dfxp2srt(dfxp_data):