Fixed: TheTVDB metadata images containing html content

pull/3848/head
Taloth Saldono 4 years ago
parent 25b763a052
commit 87a64cdacb

@ -249,6 +249,11 @@ namespace NzbDrone.Common.Http
var request = new HttpRequest(url);
request.ResponseStream = fileStream;
var response = Get(request);
if (response.Headers.ContentType != null && response.Headers.ContentType.Contains("text/html"))
{
throw new HttpException(request, response, "Site responded with html content.");
}
}
stopWatch.Stop();
if (File.Exists(fileName))

@ -450,6 +450,10 @@ namespace NzbDrone.Core.Extras.Metadata
}
_mediaFileAttributeService.SetFilePermissions(fullPath);
}
catch (HttpException ex)
{
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, series, ex.Message);
}
catch (WebException ex)
{
_logger.Warn(ex, "Couldn't download image {0} for {1}. {2}", image.Url, series, ex.Message);

@ -122,6 +122,10 @@ namespace NzbDrone.Core.MediaCover
updated = true;
}
}
catch (HttpException e)
{
_logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message);
}
catch (WebException e)
{
_logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message);

Loading…
Cancel
Save