public static List <FileInfo> Extract(FileInfo file, DirectoryInfo outputDirectory)
        {
            if (!file.Exists)
            {
                throw new FileNotFoundException("Mod pack not found", file.FullName);
            }

            ExtractorBase extractor = GetExtractor(file.Extension);

            return(extractor.Extract(file, outputDirectory));
        }
示例#2
0
        public void BeginExecution()
        {
            if (extBase != null)
            {
                goto SKIP;
            }
            else
            {
                switch (ao.term.SiteFromString())
                {
                case Site.HAnime:
                    extBase = GenerateExtractorFromSite(Site.HAnime);
                    if (!ao.d)
                    {
                        updater(taskIndex, $"{ao.term.SkipCharSequence("https://hanime.tv/videos/hentai/".ToCharArray())} {extBase.GetDownloadUri(ao.term)}");
                        return;
                    }
                    break;

                case Site.TwistMoe:
                    extBase = GenerateExtractorFromSite(Site.TwistMoe);
                    break;

                case Site.Vidstreaming:
                    extBase = GenerateExtractorFromSite(Site.Vidstreaming);
                    break;

                default:
                    if (ao.hS)
                    {
                        extBase = GenerateExtractorFromSite(Site.HAnime);
                    }
                    else if (ao.gS)
                    {
                        extBase = GenerateExtractorFromSite(Site.Vidstreaming);
                    }
                    else if (ao.tS)
                    {
                        extBase = GenerateExtractorFromSite(Site.TwistMoe);
                    }
                    break;
                }
            }
            SKIP :;

            videoDownloadThread = new Thread(() => extBase.Begin());
            videoDownloadThread.Start();
            videoDownloadThread.Join(); // wait;
        }
示例#3
0
        public void BeginExecution()
        {
            if (extBase != null)
            {
                goto SKIP;
            }
            else
            {
                extBase = ao.term.SiteFromString().GenerateExtractor(ao, taskIndex, updater);
            }
            SKIP :;

            videoDownloadThread = new Thread(() => extBase.Begin());
            videoDownloadThread.Start();
            videoDownloadThread.Join(); // wait;
        }
        private static object GetValue <T>(List <DataElement> detailData, FieldConfiguration fieldConfiguration, ExtractorBase <T> extractor)
        {
            object retVal;

            // The scope type memo is special in that text can be spread over multiple fields in 4000 char chunks. Thus we use the simple GetValue method
            // that stiches the data together in one field.
            if (detailData.First().ElementType == DataElementElementType.memo)
            {
                retVal = extractor.GetValue(detailData, fieldConfiguration.ElementId);
            }
            else
            {
                retVal = fieldConfiguration.IsRepeatable
                    ? (object)extractor.GetListValues(detailData, fieldConfiguration.ElementId)
                    : extractor.GetValue(detailData, fieldConfiguration.ElementId);
            }

            if (fieldConfiguration.IsDefaultField && retVal is List <string> )
            {
                retVal = string.Join(Environment.NewLine, (List <string>)retVal);
            }

            return(retVal);
        }
示例#5
0
 private DefaultExtractorWrapper(ExtractorBase extractorInstance)
     : base(extractorInstance)
 { }
示例#6
0
 private ArticleExtractorWrapper(ExtractorBase extractorInstance)
     : base(extractorInstance)
 { }
示例#7
0
 protected ExtractorBaseWrapper(ExtractorBase extractor)
 {
     Extractor = extractor;
 }