public static void MediaTestsInit(TestContext context) { _apiKey = ConfigurationManager.AppSettings["ApiKey"]; _dataClient = new WistiaDataClient(_apiKey); _statsClient = new WistiaStatsClient(_apiKey); System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; }
public void GetWistiaFileSize() { long size = 0; var client = new WistiaDataClient(apiKey: _apiKey); var projects = client.Projects.All().GetAwaiter().GetResult(); foreach (var p in projects) { var project = client.Projects.GetById(p.hashedId).GetAwaiter().GetResult(); foreach (var m in project.medias) { var media = client.Media.GetById(m.hashed_id).GetAwaiter().GetResult(); foreach (var a in media.assets) { if (a.type == "OriginalFile") // && a.contentType == "video/mp4") { size += a.fileSize; } } } } var megabyte = Convert.ToDecimal(size) / 1000000; var gigabyte = megabyte / 1000; var terabyte = gigabyte / 1000; var petabyte = terabyte / 1000; Console.WriteLine($"{petabyte} Petabytes"); Assert.IsTrue(size != 0); }
public static void MediaTestsInit(TestContext context) { _apiKey = ConfigurationManager.AppSettings["ApiKey"]; _dataClient = new WistiaDataClient(_apiKey); _statsClient = new WistiaStatsClient(_apiKey); }
public static void AccountTestsInit(TestContext context) { _apiKey = ConfigurationManager.AppSettings["ApiKey"]; _dataClient = new WistiaDataClient(_apiKey); _statsClient = new WistiaStatsClient(_apiKey); }
public static void SharingTestsInit(TestContext context) { _apiKey = ConfigurationManager.AppSettings["ApiKey"]; _client = new WistiaDataClient(_apiKey); }