Exemple #1
0
        static void Main(string[] args)
        {
            ConsoleEvents.StartMonitor(eventType => { FiddlerApplication.Shutdown(); return(false); });
            Certification.InstallCertificate();

            FiddlerApplication.BeforeRequest += delegate(Fiddler.Session oSession)
            {
                oSession.bBufferResponse = true;
            };
            FiddlerApplication.BeforeResponse += delegate(Fiddler.Session oSession)
            {
                if (oSession.url.Contains("yts/jsbin/player") && oSession.url.Contains("base.js"))
                {
                    oSession.utilDecodeResponse();
                    String originbody   = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
                    var    replacedBody = Regex.Replace(originbody, @"([a-zA-Z_]*)\(this,""start"",\!([0-1]),\!([0-1])\)", @"$1(this,""skip"",!$2,!$3)");
                    bool   replaced     = !originbody.SequenceEqual(replacedBody);
                    oSession.utilSetResponseBody(replacedBody);
                    Console.WriteLine("gotcha: " + oSession.fullUrl);
                    if (replaced)
                    {
                        Console.WriteLine("modified the functionality of youtube!");
                    }
                    else
                    {
                        Console.WriteLine("failed to modify the functionality. try up-to-date version.");
                    }
                }
            };
            //FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
            FiddlerApplication.AfterSocketAccept += FiddlerApplication_AfterSocketAccept;
            FiddlerApplication.Startup(8890, true, true, true);


            Console.WriteLine("I am looking for the ads...! Don't see any messages after opening Youtube? Try delete your cache files.");
            for (;;)
            {
                Thread.Sleep(100000);
            }
        }
Exemple #2
0
 internal Application(IEnumerable <IConsolePlugin> plugins, ConsoleEvents consoleEvents)
 {
     _consoleEvents = consoleEvents;
     Plugins        = plugins.ToDictionary(p => p.GetType());
     //PluginsToWatch = new HashSet<string>();
 }
Exemple #3
0
 internal Application(IEnumerable<IConsolePlugin> plugins, ConsoleEvents consoleEvents)
 {
     _consoleEvents = consoleEvents;
     Plugins = plugins.ToDictionary(p => p.GetType());
     //PluginsToWatch = new HashSet<string>();
 }