当前位置: 首页>>代码示例>>C#>>正文


C# YouTubeRequestSettings类代码示例

本文整理汇总了C#中YouTubeRequestSettings的典型用法代码示例。如果您正苦于以下问题:C# YouTubeRequestSettings类的具体用法?C# YouTubeRequestSettings怎么用?C# YouTubeRequestSettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


YouTubeRequestSettings类属于命名空间,在下文中一共展示了YouTubeRequestSettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MainForm

        //string wth; FIXED -- Issue with object scope? Will fix later. This is a workaround.
        public MainForm()
        {
            InitializeComponent();
            buttonUpload.Enabled = false; //Disable buttons by default.
            textComplete.Visible = false;
            btnDelete.Enabled = false;
            btnAdd.Enabled = false;

            comboCategory.SelectedIndex = 7; //No selection is invalid.
            vidFlag = false;            //User must provide credentials and a video before uploading.
            loginFlag = false;

            //Saved settings
            folderBrowserDialog.SelectedPath = stored_IncludeFolder;
            includeTextBox.Text = stored_IncludeFolder;
            VideoWatcher.Path = stored_IncludeFolder;

            VideoFilename = Youtube_Uploader.Properties.Settings.Default.FilesLib;
            VideoId = Youtube_Uploader.Properties.Settings.Default.IdLib;
            VideoStatus = Youtube_Uploader.Properties.Settings.Default.StatusLib;

            YouTubeRequestSettings settings = new YouTubeRequestSettings("Deprecated", key, Youtube_Uploader.Properties.Settings.Default.UsernameYT, Youtube_Uploader.Properties.Settings.Default.PasswordYT);
            request = new YouTubeRequest(settings);

            drawVideoList();
        }
开发者ID:BECKLESPINAX,项目名称:YouTube-Uploader,代码行数:27,代码来源:MainForm.cs

示例2: GDataResultAggregator

    public GDataResultAggregator(string playlistURL)
    {
      YouTubeRequestSettings settings = new YouTubeRequestSettings(APPNAME, CLIENTID, DEVELKEY);
      YouTubeRequest request = new YouTubeRequest(settings);

      _videoFeed = request.Get<Video>(new Uri(playlistURL));
    }
开发者ID:mumairali,项目名称:youtube-playlist-downloader,代码行数:7,代码来源:GDataResultAggregator.cs

示例3: GetRequest1

        public static YouTubeRequest GetRequest1()
        {
            YouTubeRequestSettings settings = new YouTubeRequestSettings("LifeTube",
                                  ConfigurationManager.AppSettings["YouTubeAPIKey"],
                                  ConfigurationManager.AppSettings["YouTubeUsername"],
                                  ConfigurationManager.AppSettings["YouTubePassword"]);

            YouTubeRequest request = new YouTubeRequest(settings);
            Google.YouTube.Video newVideo = new Google.YouTube.Video();

            newVideo.Title = "My first Movie";
            newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
            newVideo.Keywords = "cars, funny";
            newVideo.Description = "My description";
            newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag", YouTubeNameTable.DeveloperTagSchema));
            newVideo.YouTubeEntry.Private = false;

            newVideo.YouTubeEntry.setYouTubeExtension("location", "Somerville, MA");
            var token = request.CreateFormUploadToken(newVideo);
            var strToken = token.Token;
            var strFormAction = token.Url + "?nexturl=http://[ LifeTube ]/form/post-video-step2.aspx?Complete=1";

            //Session["YTRequest"] = request;

            return request;
            //return View(request);
        }
开发者ID:sarmin,项目名称:LifeTube.me,代码行数:27,代码来源:VideoController.cs

示例4: RealSearch

        private static IObservable<IReadOnlyList<ISong>> RealSearch(string searchTerm)
        {
            var query = new YouTubeQuery(YouTubeQuery.DefaultVideoUri)
            { 
                OrderBy = "relevance",
                Query = searchTerm,
                SafeSearch = YouTubeQuery.SafeSearchValues.None,
                NumberToRetrieve = RequestLimit
            };

            var settings = new YouTubeRequestSettings("Espera", ApiKey);
            var request = new YouTubeRequest(settings);

            return Observable.FromAsync(async () =>
            {
                Feed<Video> feed = await Task.Run(() => request.Get<Video>(query));
                List<Video> entries = await Task.Run(() => feed.Entries.ToList());

                return (from video in entries
                    let url = video.WatchPage.OriginalString.Replace("&feature=youtube_gdata_player", String.Empty).Replace("https://", "http://")
                    select new YoutubeSong()
                    {
                        Artist = video.Uploader, Title = video.Title, OriginalPath = url
                    }).ToList();
            })
            .Catch<IReadOnlyList<YoutubeSong>, Exception>(ex => Observable.Throw<IReadOnlyList<YoutubeSong>>(new Exception("YoutubeSongFinder search failed", ex)));
        }
开发者ID:dbeattie71,项目名称:flashbang,代码行数:27,代码来源:YouTubeFinder.cs

示例5: CreateYoutubeVideo

        public static YouTubeVideo.Video CreateYoutubeVideo(string title, string keywords, string description, bool isPrivate, byte[] content, string fileName, string contentType)
        {
            //YouTubeRequestSettings settings = new YouTubeRequestSettings("Logicum", "YouTubeDeveloperKey", "YoutubeUserName", "YoutubePassword");
              //      YouTubeRequestSettings settings = new YouTubeRequestSettings("Zerofootprint", "AI39si5uAJcnGQWqT7bOooT00fTbkCsMjImXlYoyZpkArc49nQvQF-UhxIQDUpwoLxdvf85t97K3wUP2SDrdm1Q8IchJT5mYgQ", "[email protected]", "[email protected]");
            YouTubeRequestSettings settings =
              new YouTubeRequestSettings("Zerofootprint", "532982290458-ua1mk31m7ke3pee5vas9rcr6rgfcmavf.apps.googleusercontent.com", "AI39si5uAJcnGQWqT7bOooT00fTbkCsMjImXlYoyZpkArc49nQvQF-UhxIQDUpwoLxdvf85t97K3wUP2SDrdm1Q8IchJT5mYgQ");
            YouTubeRequest request = new YouTubeRequest(settings);

            YouTubeVideo.Video newVideo = new YouTubeVideo.Video();

            newVideo.Title = title;
            newVideo.Tags.Add(new MediaCategory("Autos", YouTubeNameTable.CategorySchema));
            newVideo.Keywords = keywords;
            newVideo.Description = description;
            newVideo.YouTubeEntry.Private = isPrivate;
            //newVideo.Tags.Add(new MediaCategory("mydevtag, anotherdevtag”, YouTubeNameTable.DeveloperTagSchema));

            // alternatively, you could just specify a descriptive string newVideo.YouTubeEntry.setYouTubeExtension(“location”, “Mountain View, CA”);
            //newVideo.YouTubeEntry.Location = new GeoRssWhere(37, -122);

            Stream stream = new MemoryStream(content);
            newVideo.YouTubeEntry.MediaSource = new MediaFileSource(stream, fileName, contentType);
            YouTubeVideo.Video createdVideo = request.Upload(newVideo);

            return createdVideo;
        }
开发者ID:gitAakash,项目名称:OMS,代码行数:26,代码来源:VideoController.cs

示例6: Search

        public IEnumerable<VideoModel> Search(string searchText)
        {
            var modelList = new List<VideoModel>();
            var settings = new YouTubeRequestSettings("YouTunes", "AIzaSyCgNs6G_0w36g6dhAxxBL4nL7wD3C6jmOw");
            var request = new YouTubeRequest(settings);
            var query = new YouTubeQuery("https://gdata.youtube.com/feeds/api/videos") { Query = searchText };

            Feed<Video> feed = null;

            try
            {
                feed = request.Get<Video>(query);

                foreach (var video in feed.Entries)
                {
                    modelList.Add(new VideoModel() { VideoTitle = video.Title, VideoId = video.VideoId });
                }
            }
            catch (GDataRequestException gdre)
            {

            }

            return modelList;
        }
开发者ID:kkoop83,项目名称:YouTunes,代码行数:25,代码来源:YoutubeService.cs

示例7: Youtube

 public Youtube()
 {
     YouTubeRequestSettings settings = new YouTubeRequestSettings("DemoFacebookFeature", "AI39si4cTAJSx5HF1qHrhfD_ws7kUEnk0Tr02WcFPiMf96nTxczLMT8a_lJqGhlbKRsY0YZE5BYhO-gu2y7rXsQesC3Jf2-jGA");
     Request = new YouTubeRequest(settings);
     VideoFeeds = new List<Video>();
     NewVideos = new List<Video>();
 }
开发者ID:elephunt,项目名称:Facebook-Desktop-App-With-Features,代码行数:7,代码来源:Youtube.cs

示例8: GetRequest

 public static YouTubeRequest GetRequest()
 {
     YouTubeRequestSettings settings = new YouTubeRequestSettings("Chalkable Youtube app",
                                         "AI39si6y_3ZKWG2A4_-v5ogSal_5Y41jmsiQ3aYD0AUVHBTT7mNjOAhh1r24xJWUkki67hLg0l4EXZHS-d4h-kysPd9yGAV0Wg");
     settings.AutoPaging = true;
     YouTubeRequest request = new YouTubeRequest(settings);
     return request;
 }
开发者ID:Chalkable,项目名称:YouTube_Ed_App,代码行数:8,代码来源:YoutubeConnector.cs

示例9: YouTubeRepository

        public YouTubeRepository(string appName, string developerKey)
        {
            _appName = appName;
            _developerKey = developerKey;

            _settings = new YouTubeRequestSettings(_appName, _developerKey);

            _videoEntryFactory = new VideoEntryFactory();
        }
开发者ID:TryingToImprove,项目名称:myv,代码行数:9,代码来源:YouTubeRepository.cs

示例10: GetRequest

 private static YouTubeRequest GetRequest()
 {
     var youtubeApiKey = ConfigurationManager.AppSettings["youtubeApiKey"];
     var applicationName = ConfigurationManager.AppSettings["applicationName"];
     var youtubeUserName = ConfigurationManager.AppSettings["youtubeUserName"];
     var youtubePassword = ConfigurationManager.AppSettings["youtubePassword"];
     var settings = new YouTubeRequestSettings(applicationName, youtubeApiKey, youtubeUserName, youtubePassword);
     var request = new YouTubeRequest(settings);
     return request;
 }
开发者ID:MassImpact,项目名称:PollinatorMap-Full,代码行数:10,代码来源:YouTubeUltility.cs

示例11: InitYouTubeRequest

        public bool InitYouTubeRequest ()
        {
            YouTubeRequestSettings yt_request_settings = new YouTubeRequestSettings (app_name, client_id, developer_key);
            this.yt_request = new YouTubeRequest (yt_request_settings);

            if (this.yt_request != null && yt_request_settings != null) {
                return true;
            }

            return false;
        }
开发者ID:allquixotic,项目名称:banshee-gst-sharp-work,代码行数:11,代码来源:YouTubeData.cs

示例12: Guncelle

        private void Guncelle()
        {
            using (OleDbConnection conn = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=hesap.mdb"))
            {
                conn.Open();
                OleDbCommand komut = new OleDbCommand();
                komut.Connection = conn;
                komut.CommandText = "Select * from hesap"; // sorgu / komut cumlemi yazıyorum.
                komut.ExecuteNonQuery(); // insert , updateiçin gerekli satir sayisi donduruyoruz.
                OleDbDataReader dr = komut.ExecuteReader(); // datareader olusturup komut sorgulayıp veritabaninda okuma işlemini tanıtıyoruz
                while (dr.Read()) // datareader ile okuyoruz.
                {
                    string hadi = dr["hadi"].ToString();
                    string kadi = dr["kadi"].ToString();
                    string q;
                    using (WebClient asd = new WebClient())
                    {
                        asd.Encoding = Encoding.UTF8;
                        q = asd.DownloadString("http://gdata.youtube.com/feeds/api/users/" + kadi + "/uploads?v=2&alt=jsonc&max-results=0");
                    }
                    string[] adet1 = q.Split(new string[] { "totalItems\":" }, StringSplitOptions.None);
                    string[] adet2 = adet1[1].Split(',');
                    listView1.Items.Add(new ListViewItem(new string[] { hadi, "Adet: "+adet2[0] }));
                }
                dr.Close();
                komut.ExecuteNonQuery(); // insert , updateiçin gerekli satir sayisi donduruyoruz.
                dr = komut.ExecuteReader(); // datareader olusturup komut sorgulayıp veritabaninda okuma işlemini tanıtıyoruz
                while (dr.Read()) // datareader ile okuyoruz.
                {
                    string kadi = dr["hadi"].ToString(); // veritabanimdaki "kadi" alanımdaki veriyi alip kadi değişkenine atıyorum(yukarıda string olusturmustum)
                    string sifre = dr["hsifresi"].ToString(); // aynı durum söz konusu
                    string devkey = dr["devkey"].ToString();
                    Random a = new Random();
                    string id = a.Next(100000, 999999).ToString();
                    YouTubeRequestSettings settings = new YouTubeRequestSettings(id, devkey, kadi,sifre);
                    YouTubeRequest request = new YouTubeRequest(settings);

                    string feedUrl = "https://gdata.youtube.com/feeds/api/users/default/uploads";

                    Feed<Video> videoFeed = request.Get<Video>(new Uri(feedUrl));
                    foreach (Video entry in videoFeed.Entries)
                    {
                        string vid_thumb ="http://img.youtube.com/vi/"+entry.VideoId+"/0.jpg";
                        int izlenme = entry.ViewCount;
                        if(izlenme == -1)
                            izlenme = 0;
                        listView1.Items.Add(new ListViewItem(new string[] { kadi,entry.YouTubeEntry.Title.Text,izlenme.ToString()  }));
                    }
                }
            }
        }
开发者ID:voyl,项目名称:myprojects,代码行数:51,代码来源:Form1.cs

示例13: GetTitle

        public VideoTitleParseResult GetTitle(string id)
        {
            var settings = new YouTubeRequestSettings("VocaDB", null);
            var request = new YouTubeRequest(settings);
            var videoEntryUrl = new Uri(string.Format("http://gdata.youtube.com/feeds/api/videos/{0}", id));

            try {
                var video = request.Retrieve<Video>(videoEntryUrl);
                var thumbUrl = video.Thumbnails.Count > 0 ? video.Thumbnails[0].Url : string.Empty;
                return VideoTitleParseResult.CreateSuccess(video.Title, video.Author, thumbUrl);
            } catch (Exception x) {
                return VideoTitleParseResult.CreateError(x.Message);
            }
        }
开发者ID:realzhaorong,项目名称:vocadb,代码行数:14,代码来源:YoutubeParser.cs

示例14: GetRequest

 public static YouTubeRequest GetRequest()
 {
     YouTubeRequest request = HttpContext.Current.Session["YTRequest"] as YouTubeRequest;
     if (request == null)
     {
         YouTubeRequestSettings settings = new YouTubeRequestSettings("YouTubeAspSample",
                                         "AI39si4v3E6oIYiI60ndCNDqnPP5lCqO28DSvvDPnQt-Mqia5uPz2e4E-gMSBVwHXwyn_LF1tWox4LyM-0YQd2o4i_3GcXxa2Q",
                                         HttpContext.Current.Session["token"] as string
                                         );
         settings.AutoPaging = true;
         request = new YouTubeRequest(settings);
         HttpContext.Current.Session["YTRequest"] = request;
     }
     return request;
 }
开发者ID:Zelxin,项目名称:RPiKeg,代码行数:15,代码来源:ListVideos.cs

示例15: MainX

        // once you copied your access and refresh tokens
        // then you can run this method directly from now on...
        public void MainX(string args)
        {
            GOAuth2RequestFactory requestFactory = RefreshAuthenticate();
            YouTubeRequestSettings settings = new YouTubeRequestSettings(_app_name, _clientID, _devKey);
            YouTubeRequest request = new YouTubeRequest(settings);

            YouTubeQuery query = new YouTubeQuery(YouTubeQuery.DefaultVideoUri);
            //order results by the number of views (most viewed first)
            query.OrderBy = "viewCount";
            // search for puppies and include restricted content in the search results
            // query.SafeSearch could also be set to YouTubeQuery.SafeSearchValues.Moderate
            query.Query = args;
            query.SafeSearch = YouTubeQuery.SafeSearchValues.None;
            //Feed<Video> videoFeed = requestFactory.Get<Video>(query);
        }
开发者ID:juress,项目名称:ytmusic,代码行数:17,代码来源:search.cs


注:本文中的YouTubeRequestSettings类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。