Esempio n. 1
0
        protected void BaseParse(DownloadingItem downloading)
        {
            // 更新状态显示
            downloading.DownloadStatusTitle = DictionaryResource.GetString("Parsing");
            downloading.DownloadContent     = string.Empty;
            // 下载大小
            downloading.DownloadingFileSize = string.Empty;
            downloading.Progress            = 0;
            // 下载速度
            downloading.SpeedDisplay = string.Empty;

            if (downloading.PlayUrl != null && downloading.Downloading.DownloadStatus == DownloadStatus.NOT_STARTED)
            {
                // 设置下载状态
                downloading.Downloading.DownloadStatus = DownloadStatus.DOWNLOADING;

                return;
            }

            // 设置下载状态
            downloading.Downloading.DownloadStatus = DownloadStatus.DOWNLOADING;

            // 解析
            switch (downloading.Downloading.PlayStreamType)
            {
            case PlayStreamType.VIDEO:
                downloading.PlayUrl = VideoStream.GetVideoPlayUrl(downloading.DownloadBase.Avid, downloading.DownloadBase.Bvid, downloading.DownloadBase.Cid);
                break;

            case PlayStreamType.BANGUMI:
                downloading.PlayUrl = VideoStream.GetBangumiPlayUrl(downloading.DownloadBase.Avid, downloading.DownloadBase.Bvid, downloading.DownloadBase.Cid);
                break;

            case PlayStreamType.CHEESE:
                downloading.PlayUrl = VideoStream.GetCheesePlayUrl(downloading.DownloadBase.Avid, downloading.DownloadBase.Bvid, downloading.DownloadBase.Cid, downloading.DownloadBase.EpisodeId);
                break;

            default:
                break;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取视频流的信息,从VideoPage返回
        /// </summary>
        /// <param name="page"></param>
        public void GetVideoStream(VideoPage page)
        {
            PlayUrl playUrl = VideoStream.GetCheesePlayUrl(page.Avid, page.Bvid, page.Cid, page.EpisodeId);

            Utils.VideoPageInfo(playUrl, page);
        }