public BaseAnimeDownloader GetDownloaderForSite(Uri episodeListUri, DownloaderConfig config = null)
        {
            if (config == null)
            {
                config = new DownloaderConfig();
            }

            if (!Directory.Exists(config.DownloadDirectory))
            {
                Directory.CreateDirectory(config.DownloadDirectory);
            }

            if (episodeListUri.AbsoluteUri.Contains("wbijam"))
            {
                return(new WbijamAnimeDownloader(episodeListUri, config));
            }
            else if (episodeListUri.AbsoluteUri.Contains("https://ogladajanime.pl/"))
            {
                return(new OgladajAnimeDownloader(episodeListUri, config));
            }
            else if (episodeListUri.AbsoluteUri.Contains("https://shinden.pl/"))
            {
                return(new ShindenDownloader(episodeListUri, config));
            }
            else
            {
                return(null);
            }
        }
        private void CheckEpisodesButton_OnClick(object sender, RoutedEventArgs e)
        {
            LoadingBar.Visibility = Visibility.Visible;
            var episodeUrl = EpisodeUrlTextBox.Text;

            if (!Uri.TryCreate(episodeUrl, UriKind.Absolute, out var uri))
            {
                MessageBox.Show("Episode link is invalid.", "Error", MessageBoxButton.OK);
                return;
            }

            var downloadDirectory = DownloadDirectoryTextBox.Text;

            if (string.IsNullOrWhiteSpace(downloadDirectory))
            {
                MessageBox.Show("Download directory is invalid.", "Error", MessageBoxButton.OK);
                return;
            }

            var tempData = new TempData {
                LatestDownloadPath = DownloadDirectoryTextBox.Text,
                LatestDownloadUri  = EpisodeUrlTextBox.Text
            };

            TempDataSaver.Save(tempData);

            var factory          = new DownloaderFactory();
            var downloaderConfig = new DownloaderConfig {
                ShouldDownloadFillers = DownloadFillersCheckbox.IsChecked.Value,
                Checkpoint            = new JsonCheckpoint(),
                DownloadDirectory     = downloadDirectory,
            };
            var downloader = factory.GetDownloaderForSite(uri, downloaderConfig);

            if (downloader == null)
            {
                MessageBox.Show($"Site:\n {uri} not supported yet.", "Site not supported", MessageBoxButton.OK,
                                MessageBoxImage.Error);
                return;
            }
            LoadingBar.Visibility = Visibility.Collapsed;
            this.Content          = new DownloadUserControl(downloader);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            if (args.Length == 6)
            {
                bool license = false;
                if (args[0] == "license")
                {
                    license = true;
                }

                try
                {
                    var config           = new Config(args[1], args[2], int.Parse(args[3]), null, args[4], args[5], true, null);
                    var client           = new Client(config);
                    var downloaderConfig = new DownloaderConfig(client, client.GetFilename(), "srt", false, false, false, license, true, "NOGRP", false, false, false, false, false, null, null);
                    var downloader       = new Downloader.Downloader(downloaderConfig);
                    downloader.Run();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e.Message);

#if (DEBUG == true)
                    Console.WriteLine(e.ToString());
#endif
                }
            }
            else
            {
                Console.WriteLine("Usage: amazondl <mode> <asin> <region> <resolution> <bitrate> <codec>\n" +
                                  "Regions: us, uk, jp, de, pv, pv-eu, pv-fe\n" +
                                  "Bitrates: CBR, VBR\n" +
                                  "Codecs: H264, H265\n" +
                                  "Modes: download, license");
            }

            Console.WriteLine("Press CTRL+C to exit . . .");
        }
 public FileDownloader GetFileDownloader(DownloadSpecification downloadSpecification, DownloaderConfig config = null)
 {
     return(new FileDownloader(downloadSpecification, this, config));
 }
 public FileDownloader GetFileDownloader(Item itemToDownload, DownloaderConfig config = null)
 {
     return(new FileDownloader(itemToDownload, this, config));
 }