IIMyErenII Posted May 23, 2015 Share Posted May 23, 2015 Merhabalar, Normalde api v2 ile kolayca youtube araması yapabiliyordum.Ama youtube v2 leri kapatmış ve v3 geçmiş birçok şey değiişmiş tek istediğim youtube araması yapmak.Yardımcı olursanız çok sevinirim. Quote Link to comment Share on other sites More sharing options...
galetis Posted May 23, 2015 Share Posted May 23, 2015 https://developers.google.com/youtube/v3/code_samples/dotnet - Search by keyword Quote Link to comment Share on other sites More sharing options...
IIMyErenII Posted May 23, 2015 Author Share Posted May 23, 2015 https://developers.google.com/youtube/v3/code_samples/dotnet - Search by keyword Hocam baktım onlara ama olmuyor hemde consol uygulaması bana form lazım.Örnek proje atan olursa sevinirim. Quote Link to comment Share on other sites More sharing options...
Editor pairs Posted May 23, 2015 Editor Share Posted May 23, 2015 Hocam baktım onlara ama olmuyor hemde consol uygulaması bana form lazım.Örnek proje atan olursa sevinirim. Console uygulamasındaki C# ile Formdaki C# farklı şeylermi onu anlayamadım ben :D Quote Link to comment Share on other sites More sharing options...
galetis Posted May 23, 2015 Share Posted May 23, 2015 https://github.com/youtube/api-samples - https://github.com/youtube/api-samples/blob/master/dotnet/Google.Apis.YouTube.Samples.Search/Search.cs Konsol projesi olarak github üzerinde var, diğer dillerde var. Kolay gelsin. Quote Link to comment Share on other sites More sharing options...
KintaRo Posted May 24, 2015 Share Posted May 24, 2015 ben de ufak bir örnek hazırladım: [spoiler] using Google.Apis.Services; using Google.Apis.YouTube.v3; using System; using System.Collections.Generic; using System.Windows.Forms; namespace Youtube_Search_API { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Run(string aranan) { var youtubeService = new YouTubeService(new BaseClientService.Initializer() { ApiKey = "AIzaSyCY7Gw6BaCL6rGvsewEwBjhE_BkKVJyXXg", ApplicationName = this.GetType().ToString() }); var searchListRequest = youtubeService.Search.List("snippet"); searchListRequest.Q = aranan; // Replace with your search term. searchListRequest.MaxResults = 50; // Call the search.list method to retrieve results matching the specified query term. var searchListResponse = searchListRequest.Execute(); List<string> videos = new List<string>(); List<string> channels = new List<string>(); List<string> playlists = new List<string>(); // Add each result to the appropriate list, and then display the lists of // matching videos, channels, and playlists. foreach (var searchResult in searchListResponse.Items) { switch (searchResult.Id.Kind) { case "youtube#video": videos.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.VideoId)); break; case "youtube#channel": channels.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.ChannelId)); break; case "youtube#playlist": playlists.Add(String.Format("{0} ({1})", searchResult.Snippet.Title, searchResult.Id.PlaylistId)); break; } } foreach (string item in videos) listView1.Items.Add(item); foreach (string item in channels) listView2.Items.Add(item); foreach (string item in playlists) listView3.Items.Add(item); } private void button1_Click(object sender, EventArgs e) { Run(textBox1.Text); } private void textBox1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) button1_Click(null, null); } } } [/spoiler]https://yadi.sk/d/DW_4rEVrgqb5F Not: API keyi değiştirmeyi unutmayın, örnektir. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.