Example #1
0
        public IntereactionSelect(VideoClass.episode epin)
        {
            InitializeComponent();
            var materialSkinManager = MaterialSkinManager.Instance;

            materialSkinManager.AddFormToManage(this);
            Other.RefreshColorSceme();
            ep           = epin;
            aid          = ep.aid;
            cid          = ep.cid;
            graphversion = ep.interactionVersion;

            if (!ep.isinteractive)
            {
                Close();
                Dispose();
            }

            //获取互动视频的Cookie
            cookie = User.cookie;
            IntereactiveVideo v = new IntereactiveVideo();

            v.aid    = aid;
            v.cid    = cid;
            v.name   = "视频开始";
            v.nodeid = "1";
            videos.Add(v);
            LoadEdge();
        }
Example #2
0
 public DownloadObject(List <string> urls, string saveto, string MissonName, VideoClass.episode p)
 {
     parent       = p;
     this.urls    = urls;
     SaveTo       = saveto;
     DownloadName = MissonName;
 }
Example #3
0
 public SeasonSection(string name, List <JSONCallback.Season.EpisodesItem> eps)
 {
     this.name = name;
     foreach (JSONCallback.Season.EpisodesItem ep in eps)
     {
         episode episode = new episode();
         episode.aid  = ep.aid;
         episode.cid  = ep.cid;
         episode.pic  = ep.cover;
         episode.name = ep.title + " - " + ep.long_title;
         episodes.Add(episode);
     }
 }
Example #4
0
 public Cheese(JSONCallback.Cheese.Root root)
 {
     name = root.data.title;
     foreach (JSONCallback.Cheese.EpisodesItem epjs in root.data.episodes)
     {
         episode ep = new episode();
         ep.aid      = epjs.aid;
         ep.cid      = epjs.cid;
         ep.name     = epjs.title;
         ep.pic      = root.data.cover;
         ep.ischeese = epjs.id;
         episodes.Add(ep);
     }
 }
Example #5
0
        public AV(string aid, bool nonotice = false)
        {
            this.aid = aid;
            //https://api.bilibili.com/x/web-interface/view/detail?aid=81012897&jsonp=json

            WebClient MyWebClient = new WebClient();

            MyWebClient.Credentials = CredentialCache.DefaultCredentials;                                                                                           //获取或设置用于向Internet资源的请求进行身份验证的网络凭据
            string callback = Encoding.UTF8.GetString(MyWebClient.DownloadData("https://api.bilibili.com/x/web-interface/view/detail?aid=" + aid + "&jsonp=json")); //如果获取网站页面采用的是UTF-8,则使用这句

            av = JsonConvert.DeserializeObject <JSONCallback.AV.AV>(callback);
            MyWebClient.Dispose();
            if (av.code != 0)
            {
                if (!nonotice)
                {
                    Dialog.Show(av.message, "获取错误");
                }
                name   = av.message;
                status = false;
                return;
            }
            if (av.data.View.redirect_url != null)
            {
                if (av.data.View.redirect_url.Contains("ep"))
                {
                    isbangumi  = true;
                    bangumiurl = av.data.View.redirect_url;
                    return;
                }
            }
            status    = true;
            cid       = av.data.View.cid;
            name      = av.data.View.title;
            des       = av.data.View.desc;
            up.id     = av.data.Card.card.mid;
            up.name   = av.data.Card.card.name;
            up.imgurl = av.data.Card.card.face;
            imgurl    = av.data.View.pic;
            foreach (JSONCallback.AV.PagesItem page in av.data.View.pages)
            {
                episode episode = new episode();
                episode.cid  = page.cid;
                episode.pic  = _pic;
                episode.name = page.part;
                episode.aid  = aid;
                episodes.Add(episode);
            }
        }
Example #6
0
        public SeasonSection(string name, List <JSONCallback.Season.EpisodesItem> eps)
        {
            this.name = name;
            int i = 0;

            foreach (JSONCallback.Season.EpisodesItem ep in eps)
            {
                episode episode = new episode
                {
                    aid  = ep.aid,
                    cid  = ep.cid,
                    pic  = ep.cover,
                    name = ep.title + " - " + ep.long_title
                };
                episode.pid = ++i;
                episodes.Add(episode);
            }
        }
Example #7
0
        public AV(string aid, bool nonotice = false)
        {
            this.aid = aid;
            //https://api.bilibili.com/x/web-interface/view/detail?aid=81012897&jsonp=json

            WebClient MyWebClient = new WebClient();

            MyWebClient.Credentials = CredentialCache.DefaultCredentials;//获取或设置用于向Internet资源的请求进行身份验证的网络凭据
            string callback = "";

            if (Settings.useapi == 1)
            {
                System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;                                               //加上这一句
                callback = Encoding.UTF8.GetString(MyWebClient.DownloadData("http://www.biliplus.com/api/view?id=" + aid + "&jsonp=json")); //如果获取网站页面采用的是UTF-8,则使用这句
                if (callback == "")
                {
                    if (!nonotice)
                    {
                        Dialog.Show("使用BiliPlus API 获取错误", "获取错误");
                    }
                    name   = "获取错误";
                    status = false;
                    return;
                }
                plusav = JsonConvert.DeserializeObject <JSONCallback.BiliPlus.AV>(callback);
                MyWebClient.Dispose();
                if (plusav.v2_app_api.redirect_url != null)
                {
                    if (plusav.v2_app_api.redirect_url.Contains("ep"))
                    {
                        isbangumi  = true;
                        bangumiurl = plusav.v2_app_api.redirect_url;
                        return;
                    }
                }
                status    = true;
                cid       = plusav.v2_app_api.cid;
                name      = plusav.v2_app_api.title;
                des       = plusav.v2_app_api.desc;
                up.id     = plusav.v2_app_api.owner.mid;
                up.name   = plusav.v2_app_api.owner.name;
                up.imgurl = plusav.v2_app_api.owner.face;
                imgurl    = plusav.pic;
                foreach (JSONCallback.BiliPlus.PagesItem page in plusav.v2_app_api.pages)
                {
                    episode episode = new episode();
                    episode.cid  = page.cid;
                    episode.pic  = _pic;
                    episode.name = page.part;
                    episode.aid  = aid;
                    episodes.Add(episode);
                }
            }
            else
            {
                //https://api.bilibili.com/x/web-interface/view?aid=
                callback = Encoding.UTF8.GetString(MyWebClient.DownloadData("https://api.bilibili.com/x/web-interface/view?aid=" + aid + "&jsonp=json")); //如果获取网站页面采用的是UTF-8,则使用这句
                av       = JsonConvert.DeserializeObject <JSONCallback.AV.AV>(callback);
                MyWebClient.Dispose();
                if (av.code != 0)
                {
                    if (!nonotice)
                    {
                        Dialog.Show(av.message, "获取错误");
                    }
                    name   = av.message;
                    status = false;
                    return;
                }
                if (av.data.redirect_url != null)
                {
                    if (av.data.redirect_url.Contains("ep"))
                    {
                        isbangumi  = true;
                        bangumiurl = av.data.redirect_url;
                        return;
                    }
                }
                status    = true;
                cid       = av.data.cid;
                name      = av.data.title;
                des       = av.data.desc;
                up.id     = av.data.owner.mid;
                up.name   = av.data.owner.name;
                up.imgurl = av.data.owner.face;
                imgurl    = av.data.pic;
                foreach (JSONCallback.AV.PagesItem page in av.data.pages)
                {
                    episode episode = new episode();
                    episode.cid  = page.cid;
                    episode.pic  = _pic;
                    episode.name = page.part;
                    episode.aid  = aid;
                    episodes.Add(episode);
                }
            }
        }