« Previous entry | Next entry » Browse > Bad code
Skip to comments (1)
youtube bot
Posted by guest on Aug 29 2009 @ 00:21 :: 862 unique visits
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Controls;
using System.Data;
using System.Net;
using System.IO;
using System.ComponentModel;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Threading;
using System.Collections.Specialized;
namespace Youtube_Raper
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
public int currentitem1 = 0;
public int currentitem2 = 0;
public int commentCount = 0;
public int currAccount = 0;
public AddItem frm1;
public Settings settings;
public PostSubmitter submitter;
public string unique = \"\";
private bool canceled = false;
private void button1_Click(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
}
private void listView1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (listView1.GetItemAt(e.X, e.Y) != null)
listView1.GetItemAt(e.X, e.Y).Selected = true;
}
}
private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
{
if (listView1.SelectedItems != null)
{
foreach (System.Windows.Forms.ListViewItem lvi in listView1.SelectedItems)
lvi.Remove();
}
if (listView2.SelectedItems != null)
{
foreach (System.Windows.Forms.ListViewItem lvi1 in listView2.SelectedItems)
lvi1.Remove();
}
}
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void newItemToolStripMenuItem_Click(object sender, EventArgs e)
{
AddItem frm1 = new AddItem();
frm1.frm2 = this;
frm1.Show();
}
private void statusStrip1_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
}
private void settingsToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private void uniquePhraseToolStripMenuItem_Click(object sender, EventArgs e)
{
Settings settings = new Settings();
settings.frm2 = this;
settings.Show();
}
private void newItemToolStripMenuItem1_Click(object sender, EventArgs e)
{
}
private void toolStripStatusLabel2_Click(object sender, EventArgs e)
{
}
private void startToolStripMenuItem_Click(object sender, EventArgs e)
{
commentPost.Start();
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
}
private void backgroundWorker2_DoWork(object sender, DoWorkEventArgs e)
{
}
private string[] Match(string src, string begin, string end)
{
Regex reg = new Regex(Regex.Escape(begin) + \"(.*?)\" + Regex.Escape(end), System.Text.RegularExpressions.RegexOptions.Singleline);
MatchCollection matches = reg.Matches(src);
string[] values = new string[matches.Count];
for (int i = 0; i < matches.Count; i++)
{
values = matches[i].Value.Replace(begin, \"\").Replace(end, \"\");
}
return values;
}
private bool Login(string username, string password, ref CookieContainer cookies)
{
try
{
PostSubmitter submitter = new PostSubmitter(\"https://www.google.com/accounts/ServiceLogin?service=youtube&hl=en_US&passive=true<mpl=sso&uilel=3&continue=http%3A//www.youtube.com/signup%3Fhl%3Den_US%26warned%3D%26nomobiletemp%3D1%26next%3D/index\");
submitter.Type = PostSubmitter.PostTypeEnum.Get;
submitter.Cookies = new CookieContainer();
string src = submitter.Post();
string str2 = this.Match(src, \"name=\\\"GALX\\\"\\n value=\\\"\", \"\\\"\")[0];
PostSubmitter submitter2 = new PostSubmitter(\"https://www.google.com/accounts/ServiceLoginAuth?service=youtube\");
submitter2.Type = PostSubmitter.PostTypeEnum.Post;
submitter2.Cookies = submitter.Cookies;
submitter2.PostItems.Add(\"ltmpl\", \"sso\");
submitter2.PostItems.Add(\"continue\", \"http://www.youtube.com/signup?hl=en_US&warned=&nomobiletemp=1&next=/index\");
submitter2.PostItems.Add(\"service\", \"youtube\");
submitter2.PostItems.Add(\"uilel\", \"3\");
submitter2.PostItems.Add(\"ltmpl\", \"sso\");
submitter2.PostItems.Add(\"hl\", \"en_US\");
submitter2.PostItems.Add(\"ltmpl\", \"sso\");
submitter2.PostItems.Add(\"GALX\", str2);
submitter2.PostItems.Add(\"Email\", username);
submitter2.PostItems.Add(\"Passwd\", password);
submitter2.PostItems.Add(\"rmShown\", \"1\");
submitter2.PostItems.Add(\"signIn\", \"Sign in\");
submitter2.PostItems.Add(\"asts\", \"\");
src = submitter2.Post();
PostSubmitter submitter3 = new PostSubmitter(this.Match(src, \"url='\", \"'\")[0].Replace(\"&\", \"&\"));
submitter3.Type = PostSubmitter.PostTypeEnum.Get;
submitter3.Cookies = submitter2.Cookies;
if (submitter3.Post().Contains(\"a href=\\\"/my_account\\\"\"))
{
cookies = submitter3.Cookies;
return true;
}
return false;
}
catch
{
return false;
}
}
private bool PostComment(string url, string comment, ref CookieContainer cookies, ref bool doublecheck)
{
PostSubmitter post = new PostSubmitter(url);
post.Type = PostSubmitter.PostTypeEnum.Get;
post.Cookies = cookies;
string result = post.Post();
cookies = post.Cookies;
if (result.Contains(unique))
{
doublecheck = true;
return true;
}
string sessToken = Match(result, \"name=\\\"session_token\\\" value=\\\"\", \"\\\"\")[0];
string videoId = Match(result, \"video_id=\", \"&\")[0];
PostSubmitter post2 = new PostSubmitter(\"http://www.youtube.com/comment_servlet?add_comment=1&comment_type=V\");
post2.Type = PostSubmitter.PostTypeEnum.Post;
post2.Cookies = cookies;
post2.PostItems.Add(\"video_id\", videoId);
post2.PostItems.Add(\"form_id\", \"comment_formmain_comment\");
post2.PostItems.Add(\"reply_parent_id\", \"\");
post2.PostItems.Add(\"comment\", comment);
post2.PostItems.Add(\"preview_comment_button\", \"Audio Preview\");
post2.PostItems.Add(\"add_comment_button\", \"Post Comment\");
post2.PostItems.Add(\"discard_comment_button\", \"Discard\");
if (post2.Post().Contains(\"OK\"))
{
cookies = post2.Cookies;
return true;
}
else
{
return false;
}
}
private void newItemToolStripMenuItem_Click_1(object sender, EventArgs e)
{
}
private void importSettingsToolStripMenuItem_Click(object sender, EventArgs e)
{
}
private string GetPage(string url, ref CookieContainer cookies)
{
try
{
PostSubmitter submitter = new PostSubmitter(url);
submitter.Type = PostSubmitter.PostTypeEnum.Get;
submitter.Cookies = cookies;
return submitter.Post();
}
catch (Exception exception)
{
System.Windows.MessageBox.Show(exception.Message);
return this.unique;
}
}
private void commentPost_Tick(object sender, EventArgs e)
{
commentPost.Stop();
string url = listView1.Items[commentCount].Text;
string comment = listView1.Items[commentCount].SubItems[1].Text;
MonitorUrl(url, comment);
}
private void MonitorUrl(string url, string comment)
{
string username = listView2.Items[currAccount].Text;
string password = listView2.Items[currAccount].SubItems[1].Text;
Action method = null;
CookieContainer cookies = new CookieContainer();
while (true)
{
cookies = new CookieContainer();
if (!this.GetPage(url, ref cookies).Contains(this.unique))
{
try
{
username = listView2.Items[currAccount].Text;
password = listView2.Items[currAccount].SubItems[1].Text;
}
catch
{
return;
}
if (this.Login(username, password, ref cookies))
{
bool doublecheck = false;
if (this.PostComment(url, comment, ref cookies, ref doublecheck))
{
if (!doublecheck)
{
this.commentCount++;
if (method == null)
{
method = delegate
{
this.toolStripStatusLabel2.Text = this.commentCount.ToString();
};
}
}
}
else
{
this.currAccount++;
}
}
else
{
this.currAccount++;
}
}
Thread.Sleep(0x493e0);
if (this.canceled)
{
return;
}
}
}
private void addAccountToolStripMenuItem_Click(object sender, EventArgs e)
{
AddItem frm1 = new AddItem();
frm1.frm2 = this;
frm1.Show();
}
private void uRLCommentToolStripMenuItem_Click(object sender, EventArgs e)
{
AddItem frm1 = new AddItem();
frm1.frm2 = this;
frm1.Show();
}
}
}
1. On Jan 05 2010 @ 15:37 uggbaileybutton wrote:
bailey button uggs-ugg boots cheap
ugg boots uk
ugg classic