def repeat(output_m3u, video, times):
    """
    repeat OUT.M3U VIDEO N-TIMES: create playlist consisting of video repeated
    """
    buf = ''
    for i in range(0, int(times)):
        buf += '#EXTINF:0,{}\n'.format(video)
        buf += '{}\n'.format(video)
    with open(output_m3u, 'w') as f:
        f.write('#EXTM3U\n')
        f.write(buf)
