![]() |
|
[.NET] [Tutorial] How To Use Youtube Api [Tutorial][ Create your own Bot ] - 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] [Tutorial] How To Use Youtube Api [Tutorial][ Create your own Bot ] (/showthread.php?tid=2519154) Pages: Pages
1
2
|
[Tutorial] How To Use Youtube Api [Tutorial][ Create your own Bot ] - Lambasoft - May 23, 2012 Greetings HackForums I just made a Youtube API bot, it was fun to make.You can check my bot HERE. It's your turn now. Before getting started you should know some basics and definitions. What's API ? Application Programming Interface. A language and message format used by an application program to communicate with the operating system or some other control program such as a database management system (DBMS) or communications protocol. APIs are implemented by writing function calls in the program, which provide the linkage to the required subroutine for execution. Read More HereYouTube Data API The YouTube Data API allows client applications to retrieve and update YouTube content in the form of Google Data API feeds. Your client application can use the YouTube Data API to fetch video feeds, comments, responses, and playlists, as well as query for videos that match particular criteria. You can also use the API to make authenticated requests to modify this information and to upload new video content to the site. Read More HerePreparations We first need to install the Google Data Libraries. Head up to http://code.google.com/p/google-gdata/downloads/list then download and install the latest version ( Google_Data_API_Setup_2.0.1.0.msi ). Once done go to http://code.google.com/apis/youtube/dashboard/ ( you need a Gmail for this ) and get yourself an API key.Getting Started Open a New VB.net Project and add Google.GData.Client.dll, Google.GData.Extensions.dll, Google.GData.YouTube.dll to the references they are located where you installed the Libraries( mine were in C:\Program Files\Google\Google Data API SDK\Samples )Step 1 Import the libraries to your project : Code Imports Google.GData.ClientStep 2 We should authenticate our account by adding our credentials settings, the key you made before. Code Dim Settings As YouTubeRequestSettingsStep 3 After we declared ourselves to the API it's time to define the YT (YouTube) video we will be using. Code Dim VideoUri As UriDefine Uri : Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI. Read more About Uri Video ID : Let's take http://www.youtube.com/watch?v=cPi85qp-V1A as example. The Video ID is cPi85qp-V1A Step 4 Step 3 was the final step in the authentication, the funny parts can now get started.To Like (Rate) a Video: Code TheVideo.Rating = 5;To Dislike a Video: Code TheVideo.Rating = 1;To Retrieve video comments: Code Dim comments = request.GetComments(TheVideo)To Add video comment: Code Dim c As Comment = New Comment()To Subscribe to a Video channel: Code Dim s As Subscription = New SubscriptionTo Subscribe to a Video channel: Code Dim s As Subscription = New SubscriptionTo Add a Video as Favorite: Code Dim videoEntryUrl As String = "http://gdata.youtube.com/feeds/api/videos/" + "Video ID"To Remove a Video as Favorite: Code Dim videoEntryUrl As String = "http://gdata.youtube.com/feeds/api/videos/" + "Video ID"To Flagg a Video: Code Dim c As Complaint = New ComplaintWell these are the most basic things you can do, to learn more go to https://developers.google.com/youtube/2.0/developers_guide_dotnet and let me know if you need any help converting the code language Enjoy and don't forget to say thanks
* - ytlayol - May 23, 2012 very nice..appreciate your effort sir!!! * - Lambasoft - May 23, 2012 (May 23, 2012 12:24 AM)loyalty Wrote: very nice..appreciate your effort sir!!! Thanks loyalty Yeah that took me a while to do ^^ but it's totally worth it * - idb. - May 23, 2012 You should write an API key creator to go along with this since the YT API is basically useless without 239462934692364982364 API keys. Well... unless you are OK with every account you use getting suspended due to abuse of the API. * - Lambasoft - May 23, 2012 (May 23, 2012 03:43 AM)idb Wrote: You should write an API key creator to go along with this since the YT API is basically useless without 239462934692364982364 API keys. Well... unless you are OK with every account you use getting suspended due to abuse of the API. Wait a second ... so if i change the API on every command execution ( like/comment/subscribe..) the accounts wont get banned ?? * - idb. - May 23, 2012 (May 23, 2012 04:25 AM)Lambasoft Wrote: Wait a second ... so if i change the API on every command execution ( like/comment/subscribe..) the accounts wont get banned ?? No... but if you use the same API key across multiple accounts and for abusive purposes (aka a bot) your accounts will get banned quick as fuck. Use 1 API key per account and ONLY use that key for that specific account. You can't just interchange API keys during a session either... you need to auth using the key before you can do anything. Super gay. Every action you make when using an API key is logged. When that key raises suspicion of foul play guess what information is available for YT to see? Every account that has used that API key. Then guess what happens? API key = suspended and accounts = disabled. This is why using API's for anything involving a bot that is against the TOS is pretty retarded. Just use the regular site. I realize that sounds a bit scary due to the fact that YT constantly updates (at a pretty annoying rate to be honest), but what's more annoying... updating a few lines of code or having all of your accounts and API keys drop at the same time? Why do you think that every source I release having to do with shit like this uses the actual websites instead of API keys? API keys are just another unnecessary step in the process. API are also just a good way to get your proxies blacklisted, accounts killed, and yourself tracked down. Just my 2 cents. * - Lambasoft - May 23, 2012 (May 23, 2012 04:33 AM)idb Wrote: No... but if you use the same API key across multiple accounts and for abusive purposes (aka a bot) your accounts will get banned quick as fuck. Use 1 API key per account and ONLY use that key for that specific account. Totally right with this, i never though about my API's account getting banned all i cared of was not banning the fake accounts ( the funniest thing is that i'm using my main account XD ) I guess i should fix this ASAP , and i do think i might use your classes for this ^^ One problem persist, how to correctly create to accounts. * - txzonline - Aug 19, 2012 pretty nice find on that tutorial. nice tut. likes your tutorial lol. nicely done. * - Dark_Noodles - Aug 21, 2012 It really sucks that this thread dies. It's a well made thread! * - Percocet - Aug 21, 2012 Thanks for this, now I can create my own Youtube bot. * - Data Center - Sep 21, 2012 awsome posting keep it up bro , iv bookmarked this for ever and ever * - c0ffee - Sep 26, 2012 This is a quality post, I woukld +rep you if I could. * - c0ffee - Sep 27, 2012 I have a question: Does youtube add a view to the counter if you only let the code run to this point: Code Dim VideoUri As UriWhat does this line of code do? Does it grant you access to the video's commands/database/functions/etc, or does it really load the video to your computer and let it count as a view? Regards, c0ffee * - ΜTN© - Sep 27, 2012 Cool tut keep the good work are you giving the source out? * - Shane33 - Jan 1, 2013 It is barelly old threat. But i need to ask. Is this BOT still working? i have got error here: Code dVideo = request.Retrieve(Of Video)(VideoFeedUri) |