static void getSingleIssue(string pubid, string issueid) { using (var client = new WebClient()) { client.Headers.Add("Content-Type", "application/json"); string json = client.DownloadString("https://d3og6tlt23zks5.cloudfront.net/content/" + issueid); SingleIssue singleissue = JsonConvert.DeserializeObject <SingleIssue>(json); //client.Headers.Clear(); if (!File.Exists(MakeValidFileName(singleissue.Title) + "\\" + MakeValidFileName(singleissue.Title) + " - " + MakeValidFileName(singleissue.Issue) + ".pdf")) { Console.WriteLine("============================================================================="); Console.WriteLine("Fetching: " + singleissue.Title + " - " + singleissue.Issue); getPages(singleissue.Id, singleissue.Title, singleissue.Issue); } else { Console.WriteLine(singleissue.Title + " - " + singleissue.Issue + " Already Exists, Skipping."); } } }
static void getSingleIssue(string issueid) { using (var client = new WebClient()) { client.Headers.Add("Content-Type", "application/json"); string json = client.DownloadString("https://d3og6tlt23zks5.cloudfront.net/content/" + issueid); SingleIssue singleissue = JsonConvert.DeserializeObject <SingleIssue>(json); string issue = ""; if (issueformat == "issue") { if (singleissue.Issue == null) { issue = singleissue.PublishDate.ToString(@"yyyy-MM-dd"); } else { issue = singleissue.Issue; } } else { issue = singleissue.PublishDate.ToString(@"yyyy-MM-dd"); } Console.WriteLine("============================================================================="); Console.WriteLine("Fetching: " + singleissue.Title + " - " + issue); if (outtype == "pdf") { GetPDF(singleissue.Id, singleissue.Title, issue); } else { getImg(singleissue.Id, singleissue.Title, issue); } } }