protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo) { var torrentInfo = base.ProcessItem(item, releaseInfo) as TorrentInfo; torrentInfo.TvdbId = GetTvdbId(item); torrentInfo.TvRageId = GetTvRageId(item); return torrentInfo; }
protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo) { releaseInfo = base.ProcessItem(item, releaseInfo); releaseInfo.TvdbId = GetTvdbId(item); releaseInfo.TvRageId = GetTvRageId(item); return releaseInfo; }
protected override ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult) { var torrentInfo = (TorrentInfo)currentResult; torrentInfo.MagnetUrl = MagnetUrl(item); torrentInfo.InfoHash = InfoHash(item); return torrentInfo; }
public static int? GetSeeders(ReleaseInfo release) { var torrentInfo = release as TorrentInfo; if (torrentInfo == null) { return null; } return torrentInfo.Seeders; }
protected override ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo) { var enclosureType = item.Element("enclosure").Attribute("type").Value; if (!enclosureType.Contains("application/x-bittorrent")) { throw new UnsupportedFeedException("Feed contains {0} instead of application/x-bittorrent", enclosureType); } return base.PostProcess(item, releaseInfo); }
protected override ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo) { var verified = item.FindDecendants("verified").SingleOrDefault(); if (Settings != null && Settings.VerifiedOnly && (string)verified == "0") { return null; } return base.PostProcess(item, releaseInfo); }
protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo) { var result = base.ProcessItem(item, releaseInfo) as TorrentInfo; result.InfoHash = GetInfoHash(item); result.MagnetUrl = GetMagnetUrl(item); result.Seeders = GetSeeders(item); result.Peers = GetPeers(item); return result; }
protected override ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo) { var verified = item.FindDecendants("verified").SingleOrDefault(); if (Settings != null && Settings.VerifiedOnly && (string)verified == "0") { return null; } // Atm, Kickass supplies 0 as seeders and leechers on the rss feed for recent releases, so set it to null if there aren't any peers. // But only for releases younger than 12h (the real number seems to be close to 14h, but it depends on a number of factors). var torrentInfo = releaseInfo as TorrentInfo; if (torrentInfo.Peers.HasValue && torrentInfo.Peers.Value == 0 && torrentInfo.PublishDate > DateTime.UtcNow.AddHours(-12)) { torrentInfo.Seeders = null; torrentInfo.Peers = null; } return base.PostProcess(item, releaseInfo); }
protected override ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult) { if (currentResult != null) { var attributes = item.Elements("attr").ToList(); var rageIdElement = attributes.SingleOrDefault(e => e.Attribute("name").Value.Equals("rageid", StringComparison.CurrentCultureIgnoreCase)); if (rageIdElement != null) { int tvRageId; if (Int32.TryParse(rageIdElement.Attribute("value").Value, out tvRageId)) { currentResult.TvRageId = tvRageId; } } } return currentResult; }
public static ReleaseInfo ToModel(this ReleaseResource resource) { ReleaseInfo model; if (resource.Protocol == DownloadProtocol.Torrent) { model = new TorrentInfo { MagnetUrl = resource.MagnetUrl, InfoHash = resource.InfoHash, Seeders = resource.Seeders, Peers = (resource.Seeders.HasValue && resource.Leechers.HasValue) ? (resource.Seeders + resource.Leechers) : null }; } else { model = new ReleaseInfo(); } model.Guid = resource.Guid; model.Title = resource.Title; model.Size = resource.Size; model.DownloadUrl = resource.DownloadUrl; model.InfoUrl = resource.InfoUrl; model.CommentUrl = resource.CommentUrl; model.IndexerId = resource.IndexerId; model.Indexer = resource.Indexer; model.DownloadProtocol = resource.DownloadProtocol; model.TvdbId = resource.TvdbId; model.TvRageId = resource.TvRageId; model.PublishDate = resource.PublishDate; return model; }
protected virtual ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult) { return currentResult; }
protected override ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo) { var enclosureType = GetEnclosure(item).Attribute("type").Value; if (enclosureType.Contains("application/x-bittorrent")) { throw new UnsupportedFeedException("Feed contains {0}, did you intend to add a Torznab indexer?", enclosureType); } return base.PostProcess(item, releaseInfo); }
protected virtual ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo) { releaseInfo.Guid = GetGuid(item); releaseInfo.Title = GetTitle(item); releaseInfo.PublishDate = GetPublishDate(item); releaseInfo.DownloadUrl = GetDownloadUrl(item); releaseInfo.InfoUrl = GetInfoUrl(item); releaseInfo.CommentUrl = GetCommentUrl(item); try { releaseInfo.Size = GetSize(item); } catch (Exception) { throw new SizeParsingException("Unable to parse size from: {0}", releaseInfo.Title); } return releaseInfo; }
protected virtual ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo) { return releaseInfo; }
public ReleaseDownloadException(ReleaseInfo release, String message, params Object[] args) : base(message, args) { Release = release; }
public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException) : base(message, innerException) { Release = release; }
public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException, params object[] args) : base(message, innerException, args) { Release = release; }
public ReleaseDownloadException(ReleaseInfo release, string message) : base(message) { Release = release; }