No, only on Wondows 10 ...Just wanted to ensure you tested your code on a wide variety of systems
At me ...Also to verify that TheTVdB supports TLS 1.2-Only connections.
(SecurityProtocolType)(0xc0 | 0x300 | 0xc00)
(SecurityProtocolType)0xc00
Plz fix updates_week.zip look - MP-TVSeries v4.3.2 Release [2018-09-02]We're fixing the mirrors.xml right now. It shouldn't take too long because it's static content.
Helper.SaveXmlCache(filename, x[key].FirstChild.NextSibling ?? x[key].FirstChild )
string newUrl = null;
HttpWebRequest request = null;
HttpWebResponse response = null;
try
{
// .NET 4.0: Use TLS v1.2. Many download sources no longer support the older and now insecure TLS v1.0/1.1 and SSL v3.
ServicePointManager.SecurityProtocol = ( SecurityProtocolType )0xc00;
request = (HttpWebRequest)WebRequest.Create(sUrl);
// Note: some network proxies require the useragent string to be set or they will deny the http request
// this is true for instance for EVERY thailand internet connection (also needs to be set for banners/episodethumbs and any other http request we send)
request.UserAgent = Settings.UserAgent;
request.Timeout = 60000;
// turn off auto-redirection on the initial request.
// then we can pull out the header and do the redirection manually by making a new request.
request.AllowAutoRedirect = false;
response = (HttpWebResponse)request.GetResponse();
MPTVSeriesLog.Write( $"Status Code={ response.StatusCode }, Headers={ response.Headers }", MPTVSeriesLog.LogLevel.Debug );
// check for redirect
switch ( response.StatusCode )
{
case HttpStatusCode.Redirect:
case HttpStatusCode.MovedPermanently:
case HttpStatusCode.RedirectKeepVerb:
case HttpStatusCode.RedirectMethod:
newUrl = response.Headers["Location"];
if ( newUrl == null )
return null;
if ( newUrl.IndexOf( "://", System.StringComparison.Ordinal ) == -1 )
{
// doesn't have a URL Schema, meaning it's a relative or absolute URL
var u = new Uri( new Uri( sUrl ), newUrl );
newUrl = u.ToString();
}
// now re-request using new url
return RetrieveData( newUrl );
break;
}
if (response != null) // Get the stream associated with the response.
return response.GetResponseStream();
}
2019-11-21 16:41:30.371 [DEBG][05]: Retrieving Data from: https://thetvdb.com/api/<apikey>/updates/updates_month.zip
2019-11-21 16:41:30.475 [DEBG][05]: Status Code='Redirect', Headers=Connection: keep-alive
x-amzn-RequestId: d399016c-1663-442e-b65c-4e81e0529262
x-amz-apigw-id: DeqTcH6HvHcFRFw=
X-Amzn-Trace-Id: Root=1-5dd5bdaf-e52331d2b04543ae92f8ec6e;Sampled=0
X-Amz-Cf-Pop: SIN52-C2,SIN52-C2
X-Cache: Hit from cloudfront
X-Amz-Cf-Id: 3sj8ouyPvxLlCMmXo0lCMuP1LYUFc3ynpoNK78UVfvkA0jg5u3ptfg==
Age: 7817
Content-Length: 64
Content-Type: application/json
Date: Wed, 20 Nov 2019 22:26:55 GMT
Via: 1.1 21091692796ba0a5be0a5b521f44889c.cloudfront.net (CloudFront), 1.1 6b0d2463e38d8b2224f25b309fde2ba3.cloudfront.net (CloudFront)
2019-11-21 17:09:25.126 [DEBG][05]: Retrieving Data from: http://thetvdb.com/api/<apikey>/mirrors.xml
2019-11-21 17:09:25.328 [DEBG][05]: Status Code=MovedPermanently, Headers=Connection: keep-alive
X-Cache: Redirect from cloudfront
X-Amz-Cf-Pop: SIN52-C2
X-Amz-Cf-Id: th0rRhoJmgvA1oAqcTm7yU0vhLC2DBZgjCIKTc5rOoEj4deVrxns7A==
Content-Length: 183
Content-Type: text/html
Date: Thu, 21 Nov 2019 06:09:25 GMT
Location: https://thetvdb.com/api/<apikey>/mirrors.xml
Server: CloudFront
Via: 1.1 81ed70dd2a5a6558bf4a599e654fd8e1.cloudfront.net (CloudFront)
2019-11-21 17:09:25.329 [DEBG][05]: Retrieving Data from: https://thetvdb.com/api/<apikey>/mirrors.xml
2019-11-21 17:09:25.433 [DEBG][05]: Status Code=OK, Headers=Connection: keep-alive
x-amzn-RequestId: b5fd359d-8627-442b-b3c8-60460bfe36fc
x-amz-apigw-id: DdNs2EocvHcFWlg=
X-Amzn-Trace-Id: Root=1-5dd52985-a42ea8994792045001bbfde1;Sampled=0
X-Amz-Cf-Pop: SIN52-C2,SIN52-C2
X-Cache: Hit from cloudfront
X-Amz-Cf-Id: uD7Hby1uzJywjV32Hkbx0z3hn2sH7XztFF9gmzD4iScZ0bNmv5co_w==
Age: 9113
Content-Length: 150
Content-Type: application/xml
Date: Wed, 20 Nov 2019 11:54:45 GMT
Via: 1.1 f651505f69d4004d8a3662c44e02ec6f.cloudfront.net (CloudFront), 1.1 0cd88f29d8c6e29a267867c45efda9a9.cloudfront.net (CloudFront)
2019-11-21 17:09:25.434 [DEBG][05]: *************************************
2019-11-21 17:09:25.434 [DEBG][05]: <?xml version="1.0" encoding="UTF-8"?>
<Mirrors><Mirror><id>1</id><mirrorpath>http://thetvdb.com</mirrorpath><typemask>7</typemask></Mirror></Mirrors>