mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-12 16:13:58 -07:00
Fixed: Can now specify a cookie for BitMeTv.
This commit is contained in:
parent
d1ce1bf218
commit
96469be7f0
5 changed files with 46 additions and 5 deletions
|
@ -14,6 +14,7 @@ namespace NzbDrone.Common.Http
|
|||
Headers = new HttpHeader();
|
||||
_segments = new Dictionary<string, string>();
|
||||
AllowAutoRedirect = true;
|
||||
Cookies = new Dictionary<string, string>();
|
||||
|
||||
if (httpAccept != null)
|
||||
{
|
||||
|
@ -44,6 +45,7 @@ namespace NzbDrone.Common.Http
|
|||
public NetworkCredential NetworkCredential { get; set; }
|
||||
public bool SuppressHttpError { get; set; }
|
||||
public bool AllowAutoRedirect { get; set; }
|
||||
public Dictionary<string, string> Cookies { get; private set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
@ -66,5 +68,20 @@ namespace NzbDrone.Common.Http
|
|||
|
||||
_segments.Add(key, value);
|
||||
}
|
||||
|
||||
public void AddCookie(string key, string value)
|
||||
{
|
||||
Cookies[key] = value;
|
||||
}
|
||||
|
||||
public void AddCookie(string cookies)
|
||||
{
|
||||
foreach (var pair in cookies.Split(';'))
|
||||
{
|
||||
var split = pair.Split('=');
|
||||
|
||||
Cookies[split[0].Trim()] = split[1].Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue