2013-04-07 07:30:37 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Text.RegularExpressions;
|
2013-08-06 02:45:57 +00:00
|
|
|
|
using System.Xml.Linq;
|
2013-04-07 07:30:37 +00:00
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Indexers.Omgwtfnzbs
|
|
|
|
|
{
|
2013-09-13 23:17:58 +00:00
|
|
|
|
public class OmgwtfnzbsParser : RssParserBase
|
2013-04-07 07:30:37 +00:00
|
|
|
|
{
|
2013-08-06 02:45:57 +00:00
|
|
|
|
protected override string GetNzbInfoUrl(XElement item)
|
2013-04-07 07:30:37 +00:00
|
|
|
|
{
|
|
|
|
|
//Todo: Me thinks I need to parse details to get this...
|
2013-08-06 02:45:57 +00:00
|
|
|
|
var match = Regex.Match(item.Description(), @"(?:\<b\>View NZB\:\<\/b\>\s\<a\shref\=\"")(?<URL>.+)(?:\""\starget)",
|
2013-04-07 07:30:37 +00:00
|
|
|
|
RegexOptions.IgnoreCase | RegexOptions.Compiled);
|
|
|
|
|
|
|
|
|
|
if (match.Success)
|
|
|
|
|
{
|
|
|
|
|
return match.Groups["URL"].Value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return String.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
2013-09-13 23:17:58 +00:00
|
|
|
|
protected override long GetSize(XElement item)
|
2013-04-07 07:30:37 +00:00
|
|
|
|
{
|
2013-09-13 23:17:58 +00:00
|
|
|
|
var sizeString = Regex.Match(item.Description(), @"(?:Size:\<\/b\>\s\d+\.)\d{1,2}\s\w{2}(?:\<br \/\>)", RegexOptions.IgnoreCase | RegexOptions.Compiled).Value;
|
|
|
|
|
return ParseSize(sizeString);
|
2013-04-07 07:30:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|