Пример #1
0
        public static async Task <Media> GetMediaFromManifestUrl(string manifestUrl)
        {
            XmlNode xmlManifest = await HttpDownloader.GetStringAsync(manifestUrl);

            // pick media with higher bitrate (i.e. better quality)
            XmlNode xmlMedia = xmlManifest.Nodes.Where(x => x.Tag == "media").MaxBy(x => int.Parse(x["bitrate"]));

            return(new Media
            {
                Url = manifestUrl.ReMatch(@"(^https?://.+)/"),
                MediaUrl = xmlMedia["url"],
                BootstrapInfo = Convert.FromBase64String(xmlManifest.Nodes.First(x => x.Tag == "bootstrapInfo" && x["id"] == xmlMedia["bootstrapInfoId"]).InnerString),
                Metadata = Convert.FromBase64String(xmlMedia.Nodes.First().InnerString)
            });
        }
Пример #2
0
 private async Task SyncShowsDictionaryAsync()
 {
     await Task.WhenAll(Enumerable.Range('a', 'z' + 1 - 'a').Select(c =>
                                                                    Task.Run(async() => {
         string connId = await GetNewConnIdAsync();     // I need to get a new conn_id for each letter because of the way 10003/last => 10003 works
         string json   = await HttpDownloader.GetStringAsync($"http://www.vvvvid.it/vvvvid/ondemand/anime/channel/10003/last?filter={c}&conn_id={connId}");
         while (json?.Contains("\"data\"") == true)
         {
             foreach (Dictionary <string, object> d in new Json(json).GetList("data"))
             {
                 ShowsDictionary[d["title"].ToString().Unescape()] = d["show_id"].ToString();
             }
             AddedShows?.Invoke(this, null);
             json = await HttpDownloader.GetStringAsync($"http://www.vvvvid.it/vvvvid/ondemand/anime/channel/10003?filter={c}&conn_id={connId}");
         }
     })));
 }
Пример #3
0
 private static async Task <string> GetNewConnIdAsync() => Json.GetStringRE(await HttpDownloader.GetStringAsync("https://www.vvvvid.it/user/login"), "conn_id");