예제 #1
0
        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;
        }
예제 #2
0
        protected override ReleaseInfo ProcessItem(XElement item, ReleaseInfo releaseInfo)
        {
            releaseInfo = base.ProcessItem(item, releaseInfo);

            releaseInfo.TvdbId = GetTvdbId(item);
            releaseInfo.TvRageId = GetTvRageId(item);

            return releaseInfo;
        }
예제 #3
0
        protected override ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult)
        {
            var torrentInfo = (TorrentInfo)currentResult;

            torrentInfo.MagnetUrl = MagnetUrl(item);
            torrentInfo.InfoHash = InfoHash(item);

            return torrentInfo;
        }
예제 #4
0
        public static int? GetSeeders(ReleaseInfo release)
        {
            var torrentInfo = release as TorrentInfo;

            if (torrentInfo == null)
            {
                return null;
            }
            return torrentInfo.Seeders;
        }
예제 #5
0
        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);
        }
예제 #6
0
        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);
        }
예제 #7
0
        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;
        }
예제 #8
0
        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);
        }
예제 #9
0
        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;
        }
예제 #10
0
        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;
        }
예제 #11
0
 protected virtual ReleaseInfo PostProcessor(XElement item, ReleaseInfo currentResult)
 {
     return currentResult;
 }
예제 #12
0
        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);
        }
예제 #13
0
파일: RssParser.cs 프로젝트: nnic/Sonarr
        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;
        }
예제 #14
0
파일: RssParser.cs 프로젝트: nnic/Sonarr
 protected virtual ReleaseInfo PostProcess(XElement item, ReleaseInfo releaseInfo)
 {
     return releaseInfo;
 }
예제 #15
0
 public ReleaseDownloadException(ReleaseInfo release, String message, params Object[] args)
     : base(message, args)
 {
     Release = release;
 }
예제 #16
0
 public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException)
     : base(message, innerException)
 {
     Release = release;
 }
예제 #17
0
 public ReleaseDownloadException(ReleaseInfo release, string message, Exception innerException, params object[] args)
     : base(message, innerException, args)
 {
     Release = release;
 }
예제 #18
0
 public ReleaseDownloadException(ReleaseInfo release, string message)
     : base(message)
 {
     Release = release;
 }