Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace TwitchDarkTool.Twitch_Viewers
- {
- using MetroFramework;
- using MetroFramework.Controls;
- using MetroFramework.Forms;
- using Microsoft.VisualBasic;
- using Microsoft.VisualBasic.CompilerServices;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Drawing;
- using System.IO;
- using System.Net;
- using System.Net.Http;
- using System.Runtime.CompilerServices;
- using System.Text;
- using System.Text.RegularExpressions;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using TwitchDarkTool.Properties;
- using xNet;
- public class TwitchView : MetroForm
- {
- private IContainer components;
- public static int int0;
- private MetroLabel labelCountProxy;
- private MetroLabel labelCountVrabote;
- private MetroLabel labelTextRabota;
- private MetroLabel labelWait;
- private ListBox listProxy;
- private MetroButton metroButton1;
- private MetroButton metroButton3;
- private MetroButton metroButton4;
- private MetroButton metroButton5;
- private MetroLabel metroLabel2;
- private MetroLabel metroLabel3;
- private MetroProgressBar metroProgressBar1;
- private MetroRadioButton metroRadioButton1;
- private MetroRadioButton metroRadioButton2;
- private MetroRadioButton metroRadioButton3;
- private MetroRadioButton metroRadioButton4;
- private MetroRadioButton metroRadioButton5;
- private MetroRadioButton metroRadioButton6;
- private MetroTextBox metroTextBox1;
- private NumericUpDown numericUpDown1;
- public static Random random0;
- private RichTextBox richTextBox1;
- public static string string12;
- public static string string13;
- public static string string16;
- private MetroLabel Subs;
- private Timer timer1;
- private MetroLabel Views;
- private MetroLabel Zriteli;
- public TwitchView()
- {
- this.InitializeComponent();
- random0 = new Random();
- string12 = "/api/channel/hls/";
- string13 = ".m3u8?token=";
- string16 = "&segment_preference=4&p=9681&allow_source=true&sig=";
- this.metroLabel3.Text = "Текущий IP: " + new WebClient().DownloadString("http://icanhazip.com/").ToString();
- }
- public void authT1000()
- {
- try
- {
- CookieContainer container = new CookieContainer();
- string str = Settings.Default["loginStart"].ToString();
- string str2 = Settings.Default["passwordStart"].ToString();
- string[] textArray1 = new string[] { "option=afo_user_login&redirect=http%3A%2F%2Ffortek-dev.ru%2Fshop%2Fmytools%2Fdownloads%2F&user_username=", str, "&user_password=", str2, "&login=Login" };
- string s = string.Concat(textArray1);
- byte[] bytes = new UTF8Encoding().GetBytes(s);
- HttpWebRequest request1 = (HttpWebRequest) WebRequest.Create("http://fortek-dev.ru/shop/fortek-dev-login/");
- request1.Method = "POST";
- request1.KeepAlive = true;
- request1.CookieContainer = container;
- request1.ContentType = "application/x-www-form-urlencoded";
- request1.Referer = "Referer: http://fortek-dev.ru/";
- request1.ContentLength = bytes.Length;
- Stream requestStream = request1.GetRequestStream();
- requestStream.Write(bytes, 0, bytes.Length);
- requestStream.Close();
- HttpWebResponse response = (HttpWebResponse) request1.GetResponse();
- container.Add(response.Cookies);
- string str4 = new StreamReader(response.GetResponseStream()).ReadToEnd();
- this.richTextBox1.Text = str4;
- if (str4.Contains("Showing all"))
- {
- Process.GetCurrentProcess().Kill();
- }
- else if (str4.Contains("– HTTP(s) Proxy"))
- {
- this.metroButton1.Text = "Элитные прокси";
- this.metroButton1.Enabled = true;
- }
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- Process.GetCurrentProcess().Kill();
- ProjectData.ClearProjectError();
- }
- }
- protected override void Dispose(bool disposing)
- {
- if (disposing && (this.components != null))
- {
- this.components.Dispose();
- }
- base.Dispose(disposing);
- }
- private void InitializeComponent()
- {
- this.components = new Container();
- ComponentResourceManager manager = new ComponentResourceManager(typeof(TwitchView));
- this.numericUpDown1 = new NumericUpDown();
- this.listProxy = new ListBox();
- this.timer1 = new Timer(this.components);
- this.richTextBox1 = new RichTextBox();
- this.metroTextBox1 = new MetroTextBox();
- this.metroLabel2 = new MetroLabel();
- this.metroButton1 = new MetroButton();
- this.metroButton3 = new MetroButton();
- this.metroRadioButton1 = new MetroRadioButton();
- this.metroRadioButton3 = new MetroRadioButton();
- this.labelCountProxy = new MetroLabel();
- this.labelTextRabota = new MetroLabel();
- this.labelCountVrabote = new MetroLabel();
- this.labelWait = new MetroLabel();
- this.metroProgressBar1 = new MetroProgressBar();
- this.metroButton4 = new MetroButton();
- this.Zriteli = new MetroLabel();
- this.Views = new MetroLabel();
- this.Subs = new MetroLabel();
- this.metroButton5 = new MetroButton();
- this.metroLabel3 = new MetroLabel();
- this.metroRadioButton2 = new MetroRadioButton();
- this.metroRadioButton4 = new MetroRadioButton();
- this.metroRadioButton5 = new MetroRadioButton();
- this.metroRadioButton6 = new MetroRadioButton();
- this.numericUpDown1.BeginInit();
- base.SuspendLayout();
- this.numericUpDown1.BackColor = Color.FromArgb(0x11, 0x11, 0x11);
- this.numericUpDown1.ForeColor = SystemColors.ActiveBorder;
- this.numericUpDown1.Location = new Point(0x57, 0xe7);
- int[] bits = new int[4];
- bits[0] = 200;
- this.numericUpDown1.Maximum = new decimal(bits);
- this.numericUpDown1.Name = "numericUpDown1";
- this.numericUpDown1.Size = new Size(0x38, 20);
- this.numericUpDown1.TabIndex = 3;
- int[] numArray2 = new int[4];
- numArray2[0] = 50;
- this.numericUpDown1.Value = new decimal(numArray2);
- this.listProxy.BackColor = Color.FromArgb(0x11, 0x11, 0x11);
- this.listProxy.ForeColor = SystemColors.ActiveBorder;
- this.listProxy.FormattingEnabled = true;
- this.listProxy.Location = new Point(0xd5, 0x159);
- this.listProxy.Name = "listProxy";
- this.listProxy.Size = new Size(0x93, 30);
- this.listProxy.TabIndex = 11;
- this.timer1.Interval = 150;
- this.timer1.Tick += new EventHandler(this.timer1_Tick);
- this.richTextBox1.Location = new Point(350, 11);
- this.richTextBox1.Name = "richTextBox1";
- this.richTextBox1.Size = new Size(10, 10);
- this.richTextBox1.TabIndex = 0x17;
- this.richTextBox1.Text = "";
- this.richTextBox1.Visible = false;
- this.metroTextBox1.CustomButton.Image = null;
- this.metroTextBox1.CustomButton.Location = new Point(0x139, 1);
- this.metroTextBox1.CustomButton.Name = "";
- this.metroTextBox1.CustomButton.Size = new Size(0x15, 0x15);
- this.metroTextBox1.CustomButton.Style = MetroColorStyle.Blue;
- this.metroTextBox1.CustomButton.TabIndex = 1;
- this.metroTextBox1.CustomButton.Theme = MetroThemeStyle.Light;
- this.metroTextBox1.CustomButton.UseSelectable = true;
- this.metroTextBox1.CustomButton.Visible = false;
- this.metroTextBox1.Lines = new string[0];
- this.metroTextBox1.Location = new Point(0x19, 0x3f);
- this.metroTextBox1.MaxLength = 0x7fff;
- this.metroTextBox1.Name = "metroTextBox1";
- this.metroTextBox1.PasswordChar = '\0';
- this.metroTextBox1.PromptText = "Введите название канала Twitch";
- this.metroTextBox1.ScrollBars = ScrollBars.None;
- this.metroTextBox1.SelectedText = "";
- this.metroTextBox1.SelectionLength = 0;
- this.metroTextBox1.SelectionStart = 0;
- this.metroTextBox1.ShortcutsEnabled = true;
- this.metroTextBox1.Size = new Size(0x14f, 0x17);
- this.metroTextBox1.TabIndex = 0x1b;
- this.metroTextBox1.Theme = MetroThemeStyle.Dark;
- this.metroTextBox1.UseSelectable = true;
- this.metroTextBox1.WaterMark = "Введите название канала Twitch";
- this.metroTextBox1.WaterMarkColor = Color.FromArgb(0x6d, 0x6d, 0x6d);
- this.metroTextBox1.WaterMarkFont = new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel);
- this.metroLabel2.AutoSize = true;
- this.metroLabel2.Location = new Point(0x19, 0xe7);
- this.metroLabel2.Name = "metroLabel2";
- this.metroLabel2.Size = new Size(0x38, 0x13);
- this.metroLabel2.TabIndex = 0x1d;
- this.metroLabel2.Text = "Потоки:";
- this.metroLabel2.Theme = MetroThemeStyle.Dark;
- this.metroButton1.Location = new Point(0x19, 0x5c);
- this.metroButton1.Name = "metroButton1";
- this.metroButton1.Size = new Size(0x14f, 0x17);
- this.metroButton1.TabIndex = 30;
- this.metroButton1.Text = "Элитные прокси";
- this.metroButton1.Theme = MetroThemeStyle.Dark;
- this.metroButton1.UseSelectable = true;
- this.metroButton1.Click += new EventHandler(this.metroButton1_Click);
- this.metroButton3.Location = new Point(0x19, 330);
- this.metroButton3.Name = "metroButton3";
- this.metroButton3.Size = new Size(80, 0x17);
- this.metroButton3.TabIndex = 0x20;
- this.metroButton3.Text = "Свои прокси";
- this.metroButton3.Theme = MetroThemeStyle.Dark;
- this.metroButton3.UseSelectable = true;
- this.metroButton3.Visible = false;
- this.metroButton3.Click += new EventHandler(this.metroButton3_Click);
- this.metroRadioButton1.AutoSize = true;
- this.metroRadioButton1.Location = new Point(0x19, 0x89);
- this.metroRadioButton1.Name = "metroRadioButton1";
- this.metroRadioButton1.Size = new Size(0x6f, 15);
- this.metroRadioButton1.TabIndex = 0x21;
- this.metroRadioButton1.Text = "HTTP(s) Threads";
- this.metroRadioButton1.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton1.UseSelectable = true;
- this.metroRadioButton1.Visible = false;
- this.metroRadioButton3.AutoSize = true;
- this.metroRadioButton3.Location = new Point(0x8e, 0x89);
- this.metroRadioButton3.Name = "metroRadioButton3";
- this.metroRadioButton3.Size = new Size(0x5c, 15);
- this.metroRadioButton3.TabIndex = 0x23;
- this.metroRadioButton3.Text = "SOCKS5 xNet";
- this.metroRadioButton3.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton3.UseSelectable = true;
- this.metroRadioButton3.Visible = false;
- this.labelCountProxy.AutoSize = true;
- this.labelCountProxy.Location = new Point(230, 30);
- this.labelCountProxy.Name = "labelCountProxy";
- this.labelCountProxy.Size = new Size(0x44, 0x13);
- this.labelCountProxy.TabIndex = 0x24;
- this.labelCountProxy.Text = "Прокси: 0";
- this.labelCountProxy.Theme = MetroThemeStyle.Dark;
- this.labelTextRabota.AutoSize = true;
- this.labelTextRabota.Location = new Point(0xf8, 0xab);
- this.labelTextRabota.Name = "labelTextRabota";
- this.labelTextRabota.Size = new Size(0x43, 0x13);
- this.labelTextRabota.TabIndex = 0x25;
- this.labelTextRabota.Text = "В работе:";
- this.labelTextRabota.Theme = MetroThemeStyle.Dark;
- this.labelCountVrabote.AutoSize = true;
- this.labelCountVrabote.Location = new Point(0x137, 0xab);
- this.labelCountVrabote.Name = "labelCountVrabote";
- this.labelCountVrabote.Size = new Size(0x10, 0x13);
- this.labelCountVrabote.TabIndex = 0x26;
- this.labelCountVrabote.Text = "0";
- this.labelCountVrabote.Theme = MetroThemeStyle.Dark;
- this.labelWait.AutoSize = true;
- this.labelWait.Location = new Point(0x19, 0xab);
- this.labelWait.Name = "labelWait";
- this.labelWait.Size = new Size(0x2f, 0x13);
- this.labelWait.TabIndex = 0x27;
- this.labelWait.Text = "Статус";
- this.labelWait.Theme = MetroThemeStyle.Dark;
- this.metroProgressBar1.Location = new Point(0x19, 0xc1);
- this.metroProgressBar1.Name = "metroProgressBar1";
- this.metroProgressBar1.Size = new Size(0x14f, 0x17);
- this.metroProgressBar1.TabIndex = 0x29;
- this.metroProgressBar1.Theme = MetroThemeStyle.Dark;
- this.metroButton4.ForeColor = SystemColors.ControlText;
- this.metroButton4.Location = new Point(0xb2, 0xe7);
- this.metroButton4.Name = "metroButton4";
- this.metroButton4.Size = new Size(0xb6, 0x17);
- this.metroButton4.TabIndex = 0x2a;
- this.metroButton4.Text = "Старт";
- this.metroButton4.Theme = MetroThemeStyle.Dark;
- this.metroButton4.UseSelectable = true;
- this.metroButton4.Click += new EventHandler(this.metroButton4_Click);
- this.Zriteli.AutoSize = true;
- this.Zriteli.Location = new Point(0xab, 0x10b);
- this.Zriteli.Name = "Zriteli";
- this.Zriteli.Size = new Size(0x3f, 0x13);
- this.Zriteli.TabIndex = 0x2b;
- this.Zriteli.Text = "Зрители:";
- this.Zriteli.Theme = MetroThemeStyle.Dark;
- this.Views.AutoSize = true;
- this.Views.Location = new Point(0xab, 0x11e);
- this.Views.Name = "Views";
- this.Views.Size = new Size(0x58, 0x13);
- this.Views.TabIndex = 0x2c;
- this.Views.Text = "Просмотров:";
- this.Views.Theme = MetroThemeStyle.Dark;
- this.Subs.AutoSize = true;
- this.Subs.Location = new Point(0xab, 0x131);
- this.Subs.Name = "Subs";
- this.Subs.Size = new Size(0x5e, 0x13);
- this.Subs.TabIndex = 0x2d;
- this.Subs.Text = "Подписчиков:";
- this.Subs.Theme = MetroThemeStyle.Dark;
- this.metroButton5.Location = new Point(0x19, 0x10b);
- this.metroButton5.Name = "metroButton5";
- this.metroButton5.Size = new Size(140, 0x39);
- this.metroButton5.TabIndex = 0x2e;
- this.metroButton5.Text = "Обновить статистику";
- this.metroButton5.Theme = MetroThemeStyle.Dark;
- this.metroButton5.UseSelectable = true;
- this.metroButton5.Click += new EventHandler(this.metroButton5_Click);
- this.metroLabel3.AutoSize = true;
- this.metroLabel3.Location = new Point(0x19, 0x164);
- this.metroLabel3.Name = "metroLabel3";
- this.metroLabel3.Size = new Size(80, 0x13);
- this.metroLabel3.TabIndex = 0x2f;
- this.metroLabel3.Text = "Текущий IP:";
- this.metroLabel3.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton2.AutoSize = true;
- this.metroRadioButton2.Checked = true;
- this.metroRadioButton2.Location = new Point(0x19, 0x79);
- this.metroRadioButton2.Name = "metroRadioButton2";
- this.metroRadioButton2.Size = new Size(0x61, 15);
- this.metroRadioButton2.TabIndex = 0x30;
- this.metroRadioButton2.TabStop = true;
- this.metroRadioButton2.Text = "HTTP(s) Tasks";
- this.metroRadioButton2.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton2.UseSelectable = true;
- this.metroRadioButton4.AutoSize = true;
- this.metroRadioButton4.Location = new Point(0x8e, 0x79);
- this.metroRadioButton4.Name = "metroRadioButton4";
- this.metroRadioButton4.Size = new Size(0x5d, 15);
- this.metroRadioButton4.TabIndex = 0x31;
- this.metroRadioButton4.Text = "HTTP(s) xNet";
- this.metroRadioButton4.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton4.UseSelectable = true;
- this.metroRadioButton4.Visible = false;
- this.metroRadioButton5.AutoSize = true;
- this.metroRadioButton5.Location = new Point(0xf1, 0x79);
- this.metroRadioButton5.Name = "metroRadioButton5";
- this.metroRadioButton5.Size = new Size(0x6c, 15);
- this.metroRadioButton5.TabIndex = 50;
- this.metroRadioButton5.Text = "HARD METHOD";
- this.metroRadioButton5.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton5.UseSelectable = true;
- this.metroRadioButton5.Visible = false;
- this.metroRadioButton6.AutoSize = true;
- this.metroRadioButton6.Location = new Point(0xf1, 0x89);
- this.metroRadioButton6.Name = "metroRadioButton6";
- this.metroRadioButton6.Size = new Size(0x87, 15);
- this.metroRadioButton6.TabIndex = 0x33;
- this.metroRadioButton6.Text = "HARD METHOD xNet";
- this.metroRadioButton6.Theme = MetroThemeStyle.Dark;
- this.metroRadioButton6.UseSelectable = true;
- this.metroRadioButton6.Visible = false;
- base.AutoScaleDimensions = new SizeF(6f, 13f);
- base.AutoScaleMode = AutoScaleMode.Font;
- base.ClientSize = new Size(0x17b, 0x180);
- base.Controls.Add(this.metroRadioButton6);
- base.Controls.Add(this.metroRadioButton5);
- base.Controls.Add(this.metroRadioButton4);
- base.Controls.Add(this.metroRadioButton2);
- base.Controls.Add(this.metroLabel3);
- base.Controls.Add(this.metroButton5);
- base.Controls.Add(this.Subs);
- base.Controls.Add(this.Views);
- base.Controls.Add(this.Zriteli);
- base.Controls.Add(this.metroButton4);
- base.Controls.Add(this.metroProgressBar1);
- base.Controls.Add(this.labelWait);
- base.Controls.Add(this.labelCountVrabote);
- base.Controls.Add(this.labelTextRabota);
- base.Controls.Add(this.labelCountProxy);
- base.Controls.Add(this.metroRadioButton3);
- base.Controls.Add(this.metroRadioButton1);
- base.Controls.Add(this.metroButton3);
- base.Controls.Add(this.metroButton1);
- base.Controls.Add(this.metroLabel2);
- base.Controls.Add(this.metroTextBox1);
- base.Controls.Add(this.richTextBox1);
- base.Controls.Add(this.listProxy);
- base.Controls.Add(this.numericUpDown1);
- base.Icon = (Icon) manager.GetObject("$this.Icon");
- base.Name = "TwitchView";
- base.Resizable = false;
- this.Text = "Twitch-зрители";
- base.Theme = MetroThemeStyle.Dark;
- base.Load += new EventHandler(this.TwitchView_Load);
- this.numericUpDown1.EndInit();
- base.ResumeLayout(false);
- base.PerformLayout();
- }
- public string method_0(ref HttpWebRequest httpWebRequest0)
- {
- return new StreamReader(this.smethod_1(ref httpWebRequest0).GetResponseStream(), Encoding.UTF8, true).ReadToEnd();
- }
- public void method_premium_http_Task()
- {
- while (this.labelWait.Text != "Стоп")
- {
- if (!Application.OpenForms[0].InvokeRequired)
- {
- new Task(new Action(this.method_premium_http_Task)).Start();
- return;
- }
- try
- {
- HttpWebRequest request = (HttpWebRequest) WebRequest.Create("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json");
- string input = this.Smethod0(ref request);
- if (input == null)
- {
- continue;
- }
- Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
- Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
- if (!match.Success || !match2.Success)
- {
- continue;
- }
- string str2 = match.Groups[1].Value;
- string str3 = match2.Groups[1].Value.Replace(@"\", "");
- string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
- HttpWebRequest request2 = (HttpWebRequest) WebRequest.Create(string.Concat(textArray1));
- string str4 = this.Smethod0(ref request2);
- MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
- if (matchs.Count == 0)
- {
- continue;
- }
- string requestUriString = matchs[0].Value;
- while (this.labelWait.Text != "Стоп")
- {
- HttpWebRequest request3 = (HttpWebRequest) WebRequest.Create(requestUriString);
- int0 = random0.Next(1, this.listProxy.Items.Count - 1);
- WebProxy proxy = new WebProxy(Conversions.ToString(this.listProxy.Items[int0]));
- request3.Proxy = proxy;
- string str6 = this.method_0(ref request3);
- if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
- {
- if (this.labelWait.Text == "Стоп")
- {
- break;
- }
- int count = matchs.Count;
- }
- }
- break;
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- ProjectData.ClearProjectError();
- continue;
- }
- }
- }
- public void method_premium_http_thread()
- {
- while (this.labelWait.Text != "Стоп")
- {
- if (!Application.OpenForms[0].InvokeRequired)
- {
- new Thread(new ThreadStart(this.method_premium_http_thread)) { IsBackground = true }.Start();
- return;
- }
- try
- {
- HttpWebRequest request = (HttpWebRequest) WebRequest.Create("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json");
- string input = this.Smethod0(ref request);
- if (input == null)
- {
- continue;
- }
- Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
- Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
- if (!match.Success || !match2.Success)
- {
- continue;
- }
- string str2 = match.Groups[1].Value;
- string str3 = match2.Groups[1].Value.Replace(@"\", "");
- string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
- HttpWebRequest request2 = (HttpWebRequest) WebRequest.Create(string.Concat(textArray1));
- string str4 = this.Smethod0(ref request2);
- MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
- if (matchs.Count == 0)
- {
- continue;
- }
- string requestUriString = matchs[0].Value;
- while (this.labelWait.Text != "Стоп")
- {
- HttpWebRequest request3 = (HttpWebRequest) WebRequest.Create(requestUriString);
- int0 = random0.Next(1, this.listProxy.Items.Count - 1);
- WebProxy proxy = new WebProxy(Conversions.ToString(this.listProxy.Items[int0]));
- request3.Proxy = proxy;
- string str6 = this.method_0(ref request3);
- if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
- {
- if (this.labelWait.Text == "Стоп")
- {
- break;
- }
- int count = matchs.Count;
- }
- }
- break;
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- ProjectData.ClearProjectError();
- continue;
- }
- }
- }
- public void method_premium_https_xNet()
- {
- while (this.labelWait.Text != "Стоп")
- {
- if (!Application.OpenForms[0].InvokeRequired)
- {
- new Thread(new ThreadStart(this.method_premium_https_xNet)) { IsBackground = true }.Start();
- return;
- }
- try
- {
- HttpRequest request = new HttpRequest();
- string input = request.Get("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json", null).ToString();
- if (input == null)
- {
- continue;
- }
- Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
- Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
- if (!match.Success || !match2.Success)
- {
- continue;
- }
- string str2 = match.Groups[1].Value;
- string str3 = match2.Groups[1].Value.Replace(@"\", "");
- request.Close();
- HttpRequest request2 = new HttpRequest();
- string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
- string str4 = request2.Get(string.Concat(textArray1), null).ToString();
- MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
- if (matchs.Count == 0)
- {
- continue;
- }
- string str5 = matchs[0].Value;
- request2.Close();
- while (this.labelWait.Text != "Стоп")
- {
- HttpRequest request3 = new HttpRequest();
- request3.set_Proxy(HttpProxyClient.Parse(Conversions.ToString(this.listProxy.Items[int0])));
- string str6 = request3.Get(str5, null).ToString();
- int0 = random0.Next(1, this.listProxy.Items.Count - 1);
- if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
- {
- if (this.labelWait.Text == "Стоп")
- {
- break;
- }
- if (matchs.Count != 1)
- {
- continue;
- }
- }
- request3.Close();
- }
- break;
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- ProjectData.ClearProjectError();
- continue;
- }
- }
- }
- public void method_premium_socks_xNet()
- {
- while (this.labelWait.Text != "Стоп")
- {
- if (!Application.OpenForms[0].InvokeRequired)
- {
- new Thread(new ThreadStart(this.method_premium_socks_xNet)) { IsBackground = true }.Start();
- return;
- }
- try
- {
- HttpRequest request = new HttpRequest();
- string input = request.Get("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json", null).ToString();
- if (input == null)
- {
- continue;
- }
- Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
- Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
- if (!match.Success || !match2.Success)
- {
- continue;
- }
- string str2 = match.Groups[1].Value;
- string str3 = match2.Groups[1].Value.Replace(@"\", "");
- request.Close();
- HttpRequest request2 = new HttpRequest();
- string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
- string str4 = request2.Get(string.Concat(textArray1), null).ToString();
- MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
- if (matchs.Count == 0)
- {
- continue;
- }
- string str5 = matchs[0].Value;
- request2.Close();
- while (this.labelWait.Text != "Стоп")
- {
- HttpRequest request3 = new HttpRequest();
- request3.set_Proxy(Socks5ProxyClient.Parse(Conversions.ToString(this.listProxy.Items[int0])));
- string str6 = request3.Get(str5, null).ToString();
- int0 = random0.Next(1, this.listProxy.Items.Count - 1);
- if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
- {
- if (this.labelWait.Text == "Стоп")
- {
- break;
- }
- if (matchs.Count != 1)
- {
- continue;
- }
- }
- request3.Close();
- }
- break;
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- ProjectData.ClearProjectError();
- continue;
- }
- }
- }
- [AsyncStateMachine(typeof(<metroButton1_Click>d__16))]
- private void metroButton1_Click(object sender, EventArgs e)
- {
- <metroButton1_Click>d__16 d__;
- d__.<>4__this = this;
- d__.<>t__builder = AsyncVoidMethodBuilder.Create();
- d__.<>1__state = -1;
- d__.<>t__builder.Start<<metroButton1_Click>d__16>(ref d__);
- }
- private void metroButton3_Click(object sender, EventArgs e)
- {
- try
- {
- this.labelCountProxy.Text = "Прокси: 0";
- this.listProxy.Items.Clear();
- OpenFileDialog dialog = new OpenFileDialog();
- dialog.ShowDialog();
- if (dialog.FileName != null)
- {
- List<string> list = new List<string>();
- using (StreamReader reader = new StreamReader(dialog.FileName))
- {
- while (reader.Peek() != -1)
- {
- list.Add(reader.ReadLine());
- }
- }
- foreach (string str in File.ReadAllLines(dialog.FileName))
- {
- this.listProxy.Items.Add(str);
- }
- this.labelCountProxy.Text = "Прокси: " + Conversions.ToString(this.listProxy.Items.Count);
- }
- }
- catch
- {
- }
- }
- private void metroButton4_Click(object sender, EventArgs e)
- {
- try
- {
- if (this.metroButton4.Text == "Старт")
- {
- if (this.metroTextBox1.Text == "")
- {
- Interaction.MsgBox("Введите имя канала", MsgBoxStyle.Information, null);
- }
- else if (this.listProxy.Items.Count == 0)
- {
- Interaction.MsgBox("Загрузите прокси-лист", MsgBoxStyle.Information, null);
- }
- else if (this.metroButton4.Text == "Старт")
- {
- this.labelWait.Text = "Работаем...";
- this.metroTextBox1.Text = this.metroTextBox1.Text.ToLower();
- this.metroTextBox1.Text = Strings.Replace(this.metroTextBox1.Text, Strings.Space(1), Strings.Space(0), 1, -1, CompareMethod.Binary);
- this.metroButton4.Text = "Стоп";
- this.timer1.Start();
- }
- }
- else
- {
- this.labelWait.Text = "Стоп";
- this.listProxy.Items.Clear();
- this.labelCountVrabote.Text = "0";
- this.labelCountProxy.Text = "Прокси: 0";
- this.metroProgressBar1.Value = 0;
- this.timer1.Stop();
- this.metroButton4.Text = "Старт";
- }
- }
- catch
- {
- }
- }
- private void metroButton5_Click(object sender, EventArgs e)
- {
- try
- {
- string input = new StreamReader(((HttpWebResponse) ((HttpWebRequest) WebRequest.Create("https://api.twitch.tv/kraken/streams/" + this.metroTextBox1.Text)).GetResponse()).GetResponseStream()).ReadToEnd();
- foreach (Match match in new Regex("followers\":([0-9]{1,23}.*?)").Matches(input))
- {
- char[] separator = new char[] { ':' };
- this.Subs.Text = "Подписчиков: " + match.ToString().Split(separator)[1];
- }
- foreach (Match match2 in new Regex("views\":([0-9]{1,33}.*?)").Matches(input))
- {
- char[] chArray2 = new char[] { ':' };
- this.Views.Text = "Просмотров: " + match2.ToString().Split(chArray2)[1];
- }
- foreach (Match match3 in new Regex("viewers\":([0-9]{1,23}.*?)").Matches(input))
- {
- char[] chArray3 = new char[] { ':' };
- this.Zriteli.Text = "Зрителей: " + match3.ToString().Split(chArray3)[1];
- }
- }
- catch
- {
- }
- }
- public HttpWebResponse smethod_1(ref HttpWebRequest httpWebRequest_0)
- {
- HttpWebResponse response;
- try
- {
- httpWebRequest_0.Method = "GET";
- response = (HttpWebResponse) httpWebRequest_0.GetResponse();
- }
- catch (Exception exception1)
- {
- ProjectData.SetProjectError(exception1);
- response = null;
- ProjectData.ClearProjectError();
- }
- return response;
- }
- public string Smethod0(ref HttpWebRequest httpWebRequest0)
- {
- return new StreamReader(this.smethod_1(ref httpWebRequest0).GetResponseStream(), Encoding.UTF8, true).ReadToEnd();
- }
- private void timer1_Tick(object sender, EventArgs e)
- {
- if (Conversions.ToInteger(this.labelCountVrabote.Text) >= Convert.ToInt32(this.numericUpDown1.Value))
- {
- this.timer1.Stop();
- }
- else
- {
- if (this.metroRadioButton1.Checked)
- {
- this.method_premium_http_thread();
- this.listProxy.SelectedIndex++;
- this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
- this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
- this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
- }
- if (this.metroRadioButton2.Checked)
- {
- this.method_premium_http_Task();
- this.listProxy.SelectedIndex++;
- this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
- this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
- this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
- }
- if (this.metroRadioButton3.Checked)
- {
- this.method_premium_socks_xNet();
- this.listProxy.SelectedIndex++;
- this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
- this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
- this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
- }
- if (this.metroRadioButton4.Checked)
- {
- this.method_premium_https_xNet();
- this.listProxy.SelectedIndex++;
- this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
- this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
- this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
- }
- }
- }
- private void TwitchView_Load(object sender, EventArgs e)
- {
- ServicePointManager.DefaultConnectionLimit = 0x989680;
- Control.CheckForIllegalCrossThreadCalls = false;
- this.metroButton1.Text = "N/A";
- this.metroButton1.Enabled = false;
- this.authT1000();
- }
- [CompilerGenerated]
- private struct <metroButton1_Click>d__16 : IAsyncStateMachine
- {
- public int <>1__state;
- public TwitchView <>4__this;
- public AsyncVoidMethodBuilder <>t__builder;
- private TaskAwaiter<string> <>u__1;
- private string <line>5__1;
- private void MoveNext()
- {
- int num = this.<>1__state;
- try
- {
- TaskAwaiter<string> awaiter;
- if (num != 0)
- {
- this.<>4__this.labelCountProxy.Text = "Прокси: 0";
- this.<>4__this.listProxy.Items.Clear();
- awaiter = new HttpClient().GetStringAsync("http://54.93.197.218/proxies/http_list.txt").GetAwaiter();
- if (!awaiter.IsCompleted)
- {
- this.<>1__state = num = 0;
- this.<>u__1 = awaiter;
- this.<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<string>, TwitchView.<metroButton1_Click>d__16>(ref awaiter, ref this);
- return;
- }
- }
- else
- {
- awaiter = this.<>u__1;
- this.<>u__1 = new TaskAwaiter<string>();
- this.<>1__state = num = -1;
- }
- string result = awaiter.GetResult();
- awaiter = new TaskAwaiter<string>();
- StringReader reader = new StringReader(result);
- while ((this.<line>5__1 = reader.ReadLine()) != null)
- {
- this.<>4__this.listProxy.Items.Add(this.<line>5__1);
- }
- this.<>4__this.labelCountProxy.Text = "Прокси: " + Conversions.ToString(this.<>4__this.listProxy.Items.Count);
- }
- catch (Exception exception)
- {
- this.<>1__state = -2;
- this.<>t__builder.SetException(exception);
- return;
- }
- this.<>1__state = -2;
- this.<>t__builder.SetResult();
- }
- [DebuggerHidden]
- private void SetStateMachine(IAsyncStateMachine stateMachine)
- {
- this.<>t__builder.SetStateMachine(stateMachine);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement