return hours * 3600 + minutes * 60 + seconds

def _js_parseInt(string):
    return int(''.join([x for x in string if x.isdigit()]))
YTDurationToSeconds('PT15M33S')
How to convert YouTube API duration to seconds?