def GetDuration(clip): if '.mp4' in str(clip): return VideoFileClip(clip).duration elif '.mp3' in str(clip): return eyed3.load('{}'.format(clip)).info.time_secs