mod errors; mod feed; mod fetch; mod history; pub mod prelude; mod subscriptions; use prelude::*; pub fn run(subscriptions: &str, history: &str, site: &str) -> Result<()> { for channel_name in subscriptions::lines_from(subscriptions)? { let channel_name = channel_name?; println!("Channel: {}", channel_name); let feed_url = feed::get_feed_url(site, &channel_name)?; for entry in feed::get_feed(feed_url)?.entries() { if let Some(link) = entry.links().get(0).cloned() { if !history::is_already_downloaded(&link, history)? { println!("Downloading {}: {}", &channel_name, entry.title().as_str()); fetch::download_audio(&link)?; history::mark_as_downloaded(&link, history)?; } } } } Ok(()) }