Simple TV Guide grabber using data from xmltv.radiotimes.com
コード例 #1
0
        List <VideoInfo> getLiveVideoList(Group category)
        {
            List <VideoInfo> videos = new List <VideoInfo>();

            foreach (Channel channel in category.Channels)
            {
                VideoInfo video = new VideoInfo();
                video.Title = channel.StreamName;

                int argIndex = channel.Url.IndexOf('?');
                if (argIndex < 0)
                {
                    video.VideoUrl = channel.Url;
                }
                else
                {
                    video.VideoUrl = channel.Url.Remove(argIndex);
                }

                video.Other = "livestream";
                video.Thumb = channel.Thumb;
                if (retrieveTVGuide && argIndex > -1)
                {
                    Utils.TVGuideGrabber tvGuide = new Utils.TVGuideGrabber();
                    if (tvGuide.GetNowNextForChannel(channel.Url))
                    {
                        video.Description = tvGuide.FormatTVGuide(tvGuideFormatString);
                    }
                }
                videos.Add(video);
            }
            return(videos);
        }
コード例 #2
0
        List <VideoInfo> getLiveStreams(Group group)
        {
            List <VideoInfo> vids = new List <VideoInfo>();

            foreach (Channel chan in group.Channels)
            {
                VideoInfo vid = new VideoInfo();
                vid.Title    = chan.StreamName;
                vid.Thumb    = chan.Thumb;
                vid.VideoUrl = chan.Url;
                int argIndex = chan.Url.IndexOf('?');
                if (argIndex >= 0)
                {
                    if (retrieveTVGuide)
                    {
                        //retrieve tv guide
                        Utils.TVGuideGrabber guide = new Utils.TVGuideGrabber();
                        if (guide.GetNowNextForChannel(vid.VideoUrl))
                        {
                            vid.Description = guide.FormatTVGuide(tvGuideFormatString);
                        }
                    }
                    vid.VideoUrl = vid.VideoUrl.Remove(argIndex);
                }
                vids.Add(vid);
            }
            return(vids);
        }
コード例 #3
0
 List<VideoInfo> getLiveStreams(Group group)
 {
     List<VideoInfo> vids = new List<VideoInfo>();
     foreach (Channel chan in group.Channels)
     {
         VideoInfo vid = new VideoInfo();
         vid.Title = chan.StreamName;
         vid.Thumb = chan.Thumb;
         vid.VideoUrl = chan.Url;
         int argIndex = chan.Url.IndexOf('?');
         if (argIndex >= 0)
         {
             if (retrieveTVGuide)
             {
                 //retrieve tv guide
                 Utils.TVGuideGrabber guide = new Utils.TVGuideGrabber();
                 if (guide.GetNowNextForChannel(vid.VideoUrl))
                     vid.Description = guide.FormatTVGuide(tvGuideFormatString);
             }
             vid.VideoUrl = vid.VideoUrl.Remove(argIndex);
         }
         vids.Add(vid);
     }
     return vids;
 }