public VideoDownloader(UrlFileCache bank, OpenuVideoData data, BackgroundWorker changesReporter) { this.cache = bank; this.data = data; durations = new ConcurrentBag <TimeSpan>(); this.changesReporter = changesReporter; }
static void Main(string[] args) { var videos = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); var directoryInfo = new DirectoryInfo(Path.Combine(videos, "openu-vid-fetcher")); UrlFileCache cache = new UrlFileCache(directoryInfo); runBrowserThread(cache); }
public OpenuVidCatchingForm(CookieContainer _jar, UrlFileCache _cache) { jar = _jar; cache = _cache; var lastView = cache.GetContent(LastViewKey, BrowserCache); if (lastView == null) { lastView = "http://openu.ac.il/sheilta"; } parser = new OpenuParser(jar, cache); InitializeComponent(); AddDynamicComponents(lastView); }
private static List <OpenuVideoData> runBrowserThread(UrlFileCache cache) { List <OpenuVideoData> toDownload = null; var th = new Thread(() => { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); OpenuVidCatchingForm simpleWebForm = new OpenuVidCatchingForm(cookieJar, cache); simpleWebForm.Show(); Application.Run(simpleWebForm); toDownload = simpleWebForm.playlist; Console.WriteLine("Done showing"); }); th.SetApartmentState(ApartmentState.STA); th.Start(); th.Join(); return(toDownload); }
public OpenuParser(CookieContainer jar, UrlFileCache cache) { this.cookieJar = jar; this.cache = cache; }