Ejemplo n.º 1
0
        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));
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 private DefaultExtractorWrapper(ExtractorBase extractorInstance)
     : base(extractorInstance)
 { }
Ejemplo n.º 6
0
 private ArticleExtractorWrapper(ExtractorBase extractorInstance)
     : base(extractorInstance)
 { }
Ejemplo n.º 7
0
 protected ExtractorBaseWrapper(ExtractorBase extractor)
 {
     Extractor = extractor;
 }