#!/usr/bin/env python3

import subprocess
import shlex

items = [
    [
        'http://brown.hosted.panopto.com/Panopto/Podcast/Podcast.ashx?' +
        'courseid=3eb112cc-5718-4786-81e2-ad99012e7169&type=mp4', '1760'
    ],
    [
        'https://brown.hosted.panopto.com/Panopto/Podcast/Podcast.ashx?' +
        'courseid=e12055b6-d870-4201-89d6-ad9c00ecfd72&type=mp4', '1951X'
    ],
    [
        'https://brown.hosted.panopto.com/Panopto/Podcast/Podcast.ashx?' +
        'courseid=a67c921b-eb8e-4579-b90e-ad9400e4257f&type=mp4', '1010'
    ],
]

for url, name in items:
    subprocess.Popen([
        'bash', '-c',
        'download_feed_daemon {0} --path ~/lectures/{1} &> ~/.download_log_{1}.txt'
        .format(shlex.quote(url), name)
    ],
                     close_fds=True)
