mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
Fixed: TheTVDB metadata images containing html content
This commit is contained in:
parent
25b763a052
commit
87a64cdacb
@ -249,6 +249,11 @@ public void DownloadFile(string url, string fileName)
|
||||
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 @@ private void DownloadImage(Series series, ImageFileResult image)
|
||||
}
|
||||
_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 @@ private bool EnsureCovers(Series series)
|
||||
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…
Reference in New Issue
Block a user