예제 #1
0
            public void RequestVideoAccess(String VideoID)
            {
                if (String.IsNullOrEmpty(this.m_channel))
                {
                    throw new ArgumentException("Channel name missing");
                }
                if (String.IsNullOrEmpty(VideoID))
                {
                    throw new ArgumentException("Invalid Video ID: " + VideoID);
                }
                VideoID = VideoID.Substring(1); //remove the v or a at the start of the id
                String accessURL      = "https://api.twitch.tv/api/vods/" + VideoID + "/access_token";
                String accessResponse = APIRequest(accessURL);

                //TODO handle errors
                this.m_access = JsonConvert.DeserializeObject <TwitchObjects.AccessToken>(accessResponse);
            }
예제 #2
0
 public TwitchObject(String ChannelName)
 {
     this.m_channel   = ChannelName.ToLower();
     this.m_access    = null;
     this.m_videoLink = null;
 }