def time_to_seconds(duration):
    """
    时间字符串转换成秒
    :param duration: 时间格式串, 例如"01:46:00"
    :return seconds: int
    """
    hours, minutes, seconds = duration.split(':')
    seconds = int(seconds)
    if minutes > '00':
        seconds += int(minutes) * 60
    if hours > '00':
        seconds += int(hours) * 3600
    return seconds