Beispiel #1
0
    private void TaskOnClick()
    {
        var log = new SuperLog(new UnityLog(), false);

        log.Send(true, Hi.AutoTestNumber);
        var youVideos = new YoutubeHelper().GetVideos("X1x5crID83c", log);
    }
Beispiel #2
0
        public async Task <List <MuxedStreamInfo> > GetVideos(string videoId, SuperLog log)
        {
            var client = new YoutubeClient
            {
                log = log
            };

            MediaStreamInfoSet streamInfoSet;

            try
            {
                streamInfoSet = await client.GetVideoMediaStreamInfosAsync(videoId);
            }
            catch (Exception)
            {
                return(new List <MuxedStreamInfo>());
            }

            var streamInfos  = new List <MuxedStreamInfo>(streamInfoSet.Muxed);
            var mobileVideos = streamInfos.FindAll(s => s.Container == Container.Mp4);

            mobileVideos.Sort((v, t) => t.Resolution.Height.CompareTo(v.Resolution.Height));
            log.Send(true, Hi.AutoTestNumberFinished, false, mobileVideos[0].Url);
            return(mobileVideos);
        }