コード例 #1
0
 public static async Task <List <M3u8VideoSegment> > GetVideoSegments(M3u8Playlist playlistItem)
 {
     using (var client = new TweetClient())
     {
         return(await GetVideoSegments(playlistItem, client));
     }
 }
コード例 #2
0
        public static async Task <List <M3u8VideoSegment> > GetVideoSegments(M3u8Playlist playlistItem, TweetClient client)
        {
            if (string.IsNullOrEmpty(playlistItem.AuthenticationToken))
            {
                throw new Exception($"No Authorization Bearer Token set for m3u8 file!");
            }
            var m3u3Text = await client.GetStringAsync(playlistItem.Url.ToString(), playlistItem.AuthenticationToken);

            return(M3U3Parser.ParseVideoSegments(m3u3Text, playlistItem.Resolution, $"{playlistItem.Url.Scheme}://{playlistItem.Url.Host}"));
        }