Hack Forums
[.NET] (TuT)Youtube login with multiple accounts using youtube api(TuT) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] (TuT)Youtube login with multiple accounts using youtube api(TuT) (/showthread.php?tid=1629561)



(TuT)Youtube login with multiple accounts using youtube api(TuT) - Turmoil - Aug 20, 2011

Imports:
Code
Imports Google.GData.Client
Imports Google.GData.Extensions
Imports Google.GData.YouTube
Imports Google.GData.YouTube.YouTubeService
Imports Google.GData.Extensions.MediaRss
Imports Google.YouTube
Imports System.Management
Imports System.Net
Imports System.IO
Imports System.Text
Imports Microsoft.VisualBasic.CompilerServices
Imports System.Threading
Imports System.Text.RegularExpressions
Imports Google.GData.YouTube.SubscriptionEntry

Importing Accounts:
Code
Dim accounts as string
Sub importaccounts
Dim ofd as new openfiledialog - OFD is now open file dialog
accounts = ofd.filename - It will put all the text in the .txt file into the string accounts
If accounts <> "" then - If the transfer was successful
Messagebox.show("Accounts imported successfully")
End if
End sub

Logging in:
Code
Sub login()
       Dim splitz as string
        Dim arrayz As String() = File.ReadAllLines(accounts)
        For Each splitz In arrayz


            Dim settings As YouTubeRequestSettings = New YouTubeRequestSettings("BOTNAME", "APIKEY", Conversions.ToString(user(splitz)), Conversions.ToString(pass(splitz)))
            Dim request As YouTubeRequest = New YouTubeRequest(settings)
        Next

    End Sub

Splitting Functions:
Code
Public function user(byval thing as string)
return thing.substring(0, thing.indexof(":"))
End Function

Public function pass(byval thing as string)
return thing.substring((thing.indexof(":") + 1), ((thing.length - thing.indexof(":") - 1))

You will need to import the accounts from a text file with the following format:

Account:Password

You can change it accordingly to the splitting functions


* - Doctor07 - Aug 20, 2011

Very nice dude, This is the first Tutorial/Guide I've seen by somebody with the ability to work with API's.

Nice one buddy.


* - Turmoil - Aug 20, 2011

Thank you man, appreciate the nice comment ;D


* - bckc - Aug 21, 2011

I get 7 import errors like this:

Warning 7 Namespace or type specified in the Imports 'Google.GData.YouTube.SubscriptionEntry' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. C:\****\****\AppData\Local\Temporary Projects\YTB\Form1.vb 14 9 *



* - *.dll - Aug 21, 2011

did you added References i guess you didnt... there are references:
http://www.mediafire.com/?si1qh1h86qa8uub

I hope you know how to import it to a project :)


* - PURP - Aug 21, 2011

You could of saved a lot of time by doing this.
PHP Code

<?php 
Dim str
() As String = Split(ListBox1.SelectedItem.ToString(), ":")

Sub login()
     
Dim settings As YouTubeRequestSettings = New YouTubeRequestSettings("BOTNAME", "APIKEY", str(0), str(1))
    
Dim request As YouTubeRequest = New YouTubeRequest(settings)
    
End Sub 



* - Zincco - Aug 21, 2011

Code
Dim accounts as string
Sub importaccounts
Dim ofd as new openfiledialog - OFD is now open file dialog
accounts = ofd.filename - It will put all the text in the .txt file into the string accounts
If accounts <> "" then - If the transfer was successful
Messagebox.show("Accounts imported successfully")
End if
End sub
You didn't even show the openfiledialog...? and I assume that you should actually read the contents of the .txt file, you only got the path :P


* - Turmoil - Aug 21, 2011

(Aug 21, 2011 09:41 AM)Zincco Wrote:  
Code
Dim accounts as string
Sub importaccounts
Dim ofd as new openfiledialog - OFD is now open file dialog
accounts = ofd.filename - It will put all the text in the .txt file into the string accounts
If accounts <> "" then - If the transfer was successful
Messagebox.show("Accounts imported successfully")
End if
End sub
You didn't even show the openfiledialog...? and I assume that you should actually read the contents of the .txt file, you only got the path :P
My bad, i wrote it while making the thread.
You should know how to do it.
ofd.showdialog
And thats why accounts = ofd.filename is there =]

@Dim str() As String = Split(ListBox1.SelectedItem.ToString(), ":")
That won't even work, first of all you're not selecting from a listbox, secondly, if that were to be the scenario it would only grab the username.

If you guys are complaining for such easy fixes please don't use this.


* - ★☆✰ Matto ✰☆★ - Aug 25, 2011

Captcha handling? o_O If the account is valid but needs a captcha code....?


* - Kaliman - Aug 26, 2011

Invalid or Deleted File.

The key you provided for file download was invalid. This is usually caused because the file is no longer stored on Mediafire. This occurs when the file is removed by the originating user or Mediafire.
If you believe you have reached this page in error, please contact


* - *.dll - Aug 30, 2011

And what if account is wrong ? i think application will show framework error lol...


* - Positive - Sep 1, 2011

Nice released dude.
Fer real.
If I did youtube, I would use this, but sadly I don't.
Sorry man. But thanks for it anyway.

-- Positive --


* - Turmoil - Sep 1, 2011

THank you very much bro !!!
You're so HQ and nice, best member <3


* - Nicrands - Sep 2, 2011

thanks you so much :D
if something worng i will ask you... :)


* - -DMT- - Sep 2, 2011

wow thank you I think you should make a programm for it I meen you got the skrip .... why not ?