ich habe folgendes Problem mit meinen Youtube Bot, der Bot hat eine Abo, Comment und eine Dis-/Like Die nicht Funktioniert ich habe schon alles auf Fehlern abgesucht jedoch erfolglos.. Ich bitte deshalb hier um Hilfe..
LGC
Code von der Dis-/Like Funktion:
IMPORTS:
Code:
Imports Google.GData.Client Imports Google.GData.Extensions Imports Google.GData.YouTube Imports Google.GData.Extensions.MediaRss Imports Google.YouTube Imports System.Text.RegularExpressions Imports System.Runtime.InteropServices Imports System.IO Imports System.Net Imports System.Text Imports System.Reflection
Code:
#Region "Like/Dislike" Private Sub setLikeStatus(ByVal msg As String, ByVal color As Color) Label8.ForeColor = color Label8.Text = msg End Sub Dim likes As Integer = 0 Dim liking As Boolean = False Private Sub likeDislike(ByVal obj As Object) Dim objSplit() As String = Split(obj(0)) Dim videourl As String = objSplit(1) Dim rating As Integer = 0 If objSplit(0) = "[Like]" Then rating = 5 Else rating = 1 End If Try Dim settings As New YouTubeRequestSettings(applicationName, developverKey, obj(1), obj(2)) Dim request As New YouTubeRequest(settings) Dim videoEntryUrl As New Uri("http://gdata.youtube.com/feeds/api/videos/" + videourl) Dim video As Video = request.Retrieve(Of Video)(videoEntryUrl) Dim responses As Feed(Of Video) = request.GetResponseVideos(video) video.Rating = rating request.Insert(video.RatingsUri, video) likes += 1 Catch Me.Invoke(New Listbox1RemoveDelete(AddressOf Listbox1Remove), obj(1)) Me.Invoke(New Listbox2AddDelete(AddressOf Listbox2Add), obj(1)) End Try threads -= 1 End Sub Private Sub likeDislikeFirstFromList(ByVal videourl As String) NumericUpDown2.Enabled = False Dim before As Date = Now For i As Integer = 0 To NumericUpDown2.Value - 1 wait: Application.DoEvents() If threads < maxThreads Then Dim t As New Threading.Thread(AddressOf likeDislike) t.Start({videourl, accounts(i).username, accounts(i).password}) threads += 1 Else Threading.Thread.Sleep(10) setLikeStatus("(Dis-)liking.. [" + likes.ToString + "/" + NumericUpDown2.Value.ToString + "]", Color.Orange) GoTo wait End If Next Do Application.DoEvents() Threading.Thread.Sleep(10) setLikeStatus("(Dis-)liking.. [" + likes.ToString + "/" + NumericUpDown2.Value.ToString + "]", Color.Orange) Loop Until threads = 0 setLikeStatus(likes.ToString + "/" + NumericUpDown2.Value.ToString + " within " + DateDiff(DateInterval.Second, before, Now).ToString + " seconds.", Color.Green) likes = 0 NumericUpDown2.Enabled = True End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If TextBox2.Text = "" Then Exit Sub End If Dim videoUrl As String = TextBox2.Text videoUrl = Replace(videoUrl, "http://www.youtube.com/watch?v=", "") Dim featureSplit() As String = Split(videoUrl, "&") videoUrl = featureSplit(0) If ComboBox1.Text = "Like" Then videoUrl = "[Like] " + videoUrl Else videoUrl = "[Dislike] " + videoUrl End If ListBox4.Items.Add(videoUrl) TextBox2.Text = "" End Sub #End Region