Пример #1
0
 public virtual void argumentList(argumentList args, int lvalue, int rvalue)
 {
     foreach (argument x in args)
     {
         x.expr = expression(x.expr, lvalue, rvalue);
     }
 }
Пример #2
0
        public MangaBase(argumentList args, int taskIndex, Action <int, string> act)
        {
            if (taskIndex > -1 && act != null || taskIndex == -1 && act == null)
            {
                this.taskIndex    = taskIndex;
                this.updateStatus = act;
            }
            else
            {
                throw new Exception("Invalid statusUpdate args");
            }

            ADLUpdates.CallLogUpdate("Creating Manga Download Instance");
            this.url  = new Uri(args.term);
            webClient = new WebClient();
            GenerateHeaders();

            if (args.d && args.term.IsValidUri())
            {
                string html = webClient.DownloadString(url);
                LoadPage(html);
                html = null;
            }
            this.args = args;
            ADLUpdates.CallLogUpdate("Generating ADL Archive");
            archive = new ArchiveManager()
            {
                args = args
            };
        }
Пример #3
0
        private void NovelDownload(argumentList args, int ti, Action <int, string> u)
        {
            if (args.s)
            {
                throw new Exception("Novel Downloader does not support searching at this time.");
            }
            if (args.cc)
            {
                throw new Exception("Novel Downloader does not support continuos downloads at this time.");
            }

            IAppBase appbase;
            SiteBase bas;

            if (args.term.IsValidUri())
            {
                appbase = args.term.SiteFromString().GenerateExtractor(args, ti, u);
            }
            else
            {
                ArchiveManager am = new ArchiveManager();
                am.InitReadOnlyStream(args.term);
                string[] b;
                using (StreamReader sr = new StreamReader(am.zapive.GetEntry("main.adl").Open()))
                    b = sr.ReadToEnd().Split("\n");
                bas = MetaData.GetMeta(b).url.SiteFromString();
                am.CloseStream();
                GC.Collect();
                appbase = bas.GenerateExtractor(args, ti, u);
            }
            //Novels.DownloaderBase dbase = args.term.SiteFromString().GenerateExtractor(args, ti, u
            appbase.BeginExecution();
        }
Пример #4
0
 /// <summary>
 /// HAnime Download Class
 /// </summary>
 /// <param name="term">Search term or download link</param>
 /// <param name="mt">Multithreading parameter (ineffective on HAnime)</param>
 /// <param name="path">Download Path, not functional</param>
 /// <param name="continuos">Download multiple videos in a row</param>
 /// <param name="ti">"taskindex" to be used with status update</param>
 /// <param name="statusUpdate">The function will call this when ever a notable update occurs</param>
 public HAnime(argumentList args, int ti = -1, Action <int, string> statusUpdate = null) : base(args, ti, statusUpdate, Site.HAnime)
 {
     ao = args;
     if (ao.vRange)
     {
         throw new ArgumentException("HAnime does not support vRange.");
     }
 }
Пример #5
0
        private void AnimeDownload(argumentList args, int ti, Action <int, string> u)
        {
            VideoBase e = new VideoBase(args, ti, u);

            _base = e;
            e.BeginExecution();
            return;
        }
Пример #6
0
        public VideoBase(argumentList args, int ti = -1, Action <int, string> u = null)
        {
            ao        = args;
            taskIndex = ti;
            updater   = u;

            if (ao.s)
            {
                GlobalAniSearch();
            }
        }
Пример #7
0
        public DownloaderBase(argumentList args, int taskIndex, Action <int, string> act)
        {
            ao = args;

            this.taskIndex    = taskIndex;
            this.updateStatus = act;


            ADLUpdates.CallLogUpdate("Creating Novel Download Instance");
            this.url  = new Uri(args.term);
            webClient = new WebClient();
            GenerateHeaders();
            string html = webClient.DownloadString(args.term);

            LoadPage(html);
            html = null;
        }
Пример #8
0
        public ExtractorBase(argumentList a, int ti, Action <int, string> u, Site host)
        {
            Aborted   = new ManualResetEvent(false);
            ao        = a;
            webClient = new WebClient();
            if (ti > -1 && u != null)
            {
                taskIndex    = ti;
                updateStatus = u;
            }
            else
            {
                throw new Exception("Action not provided when setting taskIndex");
            }

            quester = host;
        }
Пример #9
0
 protected void EmitargumentList(argumentList args, string lparen, string rparen)
 {
     Write(lparen);
     for (int i = 0; i < args.Count; i++)
     {
         if (i > 0)
         {
             Write(", ");
         }
         if (args[i].kind != null)
         {
             Write("{0} ", args[i].kind.str);
         }
         visit(args[i].expr);
     }
     Write(rparen);
 }
Пример #10
0
        private void NovelDownload(argumentList args, int ti, Action <int, string> u)
        {
            if (args.s)
            {
                throw new Exception("Novel Downloader does not support searching at this time.");
            }
            if (args.cc)
            {
                throw new Exception("Novel Downloader does not support continuos downloads at this time.");
            }
            Book bk;

            if (args.term.IsValidUri())
            {
                bk = new Book(args.term, true, ti, new Action <int, string>(u));
                bk.ExportToADL();
            }
            else
            {
                bk = new Book(args.term, false, ti, new Action <int, string>(u));
                bk.dwnldFinished = true;
            }

            if (args.d)
            {
                bk.DownloadChapters(args.mt);
                while (!bk.dwnldFinished)
                {
                    Thread.Sleep(200);
                }
            }

            if (args.e)
            {
                bk.ExportToEPUB(args.l ? args.export : Path.Join(Directory.GetCurrentDirectory(), "Epubs", bk.metaData.name));
                u.Invoke(ti, $"{bk.metaData.name} exported to epub successfully!");
            }
        }
Пример #11
0
 protected void EmitargumentList(argumentList args)
 {
     EmitargumentList(args, "(", ")");
 }
Пример #12
0
 public cNovelFull(argumentList args, int taskIndex, Action <int, string> act) : base(args, taskIndex, act)
 {
 }
Пример #13
0
        //episodes to download: 0-12, 1-12, 5-6 etc.
        //TODO: Implement download ranges for GoGoStream and TwistMoe (and novel downloaders)

        //key  MjY3MDQxZGY1NWNhMmIzNmYyZTMyMmQwNWVlMmM5Y2Y= -> search for atob(e) and floating-player
        public TwistMoe(argumentList args, int ti = -1, Action <int, string> u = null) : base(args, ti, u, Site.TwistMoe)
        {
            ADLUpdates.CallLogUpdate("Beginning instantiation of TwistMoe Object");
            updateStatus?.Invoke(taskIndex, "Proceeding with setup");
        }
Пример #14
0
 public AsianHobbyist(argumentList args, int taskIndex, Action <int, string> act) : base(args, taskIndex, act)
 {
 }
Пример #15
0
 public dWuxiaWorld(argumentList args, int taskIndex, Action <int, string> act) : base(args, taskIndex, act)
 {
 }
Пример #16
0
 public MangaKakalot(argumentList args, int taskIndex, Action <int, string> act) : base(args, taskIndex, act)
 {
 }
Пример #17
0
    public static object resolve(nonterminalState node, string nonterm)
    {
        System.Collections.Queue q;
        expression e1;
        expression e2;

        switch (nonterm)
        {
        default:
            if (node.queue != null)
            {
                node.report();
                //System.Console.WriteLine("{0}", node.ToString(""));
                throw new System.Exception("ambiguous");
            }
            node.report();
            return(null);

        case "argument-list":
            q          = node.queue;
            node.queue = null;
            argumentList a = (argumentList)parse2AST.rewrite_argument_list(node);
            foreach (nonterminalState s in q)
            {
                argumentList a2 = (argumentList)parse2AST.rewrite_argument_list(s);
                if (a2.Count < a.Count)
                {
                    a = a2;
                }
            }
            return(a);

        case "relational-expression":
            q          = node.queue;
            node.queue = null;
            e1         = parse2AST.rewrite_relational_expression(node);
            int n = TypeArgumentCount(e1);
            foreach (nonterminalState s in q)
            {
                e2 = parse2AST.rewrite_relational_expression(s);
                int m = TypeArgumentCount(e2);
                if (m > n)
                {
                    n  = m;
                    e1 = e2;
                }
            }
            return(e1);

        case "if-statement":
            q          = node.queue;
            node.queue = null;
            // by picking the short production
            int count = 0;
            for (state p = node.rightmost; p != node.below; p = p.below)
            {
                count++;
            }
            bool ties = false;

            foreach (nonterminalState node1 in q)
            {
                int c = 0;
                for (state p = node1.rightmost; p != node1.below; p = p.below)
                {
                    c++;
                }
                if (c < count)
                {
                    node  = node1;
                    ties  = false;
                    count = c;
                }
                else if (c == count)
                {
                    ties = true;
                }
            }

            System.Diagnostics.Debug.Assert(!ties);
            return(parse2AST.rewrite_if_statement(node));

        case "and-expression":                  // (e1) & e2 ambiguity
            q          = node.queue;
            node.queue = null;
            e1         = parse2AST.rewrite_and_expression(node);
            System.Diagnostics.Debug.Assert(q.Count == 1);
            e2 = parse2AST.rewrite_and_expression((nonterminalState)q.Dequeue());
            return(fix_cast(e1, e2));

        case "additive-expression":                     // (e1) + e2 ambiguity
            q          = node.queue;
            node.queue = null;
            e1         = parse2AST.rewrite_additive_expression(node);
            System.Diagnostics.Debug.Assert(q.Count == 1);
            e2 = parse2AST.rewrite_additive_expression((nonterminalState)q.Dequeue());
            return(fix_cast(e1, e2));

        case "unary-expression":                        //
            q          = node.queue;
            node.queue = null;
            e1         = parse2AST.rewrite_unary_expression(node);
            System.Diagnostics.Debug.Assert(q.Count == 1);
            e2 = parse2AST.rewrite_unary_expression((nonterminalState)q.Dequeue());
            return(fix_cast(e1, e2));

        case "multiplicative-expression":                       // (e1) * e2 ambiguity
            q          = node.queue;
            node.queue = null;
            e1         = parse2AST.rewrite_multiplicative_expression(node);
            System.Diagnostics.Debug.Assert(q.Count == 1);
            e2 = parse2AST.rewrite_multiplicative_expression((nonterminalState)q.Dequeue());
            return(fix_cast(e1, e2));
        }
    }
Пример #18
0
 public abstract dynamic GenerateExtractor(argumentList args, int ti, Action <int, string> act);
Пример #19
0
 public override dynamic GenerateExtractor(argumentList args, int ti, Action <int, string> act)
 => new Video.Extractors.TwistMoe(args, ti, act);
Пример #20
0
 AddArguments(semanticModel, buffer, argumentList, cancellationToken);
Пример #21
0
 /// <summary>
 /// HAnime Download Class
 /// </summary>
 /// <param name="term">Search term or download link</param>
 /// <param name="mt">Multithreading parameter (ineffective on HAnime)</param>
 /// <param name="path">Download Path, not functional</param>
 /// <param name="continuos">Download multiple videos in a row</param>
 /// <param name="ti">"taskindex" to be used with status update</param>
 /// <param name="statusUpdate">The function will call this when ever a notable update occurs</param>
 public HAnime(argumentList args, int ti = -1, Action <int, string> statusUpdate = null) : base(args, ti, statusUpdate, Site.HAnime)
 {
     ao = args;
 }
Пример #22
0
 public override dynamic GenerateExtractor(argumentList args, int ti, Action <int, string> act)
 => new Manga.Downloaders.MangaKakalot(args, ti, act);
Пример #23
0
 public cScribbleHub(argumentList args, int taskIndex, Action <int, string> act) : base(args, taskIndex, act)
 {
 }
Пример #24
0
 public override dynamic GenerateExtractor(argumentList args, int ti, Action <int, string> act)
 => new Novels.Downloaders.NovelHall(args, ti, act);
Пример #25
0
 public GoGoStream(argumentList args, int ti = -1, Action <int, string> u = null) : base(args, ti, u, Site.Vidstreaming)
 {
     ao = args;
 }