Advertisement
Guest User

Untitled

a guest
Sep 4th, 2016
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 43.39 KB | None | 0 0
  1. namespace TwitchDarkTool.Twitch_Viewers
  2. {
  3. using MetroFramework;
  4. using MetroFramework.Controls;
  5. using MetroFramework.Forms;
  6. using Microsoft.VisualBasic;
  7. using Microsoft.VisualBasic.CompilerServices;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.ComponentModel;
  11. using System.Diagnostics;
  12. using System.Drawing;
  13. using System.IO;
  14. using System.Net;
  15. using System.Net.Http;
  16. using System.Runtime.CompilerServices;
  17. using System.Text;
  18. using System.Text.RegularExpressions;
  19. using System.Threading;
  20. using System.Threading.Tasks;
  21. using System.Windows.Forms;
  22. using TwitchDarkTool.Properties;
  23. using xNet;
  24.  
  25. public class TwitchView : MetroForm
  26. {
  27. private IContainer components;
  28. public static int int0;
  29. private MetroLabel labelCountProxy;
  30. private MetroLabel labelCountVrabote;
  31. private MetroLabel labelTextRabota;
  32. private MetroLabel labelWait;
  33. private ListBox listProxy;
  34. private MetroButton metroButton1;
  35. private MetroButton metroButton3;
  36. private MetroButton metroButton4;
  37. private MetroButton metroButton5;
  38. private MetroLabel metroLabel2;
  39. private MetroLabel metroLabel3;
  40. private MetroProgressBar metroProgressBar1;
  41. private MetroRadioButton metroRadioButton1;
  42. private MetroRadioButton metroRadioButton2;
  43. private MetroRadioButton metroRadioButton3;
  44. private MetroRadioButton metroRadioButton4;
  45. private MetroRadioButton metroRadioButton5;
  46. private MetroRadioButton metroRadioButton6;
  47. private MetroTextBox metroTextBox1;
  48. private NumericUpDown numericUpDown1;
  49. public static Random random0;
  50. private RichTextBox richTextBox1;
  51. public static string string12;
  52. public static string string13;
  53. public static string string16;
  54. private MetroLabel Subs;
  55. private Timer timer1;
  56. private MetroLabel Views;
  57. private MetroLabel Zriteli;
  58.  
  59. public TwitchView()
  60. {
  61. this.InitializeComponent();
  62. random0 = new Random();
  63. string12 = "/api/channel/hls/";
  64. string13 = ".m3u8?token=";
  65. string16 = "&segment_preference=4&p=9681&allow_source=true&sig=";
  66. this.metroLabel3.Text = "Текущий IP: " + new WebClient().DownloadString("http://icanhazip.com/").ToString();
  67. }
  68.  
  69. public void authT1000()
  70. {
  71. try
  72. {
  73. CookieContainer container = new CookieContainer();
  74. string str = Settings.Default["loginStart"].ToString();
  75. string str2 = Settings.Default["passwordStart"].ToString();
  76. 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" };
  77. string s = string.Concat(textArray1);
  78. byte[] bytes = new UTF8Encoding().GetBytes(s);
  79. HttpWebRequest request1 = (HttpWebRequest) WebRequest.Create("http://fortek-dev.ru/shop/fortek-dev-login/");
  80. request1.Method = "POST";
  81. request1.KeepAlive = true;
  82. request1.CookieContainer = container;
  83. request1.ContentType = "application/x-www-form-urlencoded";
  84. request1.Referer = "Referer: http://fortek-dev.ru/";
  85. request1.ContentLength = bytes.Length;
  86. Stream requestStream = request1.GetRequestStream();
  87. requestStream.Write(bytes, 0, bytes.Length);
  88. requestStream.Close();
  89. HttpWebResponse response = (HttpWebResponse) request1.GetResponse();
  90. container.Add(response.Cookies);
  91. string str4 = new StreamReader(response.GetResponseStream()).ReadToEnd();
  92. this.richTextBox1.Text = str4;
  93. if (str4.Contains("Showing all"))
  94. {
  95. Process.GetCurrentProcess().Kill();
  96. }
  97. else if (str4.Contains("– HTTP(s) Proxy"))
  98. {
  99. this.metroButton1.Text = "Элитные прокси";
  100. this.metroButton1.Enabled = true;
  101. }
  102. }
  103. catch (Exception exception1)
  104. {
  105. ProjectData.SetProjectError(exception1);
  106. Process.GetCurrentProcess().Kill();
  107. ProjectData.ClearProjectError();
  108. }
  109. }
  110.  
  111. protected override void Dispose(bool disposing)
  112. {
  113. if (disposing && (this.components != null))
  114. {
  115. this.components.Dispose();
  116. }
  117. base.Dispose(disposing);
  118. }
  119.  
  120. private void InitializeComponent()
  121. {
  122. this.components = new Container();
  123. ComponentResourceManager manager = new ComponentResourceManager(typeof(TwitchView));
  124. this.numericUpDown1 = new NumericUpDown();
  125. this.listProxy = new ListBox();
  126. this.timer1 = new Timer(this.components);
  127. this.richTextBox1 = new RichTextBox();
  128. this.metroTextBox1 = new MetroTextBox();
  129. this.metroLabel2 = new MetroLabel();
  130. this.metroButton1 = new MetroButton();
  131. this.metroButton3 = new MetroButton();
  132. this.metroRadioButton1 = new MetroRadioButton();
  133. this.metroRadioButton3 = new MetroRadioButton();
  134. this.labelCountProxy = new MetroLabel();
  135. this.labelTextRabota = new MetroLabel();
  136. this.labelCountVrabote = new MetroLabel();
  137. this.labelWait = new MetroLabel();
  138. this.metroProgressBar1 = new MetroProgressBar();
  139. this.metroButton4 = new MetroButton();
  140. this.Zriteli = new MetroLabel();
  141. this.Views = new MetroLabel();
  142. this.Subs = new MetroLabel();
  143. this.metroButton5 = new MetroButton();
  144. this.metroLabel3 = new MetroLabel();
  145. this.metroRadioButton2 = new MetroRadioButton();
  146. this.metroRadioButton4 = new MetroRadioButton();
  147. this.metroRadioButton5 = new MetroRadioButton();
  148. this.metroRadioButton6 = new MetroRadioButton();
  149. this.numericUpDown1.BeginInit();
  150. base.SuspendLayout();
  151. this.numericUpDown1.BackColor = Color.FromArgb(0x11, 0x11, 0x11);
  152. this.numericUpDown1.ForeColor = SystemColors.ActiveBorder;
  153. this.numericUpDown1.Location = new Point(0x57, 0xe7);
  154. int[] bits = new int[4];
  155. bits[0] = 200;
  156. this.numericUpDown1.Maximum = new decimal(bits);
  157. this.numericUpDown1.Name = "numericUpDown1";
  158. this.numericUpDown1.Size = new Size(0x38, 20);
  159. this.numericUpDown1.TabIndex = 3;
  160. int[] numArray2 = new int[4];
  161. numArray2[0] = 50;
  162. this.numericUpDown1.Value = new decimal(numArray2);
  163. this.listProxy.BackColor = Color.FromArgb(0x11, 0x11, 0x11);
  164. this.listProxy.ForeColor = SystemColors.ActiveBorder;
  165. this.listProxy.FormattingEnabled = true;
  166. this.listProxy.Location = new Point(0xd5, 0x159);
  167. this.listProxy.Name = "listProxy";
  168. this.listProxy.Size = new Size(0x93, 30);
  169. this.listProxy.TabIndex = 11;
  170. this.timer1.Interval = 150;
  171. this.timer1.Tick += new EventHandler(this.timer1_Tick);
  172. this.richTextBox1.Location = new Point(350, 11);
  173. this.richTextBox1.Name = "richTextBox1";
  174. this.richTextBox1.Size = new Size(10, 10);
  175. this.richTextBox1.TabIndex = 0x17;
  176. this.richTextBox1.Text = "";
  177. this.richTextBox1.Visible = false;
  178. this.metroTextBox1.CustomButton.Image = null;
  179. this.metroTextBox1.CustomButton.Location = new Point(0x139, 1);
  180. this.metroTextBox1.CustomButton.Name = "";
  181. this.metroTextBox1.CustomButton.Size = new Size(0x15, 0x15);
  182. this.metroTextBox1.CustomButton.Style = MetroColorStyle.Blue;
  183. this.metroTextBox1.CustomButton.TabIndex = 1;
  184. this.metroTextBox1.CustomButton.Theme = MetroThemeStyle.Light;
  185. this.metroTextBox1.CustomButton.UseSelectable = true;
  186. this.metroTextBox1.CustomButton.Visible = false;
  187. this.metroTextBox1.Lines = new string[0];
  188. this.metroTextBox1.Location = new Point(0x19, 0x3f);
  189. this.metroTextBox1.MaxLength = 0x7fff;
  190. this.metroTextBox1.Name = "metroTextBox1";
  191. this.metroTextBox1.PasswordChar = '\0';
  192. this.metroTextBox1.PromptText = "Введите название канала Twitch";
  193. this.metroTextBox1.ScrollBars = ScrollBars.None;
  194. this.metroTextBox1.SelectedText = "";
  195. this.metroTextBox1.SelectionLength = 0;
  196. this.metroTextBox1.SelectionStart = 0;
  197. this.metroTextBox1.ShortcutsEnabled = true;
  198. this.metroTextBox1.Size = new Size(0x14f, 0x17);
  199. this.metroTextBox1.TabIndex = 0x1b;
  200. this.metroTextBox1.Theme = MetroThemeStyle.Dark;
  201. this.metroTextBox1.UseSelectable = true;
  202. this.metroTextBox1.WaterMark = "Введите название канала Twitch";
  203. this.metroTextBox1.WaterMarkColor = Color.FromArgb(0x6d, 0x6d, 0x6d);
  204. this.metroTextBox1.WaterMarkFont = new Font("Segoe UI", 12f, FontStyle.Italic, GraphicsUnit.Pixel);
  205. this.metroLabel2.AutoSize = true;
  206. this.metroLabel2.Location = new Point(0x19, 0xe7);
  207. this.metroLabel2.Name = "metroLabel2";
  208. this.metroLabel2.Size = new Size(0x38, 0x13);
  209. this.metroLabel2.TabIndex = 0x1d;
  210. this.metroLabel2.Text = "Потоки:";
  211. this.metroLabel2.Theme = MetroThemeStyle.Dark;
  212. this.metroButton1.Location = new Point(0x19, 0x5c);
  213. this.metroButton1.Name = "metroButton1";
  214. this.metroButton1.Size = new Size(0x14f, 0x17);
  215. this.metroButton1.TabIndex = 30;
  216. this.metroButton1.Text = "Элитные прокси";
  217. this.metroButton1.Theme = MetroThemeStyle.Dark;
  218. this.metroButton1.UseSelectable = true;
  219. this.metroButton1.Click += new EventHandler(this.metroButton1_Click);
  220. this.metroButton3.Location = new Point(0x19, 330);
  221. this.metroButton3.Name = "metroButton3";
  222. this.metroButton3.Size = new Size(80, 0x17);
  223. this.metroButton3.TabIndex = 0x20;
  224. this.metroButton3.Text = "Свои прокси";
  225. this.metroButton3.Theme = MetroThemeStyle.Dark;
  226. this.metroButton3.UseSelectable = true;
  227. this.metroButton3.Visible = false;
  228. this.metroButton3.Click += new EventHandler(this.metroButton3_Click);
  229. this.metroRadioButton1.AutoSize = true;
  230. this.metroRadioButton1.Location = new Point(0x19, 0x89);
  231. this.metroRadioButton1.Name = "metroRadioButton1";
  232. this.metroRadioButton1.Size = new Size(0x6f, 15);
  233. this.metroRadioButton1.TabIndex = 0x21;
  234. this.metroRadioButton1.Text = "HTTP(s) Threads";
  235. this.metroRadioButton1.Theme = MetroThemeStyle.Dark;
  236. this.metroRadioButton1.UseSelectable = true;
  237. this.metroRadioButton1.Visible = false;
  238. this.metroRadioButton3.AutoSize = true;
  239. this.metroRadioButton3.Location = new Point(0x8e, 0x89);
  240. this.metroRadioButton3.Name = "metroRadioButton3";
  241. this.metroRadioButton3.Size = new Size(0x5c, 15);
  242. this.metroRadioButton3.TabIndex = 0x23;
  243. this.metroRadioButton3.Text = "SOCKS5 xNet";
  244. this.metroRadioButton3.Theme = MetroThemeStyle.Dark;
  245. this.metroRadioButton3.UseSelectable = true;
  246. this.metroRadioButton3.Visible = false;
  247. this.labelCountProxy.AutoSize = true;
  248. this.labelCountProxy.Location = new Point(230, 30);
  249. this.labelCountProxy.Name = "labelCountProxy";
  250. this.labelCountProxy.Size = new Size(0x44, 0x13);
  251. this.labelCountProxy.TabIndex = 0x24;
  252. this.labelCountProxy.Text = "Прокси: 0";
  253. this.labelCountProxy.Theme = MetroThemeStyle.Dark;
  254. this.labelTextRabota.AutoSize = true;
  255. this.labelTextRabota.Location = new Point(0xf8, 0xab);
  256. this.labelTextRabota.Name = "labelTextRabota";
  257. this.labelTextRabota.Size = new Size(0x43, 0x13);
  258. this.labelTextRabota.TabIndex = 0x25;
  259. this.labelTextRabota.Text = "В работе:";
  260. this.labelTextRabota.Theme = MetroThemeStyle.Dark;
  261. this.labelCountVrabote.AutoSize = true;
  262. this.labelCountVrabote.Location = new Point(0x137, 0xab);
  263. this.labelCountVrabote.Name = "labelCountVrabote";
  264. this.labelCountVrabote.Size = new Size(0x10, 0x13);
  265. this.labelCountVrabote.TabIndex = 0x26;
  266. this.labelCountVrabote.Text = "0";
  267. this.labelCountVrabote.Theme = MetroThemeStyle.Dark;
  268. this.labelWait.AutoSize = true;
  269. this.labelWait.Location = new Point(0x19, 0xab);
  270. this.labelWait.Name = "labelWait";
  271. this.labelWait.Size = new Size(0x2f, 0x13);
  272. this.labelWait.TabIndex = 0x27;
  273. this.labelWait.Text = "Статус";
  274. this.labelWait.Theme = MetroThemeStyle.Dark;
  275. this.metroProgressBar1.Location = new Point(0x19, 0xc1);
  276. this.metroProgressBar1.Name = "metroProgressBar1";
  277. this.metroProgressBar1.Size = new Size(0x14f, 0x17);
  278. this.metroProgressBar1.TabIndex = 0x29;
  279. this.metroProgressBar1.Theme = MetroThemeStyle.Dark;
  280. this.metroButton4.ForeColor = SystemColors.ControlText;
  281. this.metroButton4.Location = new Point(0xb2, 0xe7);
  282. this.metroButton4.Name = "metroButton4";
  283. this.metroButton4.Size = new Size(0xb6, 0x17);
  284. this.metroButton4.TabIndex = 0x2a;
  285. this.metroButton4.Text = "Старт";
  286. this.metroButton4.Theme = MetroThemeStyle.Dark;
  287. this.metroButton4.UseSelectable = true;
  288. this.metroButton4.Click += new EventHandler(this.metroButton4_Click);
  289. this.Zriteli.AutoSize = true;
  290. this.Zriteli.Location = new Point(0xab, 0x10b);
  291. this.Zriteli.Name = "Zriteli";
  292. this.Zriteli.Size = new Size(0x3f, 0x13);
  293. this.Zriteli.TabIndex = 0x2b;
  294. this.Zriteli.Text = "Зрители:";
  295. this.Zriteli.Theme = MetroThemeStyle.Dark;
  296. this.Views.AutoSize = true;
  297. this.Views.Location = new Point(0xab, 0x11e);
  298. this.Views.Name = "Views";
  299. this.Views.Size = new Size(0x58, 0x13);
  300. this.Views.TabIndex = 0x2c;
  301. this.Views.Text = "Просмотров:";
  302. this.Views.Theme = MetroThemeStyle.Dark;
  303. this.Subs.AutoSize = true;
  304. this.Subs.Location = new Point(0xab, 0x131);
  305. this.Subs.Name = "Subs";
  306. this.Subs.Size = new Size(0x5e, 0x13);
  307. this.Subs.TabIndex = 0x2d;
  308. this.Subs.Text = "Подписчиков:";
  309. this.Subs.Theme = MetroThemeStyle.Dark;
  310. this.metroButton5.Location = new Point(0x19, 0x10b);
  311. this.metroButton5.Name = "metroButton5";
  312. this.metroButton5.Size = new Size(140, 0x39);
  313. this.metroButton5.TabIndex = 0x2e;
  314. this.metroButton5.Text = "Обновить статистику";
  315. this.metroButton5.Theme = MetroThemeStyle.Dark;
  316. this.metroButton5.UseSelectable = true;
  317. this.metroButton5.Click += new EventHandler(this.metroButton5_Click);
  318. this.metroLabel3.AutoSize = true;
  319. this.metroLabel3.Location = new Point(0x19, 0x164);
  320. this.metroLabel3.Name = "metroLabel3";
  321. this.metroLabel3.Size = new Size(80, 0x13);
  322. this.metroLabel3.TabIndex = 0x2f;
  323. this.metroLabel3.Text = "Текущий IP:";
  324. this.metroLabel3.Theme = MetroThemeStyle.Dark;
  325. this.metroRadioButton2.AutoSize = true;
  326. this.metroRadioButton2.Checked = true;
  327. this.metroRadioButton2.Location = new Point(0x19, 0x79);
  328. this.metroRadioButton2.Name = "metroRadioButton2";
  329. this.metroRadioButton2.Size = new Size(0x61, 15);
  330. this.metroRadioButton2.TabIndex = 0x30;
  331. this.metroRadioButton2.TabStop = true;
  332. this.metroRadioButton2.Text = "HTTP(s) Tasks";
  333. this.metroRadioButton2.Theme = MetroThemeStyle.Dark;
  334. this.metroRadioButton2.UseSelectable = true;
  335. this.metroRadioButton4.AutoSize = true;
  336. this.metroRadioButton4.Location = new Point(0x8e, 0x79);
  337. this.metroRadioButton4.Name = "metroRadioButton4";
  338. this.metroRadioButton4.Size = new Size(0x5d, 15);
  339. this.metroRadioButton4.TabIndex = 0x31;
  340. this.metroRadioButton4.Text = "HTTP(s) xNet";
  341. this.metroRadioButton4.Theme = MetroThemeStyle.Dark;
  342. this.metroRadioButton4.UseSelectable = true;
  343. this.metroRadioButton4.Visible = false;
  344. this.metroRadioButton5.AutoSize = true;
  345. this.metroRadioButton5.Location = new Point(0xf1, 0x79);
  346. this.metroRadioButton5.Name = "metroRadioButton5";
  347. this.metroRadioButton5.Size = new Size(0x6c, 15);
  348. this.metroRadioButton5.TabIndex = 50;
  349. this.metroRadioButton5.Text = "HARD METHOD";
  350. this.metroRadioButton5.Theme = MetroThemeStyle.Dark;
  351. this.metroRadioButton5.UseSelectable = true;
  352. this.metroRadioButton5.Visible = false;
  353. this.metroRadioButton6.AutoSize = true;
  354. this.metroRadioButton6.Location = new Point(0xf1, 0x89);
  355. this.metroRadioButton6.Name = "metroRadioButton6";
  356. this.metroRadioButton6.Size = new Size(0x87, 15);
  357. this.metroRadioButton6.TabIndex = 0x33;
  358. this.metroRadioButton6.Text = "HARD METHOD xNet";
  359. this.metroRadioButton6.Theme = MetroThemeStyle.Dark;
  360. this.metroRadioButton6.UseSelectable = true;
  361. this.metroRadioButton6.Visible = false;
  362. base.AutoScaleDimensions = new SizeF(6f, 13f);
  363. base.AutoScaleMode = AutoScaleMode.Font;
  364. base.ClientSize = new Size(0x17b, 0x180);
  365. base.Controls.Add(this.metroRadioButton6);
  366. base.Controls.Add(this.metroRadioButton5);
  367. base.Controls.Add(this.metroRadioButton4);
  368. base.Controls.Add(this.metroRadioButton2);
  369. base.Controls.Add(this.metroLabel3);
  370. base.Controls.Add(this.metroButton5);
  371. base.Controls.Add(this.Subs);
  372. base.Controls.Add(this.Views);
  373. base.Controls.Add(this.Zriteli);
  374. base.Controls.Add(this.metroButton4);
  375. base.Controls.Add(this.metroProgressBar1);
  376. base.Controls.Add(this.labelWait);
  377. base.Controls.Add(this.labelCountVrabote);
  378. base.Controls.Add(this.labelTextRabota);
  379. base.Controls.Add(this.labelCountProxy);
  380. base.Controls.Add(this.metroRadioButton3);
  381. base.Controls.Add(this.metroRadioButton1);
  382. base.Controls.Add(this.metroButton3);
  383. base.Controls.Add(this.metroButton1);
  384. base.Controls.Add(this.metroLabel2);
  385. base.Controls.Add(this.metroTextBox1);
  386. base.Controls.Add(this.richTextBox1);
  387. base.Controls.Add(this.listProxy);
  388. base.Controls.Add(this.numericUpDown1);
  389. base.Icon = (Icon) manager.GetObject("$this.Icon");
  390. base.Name = "TwitchView";
  391. base.Resizable = false;
  392. this.Text = "Twitch-зрители";
  393. base.Theme = MetroThemeStyle.Dark;
  394. base.Load += new EventHandler(this.TwitchView_Load);
  395. this.numericUpDown1.EndInit();
  396. base.ResumeLayout(false);
  397. base.PerformLayout();
  398. }
  399.  
  400. public string method_0(ref HttpWebRequest httpWebRequest0)
  401. {
  402. return new StreamReader(this.smethod_1(ref httpWebRequest0).GetResponseStream(), Encoding.UTF8, true).ReadToEnd();
  403. }
  404.  
  405. public void method_premium_http_Task()
  406. {
  407. while (this.labelWait.Text != "Стоп")
  408. {
  409. if (!Application.OpenForms[0].InvokeRequired)
  410. {
  411. new Task(new Action(this.method_premium_http_Task)).Start();
  412. return;
  413. }
  414. try
  415. {
  416. HttpWebRequest request = (HttpWebRequest) WebRequest.Create("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json");
  417. string input = this.Smethod0(ref request);
  418. if (input == null)
  419. {
  420. continue;
  421. }
  422. Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
  423. Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
  424. if (!match.Success || !match2.Success)
  425. {
  426. continue;
  427. }
  428. string str2 = match.Groups[1].Value;
  429. string str3 = match2.Groups[1].Value.Replace(@"\", "");
  430. string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
  431. HttpWebRequest request2 = (HttpWebRequest) WebRequest.Create(string.Concat(textArray1));
  432. string str4 = this.Smethod0(ref request2);
  433. MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
  434. if (matchs.Count == 0)
  435. {
  436. continue;
  437. }
  438. string requestUriString = matchs[0].Value;
  439. while (this.labelWait.Text != "Стоп")
  440. {
  441. HttpWebRequest request3 = (HttpWebRequest) WebRequest.Create(requestUriString);
  442. int0 = random0.Next(1, this.listProxy.Items.Count - 1);
  443. WebProxy proxy = new WebProxy(Conversions.ToString(this.listProxy.Items[int0]));
  444. request3.Proxy = proxy;
  445. string str6 = this.method_0(ref request3);
  446. if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
  447. {
  448. if (this.labelWait.Text == "Стоп")
  449. {
  450. break;
  451. }
  452. int count = matchs.Count;
  453. }
  454. }
  455. break;
  456. }
  457. catch (Exception exception1)
  458. {
  459. ProjectData.SetProjectError(exception1);
  460. ProjectData.ClearProjectError();
  461. continue;
  462. }
  463. }
  464. }
  465.  
  466. public void method_premium_http_thread()
  467. {
  468. while (this.labelWait.Text != "Стоп")
  469. {
  470. if (!Application.OpenForms[0].InvokeRequired)
  471. {
  472. new Thread(new ThreadStart(this.method_premium_http_thread)) { IsBackground = true }.Start();
  473. return;
  474. }
  475. try
  476. {
  477. HttpWebRequest request = (HttpWebRequest) WebRequest.Create("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json");
  478. string input = this.Smethod0(ref request);
  479. if (input == null)
  480. {
  481. continue;
  482. }
  483. Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
  484. Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
  485. if (!match.Success || !match2.Success)
  486. {
  487. continue;
  488. }
  489. string str2 = match.Groups[1].Value;
  490. string str3 = match2.Groups[1].Value.Replace(@"\", "");
  491. string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
  492. HttpWebRequest request2 = (HttpWebRequest) WebRequest.Create(string.Concat(textArray1));
  493. string str4 = this.Smethod0(ref request2);
  494. MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
  495. if (matchs.Count == 0)
  496. {
  497. continue;
  498. }
  499. string requestUriString = matchs[0].Value;
  500. while (this.labelWait.Text != "Стоп")
  501. {
  502. HttpWebRequest request3 = (HttpWebRequest) WebRequest.Create(requestUriString);
  503. int0 = random0.Next(1, this.listProxy.Items.Count - 1);
  504. WebProxy proxy = new WebProxy(Conversions.ToString(this.listProxy.Items[int0]));
  505. request3.Proxy = proxy;
  506. string str6 = this.method_0(ref request3);
  507. if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
  508. {
  509. if (this.labelWait.Text == "Стоп")
  510. {
  511. break;
  512. }
  513. int count = matchs.Count;
  514. }
  515. }
  516. break;
  517. }
  518. catch (Exception exception1)
  519. {
  520. ProjectData.SetProjectError(exception1);
  521. ProjectData.ClearProjectError();
  522. continue;
  523. }
  524. }
  525. }
  526.  
  527. public void method_premium_https_xNet()
  528. {
  529. while (this.labelWait.Text != "Стоп")
  530. {
  531. if (!Application.OpenForms[0].InvokeRequired)
  532. {
  533. new Thread(new ThreadStart(this.method_premium_https_xNet)) { IsBackground = true }.Start();
  534. return;
  535. }
  536. try
  537. {
  538. HttpRequest request = new HttpRequest();
  539. string input = request.Get("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json", null).ToString();
  540. if (input == null)
  541. {
  542. continue;
  543. }
  544. Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
  545. Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
  546. if (!match.Success || !match2.Success)
  547. {
  548. continue;
  549. }
  550. string str2 = match.Groups[1].Value;
  551. string str3 = match2.Groups[1].Value.Replace(@"\", "");
  552. request.Close();
  553. HttpRequest request2 = new HttpRequest();
  554. string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
  555. string str4 = request2.Get(string.Concat(textArray1), null).ToString();
  556. MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
  557. if (matchs.Count == 0)
  558. {
  559. continue;
  560. }
  561. string str5 = matchs[0].Value;
  562. request2.Close();
  563. while (this.labelWait.Text != "Стоп")
  564. {
  565. HttpRequest request3 = new HttpRequest();
  566. request3.set_Proxy(HttpProxyClient.Parse(Conversions.ToString(this.listProxy.Items[int0])));
  567. string str6 = request3.Get(str5, null).ToString();
  568. int0 = random0.Next(1, this.listProxy.Items.Count - 1);
  569. if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
  570. {
  571. if (this.labelWait.Text == "Стоп")
  572. {
  573. break;
  574. }
  575. if (matchs.Count != 1)
  576. {
  577. continue;
  578. }
  579. }
  580. request3.Close();
  581. }
  582. break;
  583. }
  584. catch (Exception exception1)
  585. {
  586. ProjectData.SetProjectError(exception1);
  587. ProjectData.ClearProjectError();
  588. continue;
  589. }
  590. }
  591. }
  592.  
  593. public void method_premium_socks_xNet()
  594. {
  595. while (this.labelWait.Text != "Стоп")
  596. {
  597. if (!Application.OpenForms[0].InvokeRequired)
  598. {
  599. new Thread(new ThreadStart(this.method_premium_socks_xNet)) { IsBackground = true }.Start();
  600. return;
  601. }
  602. try
  603. {
  604. HttpRequest request = new HttpRequest();
  605. string input = request.Get("https://api.twitch.tv/api/channels/" + this.metroTextBox1.Text.ToString() + "/access_token.json", null).ToString();
  606. if (input == null)
  607. {
  608. continue;
  609. }
  610. Match match = new Regex("\"sig\":\"(.*?)\"").Match(input);
  611. Match match2 = new Regex("\"token\":\"(.*?)\",\"sig\"").Match(input);
  612. if (!match.Success || !match2.Success)
  613. {
  614. continue;
  615. }
  616. string str2 = match.Groups[1].Value;
  617. string str3 = match2.Groups[1].Value.Replace(@"\", "");
  618. request.Close();
  619. HttpRequest request2 = new HttpRequest();
  620. string[] textArray1 = new string[] { "http://usher.twitch.tv", string12.ToString(), this.metroTextBox1.Text.ToString(), string13.ToString(), str3.ToString(), string16.ToString(), str2.ToString() };
  621. string str4 = request2.Get(string.Concat(textArray1), null).ToString();
  622. MatchCollection matchs = new Regex(@"(http|ftp|https):\/\/([\w\-_]+(?:(?:\.[\w\-_]+)+))([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])").Matches(str4);
  623. if (matchs.Count == 0)
  624. {
  625. continue;
  626. }
  627. string str5 = matchs[0].Value;
  628. request2.Close();
  629. while (this.labelWait.Text != "Стоп")
  630. {
  631. HttpRequest request3 = new HttpRequest();
  632. request3.set_Proxy(Socks5ProxyClient.Parse(Conversions.ToString(this.listProxy.Items[int0])));
  633. string str6 = request3.Get(str5, null).ToString();
  634. int0 = random0.Next(1, this.listProxy.Items.Count - 1);
  635. if ((str6 == null) || str6.Contains("#EXT-X-ENDLIST"))
  636. {
  637. if (this.labelWait.Text == "Стоп")
  638. {
  639. break;
  640. }
  641. if (matchs.Count != 1)
  642. {
  643. continue;
  644. }
  645. }
  646. request3.Close();
  647. }
  648. break;
  649. }
  650. catch (Exception exception1)
  651. {
  652. ProjectData.SetProjectError(exception1);
  653. ProjectData.ClearProjectError();
  654. continue;
  655. }
  656. }
  657. }
  658.  
  659. [AsyncStateMachine(typeof(<metroButton1_Click>d__16))]
  660. private void metroButton1_Click(object sender, EventArgs e)
  661. {
  662. <metroButton1_Click>d__16 d__;
  663. d__.<>4__this = this;
  664. d__.<>t__builder = AsyncVoidMethodBuilder.Create();
  665. d__.<>1__state = -1;
  666. d__.<>t__builder.Start<<metroButton1_Click>d__16>(ref d__);
  667. }
  668.  
  669. private void metroButton3_Click(object sender, EventArgs e)
  670. {
  671. try
  672. {
  673. this.labelCountProxy.Text = "Прокси: 0";
  674. this.listProxy.Items.Clear();
  675. OpenFileDialog dialog = new OpenFileDialog();
  676. dialog.ShowDialog();
  677. if (dialog.FileName != null)
  678. {
  679. List<string> list = new List<string>();
  680. using (StreamReader reader = new StreamReader(dialog.FileName))
  681. {
  682. while (reader.Peek() != -1)
  683. {
  684. list.Add(reader.ReadLine());
  685. }
  686. }
  687. foreach (string str in File.ReadAllLines(dialog.FileName))
  688. {
  689. this.listProxy.Items.Add(str);
  690. }
  691. this.labelCountProxy.Text = "Прокси: " + Conversions.ToString(this.listProxy.Items.Count);
  692. }
  693. }
  694. catch
  695. {
  696. }
  697. }
  698.  
  699. private void metroButton4_Click(object sender, EventArgs e)
  700. {
  701. try
  702. {
  703. if (this.metroButton4.Text == "Старт")
  704. {
  705. if (this.metroTextBox1.Text == "")
  706. {
  707. Interaction.MsgBox("Введите имя канала", MsgBoxStyle.Information, null);
  708. }
  709. else if (this.listProxy.Items.Count == 0)
  710. {
  711. Interaction.MsgBox("Загрузите прокси-лист", MsgBoxStyle.Information, null);
  712. }
  713. else if (this.metroButton4.Text == "Старт")
  714. {
  715. this.labelWait.Text = "Работаем...";
  716. this.metroTextBox1.Text = this.metroTextBox1.Text.ToLower();
  717. this.metroTextBox1.Text = Strings.Replace(this.metroTextBox1.Text, Strings.Space(1), Strings.Space(0), 1, -1, CompareMethod.Binary);
  718. this.metroButton4.Text = "Стоп";
  719. this.timer1.Start();
  720. }
  721. }
  722. else
  723. {
  724. this.labelWait.Text = "Стоп";
  725. this.listProxy.Items.Clear();
  726. this.labelCountVrabote.Text = "0";
  727. this.labelCountProxy.Text = "Прокси: 0";
  728. this.metroProgressBar1.Value = 0;
  729. this.timer1.Stop();
  730. this.metroButton4.Text = "Старт";
  731. }
  732. }
  733. catch
  734. {
  735. }
  736. }
  737.  
  738. private void metroButton5_Click(object sender, EventArgs e)
  739. {
  740. try
  741. {
  742. string input = new StreamReader(((HttpWebResponse) ((HttpWebRequest) WebRequest.Create("https://api.twitch.tv/kraken/streams/" + this.metroTextBox1.Text)).GetResponse()).GetResponseStream()).ReadToEnd();
  743. foreach (Match match in new Regex("followers\":([0-9]{1,23}.*?)").Matches(input))
  744. {
  745. char[] separator = new char[] { ':' };
  746. this.Subs.Text = "Подписчиков: " + match.ToString().Split(separator)[1];
  747. }
  748. foreach (Match match2 in new Regex("views\":([0-9]{1,33}.*?)").Matches(input))
  749. {
  750. char[] chArray2 = new char[] { ':' };
  751. this.Views.Text = "Просмотров: " + match2.ToString().Split(chArray2)[1];
  752. }
  753. foreach (Match match3 in new Regex("viewers\":([0-9]{1,23}.*?)").Matches(input))
  754. {
  755. char[] chArray3 = new char[] { ':' };
  756. this.Zriteli.Text = "Зрителей: " + match3.ToString().Split(chArray3)[1];
  757. }
  758. }
  759. catch
  760. {
  761. }
  762. }
  763.  
  764. public HttpWebResponse smethod_1(ref HttpWebRequest httpWebRequest_0)
  765. {
  766. HttpWebResponse response;
  767. try
  768. {
  769. httpWebRequest_0.Method = "GET";
  770. response = (HttpWebResponse) httpWebRequest_0.GetResponse();
  771. }
  772. catch (Exception exception1)
  773. {
  774. ProjectData.SetProjectError(exception1);
  775. response = null;
  776. ProjectData.ClearProjectError();
  777. }
  778. return response;
  779. }
  780.  
  781. public string Smethod0(ref HttpWebRequest httpWebRequest0)
  782. {
  783. return new StreamReader(this.smethod_1(ref httpWebRequest0).GetResponseStream(), Encoding.UTF8, true).ReadToEnd();
  784. }
  785.  
  786. private void timer1_Tick(object sender, EventArgs e)
  787. {
  788. if (Conversions.ToInteger(this.labelCountVrabote.Text) >= Convert.ToInt32(this.numericUpDown1.Value))
  789. {
  790. this.timer1.Stop();
  791. }
  792. else
  793. {
  794. if (this.metroRadioButton1.Checked)
  795. {
  796. this.method_premium_http_thread();
  797. this.listProxy.SelectedIndex++;
  798. this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
  799. this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
  800. this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
  801. }
  802. if (this.metroRadioButton2.Checked)
  803. {
  804. this.method_premium_http_Task();
  805. this.listProxy.SelectedIndex++;
  806. this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
  807. this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
  808. this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
  809. }
  810. if (this.metroRadioButton3.Checked)
  811. {
  812. this.method_premium_socks_xNet();
  813. this.listProxy.SelectedIndex++;
  814. this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
  815. this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
  816. this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
  817. }
  818. if (this.metroRadioButton4.Checked)
  819. {
  820. this.method_premium_https_xNet();
  821. this.listProxy.SelectedIndex++;
  822. this.labelCountVrabote.Text = Conversions.ToString(this.listProxy.SelectedIndex);
  823. this.metroProgressBar1.Maximum = (int) this.numericUpDown1.Value;
  824. this.metroProgressBar1.Value = int.Parse(this.labelCountVrabote.Text);
  825. }
  826. }
  827. }
  828.  
  829. private void TwitchView_Load(object sender, EventArgs e)
  830. {
  831. ServicePointManager.DefaultConnectionLimit = 0x989680;
  832. Control.CheckForIllegalCrossThreadCalls = false;
  833. this.metroButton1.Text = "N/A";
  834. this.metroButton1.Enabled = false;
  835. this.authT1000();
  836. }
  837.  
  838. [CompilerGenerated]
  839. private struct <metroButton1_Click>d__16 : IAsyncStateMachine
  840. {
  841. public int <>1__state;
  842. public TwitchView <>4__this;
  843. public AsyncVoidMethodBuilder <>t__builder;
  844. private TaskAwaiter<string> <>u__1;
  845. private string <line>5__1;
  846.  
  847. private void MoveNext()
  848. {
  849. int num = this.<>1__state;
  850. try
  851. {
  852. TaskAwaiter<string> awaiter;
  853. if (num != 0)
  854. {
  855. this.<>4__this.labelCountProxy.Text = "Прокси: 0";
  856. this.<>4__this.listProxy.Items.Clear();
  857. awaiter = new HttpClient().GetStringAsync("http://54.93.197.218/proxies/http_list.txt").GetAwaiter();
  858. if (!awaiter.IsCompleted)
  859. {
  860. this.<>1__state = num = 0;
  861. this.<>u__1 = awaiter;
  862. this.<>t__builder.AwaitUnsafeOnCompleted<TaskAwaiter<string>, TwitchView.<metroButton1_Click>d__16>(ref awaiter, ref this);
  863. return;
  864. }
  865. }
  866. else
  867. {
  868. awaiter = this.<>u__1;
  869. this.<>u__1 = new TaskAwaiter<string>();
  870. this.<>1__state = num = -1;
  871. }
  872. string result = awaiter.GetResult();
  873. awaiter = new TaskAwaiter<string>();
  874. StringReader reader = new StringReader(result);
  875. while ((this.<line>5__1 = reader.ReadLine()) != null)
  876. {
  877. this.<>4__this.listProxy.Items.Add(this.<line>5__1);
  878. }
  879. this.<>4__this.labelCountProxy.Text = "Прокси: " + Conversions.ToString(this.<>4__this.listProxy.Items.Count);
  880. }
  881. catch (Exception exception)
  882. {
  883. this.<>1__state = -2;
  884. this.<>t__builder.SetException(exception);
  885. return;
  886. }
  887. this.<>1__state = -2;
  888. this.<>t__builder.SetResult();
  889. }
  890.  
  891. [DebuggerHidden]
  892. private void SetStateMachine(IAsyncStateMachine stateMachine)
  893. {
  894. this.<>t__builder.SetStateMachine(stateMachine);
  895. }
  896. }
  897. }
  898. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement