1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-21 22:05:43 -04:00

New: Implemented Torrent Download Clients: uTorrent, Transmission and Deluge. And several public and private Torrent Indexers.

This commit is contained in:
MythJuha
2014-05-13 19:57:46 +02:00
committed by Taloth Saldono
parent ffa814f387
commit 67cd5703a1
134 changed files with 11018 additions and 99 deletions
@@ -0,0 +1,87 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.Indexers
{
public class EzrssTorrentRssParser : TorrentRssParser
{
public const String ns = "{http://xmlns.ezrss.it/0.1/}";
public EzrssTorrentRssParser()
{
UseGuidInfoUrl = true;
UseEnclosureLength = false;
UseEnclosureUrl = true;
}
protected virtual XElement GetEzrssElement(XElement item, String name)
{
var element = item.Element(ns + name);
if (element == null)
{
element = item.Element(ns + "torrent");
if (element != null)
{
element = element.Element(ns + name);
}
}
return element;
}
protected override Int64 GetSize(XElement item)
{
var contentLength = GetEzrssElement(item, "contentLength");
if (contentLength != null)
{
return (Int64)contentLength;
}
return base.GetSize(item);
}
protected override String GetInfoHash(XElement item)
{
var infoHash = GetEzrssElement(item, "infoHash");
return (String)infoHash;
}
protected override String GetMagnetUrl(XElement item)
{
var magnetURI = GetEzrssElement(item, "magnetURI");
return (String)magnetURI;
}
protected override Int32? GetSeeders(XElement item)
{
var seeds = GetEzrssElement(item, "seeds");
if (seeds != null)
{
return (Int32)seeds;
}
return base.GetPeers(item);
}
protected override Int32? GetPeers(XElement item)
{
var peers = GetEzrssElement(item, "peers");
if (peers != null)
{
return (Int32)peers;
}
return base.GetPeers(item);
}
}
}