예제 #1
0
 public VideoDownloader(UrlFileCache bank, OpenuVideoData data, BackgroundWorker changesReporter)
 {
     this.cache           = bank;
     this.data            = data;
     durations            = new ConcurrentBag <TimeSpan>();
     this.changesReporter = changesReporter;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
 public OpenuParser(CookieContainer jar, UrlFileCache cache)
 {
     this.cookieJar = jar;
     this.cache     = cache;
 }