parent
3d17498945
commit
1c8f94f1d8
@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1" ?>
|
||||
<rss version="0.91">
|
||||
<channel>
|
||||
<ttl>10</ttl>
|
||||
<title>BitMeTV.ORG</title>
|
||||
<link>http://www.bitmetv.org</link>
|
||||
<description>This is a private - by registration only - website. You can help keep it alive by donating: http://www.bitmetv.org/donate.php</description>
|
||||
<language>en-usde</language>
|
||||
<copyright>Copyright © 2004 - 2007 BitMeTV.ORG</copyright>
|
||||
<webMaster>noreply@bitmetv.org</webMaster>
|
||||
<image>
|
||||
<title>BitMeTV.ORG</title>
|
||||
<url>http://www.bitmetv.org/favicon.ico</url>
|
||||
<link>http://www.bitmetv.org</link>
|
||||
<width>16</width>
|
||||
<height>16</height>
|
||||
<description>This is a private - by registration only - website. You can help keep it alive by donating: http://www.bitmetv.org/donate.php</description>
|
||||
</image>
|
||||
<item>
|
||||
<title>Total.Divas.S02E08.HDTV.x264-CRiMSON</title>
|
||||
<link>http://www.bitmetv.org/download.php/12/Total.Divas.S02E08.HDTV.x264-CRiMSON.torrent</link>
|
||||
<pubDate>Tue, 13 May 2014 17:04:29 -0000</pubDate>
|
||||
<description>
|
||||
Category: (Reality TV - Un-scripted)
|
||||
Size: 376.71 MB
|
||||
</description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Aqua.Teen.Hunger.Force.S10.INTERNAL.HDTV.x264-BitMeTV</title>
|
||||
<link>http://www.bitmetv.org/download.php/34/Aqua.Teen.Hunger.Force.S10.INTERNAL.HDTV.x264-BitMeTV.torrent</link>
|
||||
<pubDate>Tue, 13 May 2014 17:03:12 -0000</pubDate>
|
||||
<description>
|
||||
Category: (Adult Swim)
|
||||
Size: 725.46 MB
|
||||
</description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Antiques.Roadshow.US.S18E16.720p.HDTV.x264-BAJSKORV</title>
|
||||
<link>http://www.bitmetv.org/download.php/56/Antiques.Roadshow.US.S18E16.720p.HDTV.x264-BAJSKORV.torrent</link>
|
||||
<pubDate>Tue, 13 May 2014 16:47:05 -0000</pubDate>
|
||||
<description>
|
||||
Category: (Reality TV - Un-scripted)
|
||||
Size: 960.15 MB
|
||||
</description>
|
||||
</item>
|
||||
<item>
|
||||
<title>Seth.Meyers.2014.05.12.Chris.O.Dowd-Emma.Roberts.HDTV.x264-CROOKS</title>
|
||||
<link>http://www.bitmetv.org/download.php/78/Seth.Meyers.2014.05.12.Chris.O.Dowd-Emma.Roberts.HDTV.x264-CROOKS.torrent</link>
|
||||
<pubDate>Tue, 13 May 2014 16:01:21 -0000</pubDate>
|
||||
<description>
|
||||
Category: Seth Meyers
|
||||
Size: 301.31 MB
|
||||
</description>
|
||||
</item>
|
||||
<item>
|
||||
<title>The.Mole.Australia.Season.4</title>
|
||||
<link>http://www.bitmetv.org/download.php/910/The%20Mole%20Australia%20-%20Season%204.torrent</link>
|
||||
<pubDate>Tue, 13 May 2014 15:52:54 -0000</pubDate>
|
||||
<description>
|
||||
Category: (Reality TV - Competitive)
|
||||
Size: 2.13 GB
|
||||
</description>
|
||||
</item>
|
||||
</channel>
|
||||
</rss>
|
@ -0,0 +1,74 @@
|
||||
[
|
||||
{
|
||||
"id": 665873,
|
||||
"name": "Storming.Juno.2010.1080p.BluRay.x264-GUACAMOLE",
|
||||
"imdb": "tt1776305",
|
||||
"freeleech": 0,
|
||||
"upload_date": "2020-01-25 22:20:19",
|
||||
"download_link": "https://filelist.ro/download.php?id=665873&passkey=somepass",
|
||||
"size": 8300512414,
|
||||
"internal": 0,
|
||||
"moderated": 1,
|
||||
"category": "Filme HD",
|
||||
"seeders": 12,
|
||||
"leechers": 2,
|
||||
"times_completed": 11,
|
||||
"comments": 0,
|
||||
"files": 3,
|
||||
"small_description": "History, War"
|
||||
},
|
||||
{
|
||||
"id": 665872,
|
||||
"name": "Storming.Juno.2010.720p.BluRay.x264-GUACAMOLE",
|
||||
"imdb": "tt1776305",
|
||||
"freeleech": 0,
|
||||
"upload_date": "2020-01-25 22:19:37",
|
||||
"download_link": "https://filelist.ro/download.php?id=665872&passkey=somepass",
|
||||
"size": 4731949881,
|
||||
"internal": 0,
|
||||
"moderated": 1,
|
||||
"category": "Filme HD",
|
||||
"seeders": 9,
|
||||
"leechers": 1,
|
||||
"times_completed": 8,
|
||||
"comments": 0,
|
||||
"files": 3,
|
||||
"small_description": "History, War"
|
||||
},
|
||||
{
|
||||
"id": 665870,
|
||||
"name": "Summer.Holiday.1963.1080p.BluRay.x264-SPOOKS",
|
||||
"imdb": "tt0057541",
|
||||
"freeleech": 1,
|
||||
"upload_date": "2020-01-25 21:48:20",
|
||||
"download_link": "https://filelist.ro/download.php?id=665870&passkey=somepass",
|
||||
"size": 8325717640,
|
||||
"internal": 0,
|
||||
"moderated": 1,
|
||||
"category": "Filme HD",
|
||||
"seeders": 20,
|
||||
"leechers": 6,
|
||||
"times_completed": 22,
|
||||
"comments": 0,
|
||||
"files": 5,
|
||||
"small_description": "Comedy, Musical"
|
||||
},
|
||||
{
|
||||
"id": 665868,
|
||||
"name": "Ride.Like.a.Girl.2019.1080p.BluRay.DD5.1.x264-playHD",
|
||||
"imdb": "tt7600382",
|
||||
"freeleech": 1,
|
||||
"upload_date": "2020-01-25 20:32:22",
|
||||
"download_link": "https://filelist.ro/download.php?id=665868&passkey=somepass",
|
||||
"size": 15514501683,
|
||||
"internal": 1,
|
||||
"moderated": 1,
|
||||
"category": "Filme HD",
|
||||
"seeders": 63,
|
||||
"leechers": 4,
|
||||
"times_completed": 80,
|
||||
"comments": 0,
|
||||
"files": 1,
|
||||
"small_description": "Biography, Drama, Sport"
|
||||
}
|
||||
]
|
@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<rss version="2.0">
|
||||
|
||||
<channel>
|
||||
<title>Womble's NZB Index</title>
|
||||
<link>http://indexer.local/</link>
|
||||
<description>NZB Index</description>
|
||||
<webMaster>my.email@internet.me</webMaster>
|
||||
<ttl>15</ttl>
|
||||
|
||||
|
||||
<item>
|
||||
<title>One.Child.S01E01.720p.HDTV.x264-TLA</title>
|
||||
<link>http://indexer.local/nzb/bb4/One.Child.S01E01.720p.HDTV.x264-TLA.nzb</link>
|
||||
<description>
|
||||
One.Child.S01E01.720p.HDTV.x264-TLA
|
||||
(Size:956 Mb)
|
||||
</description>
|
||||
<category>tv-hd</category>
|
||||
<pubDate>2/17/2016 11:03:52 PM</pubDate>
|
||||
<guid isPermaLink="true">http://indexer.local/nzb/bb4/One.Child.S01E01.720p.HDTV.x264-TLA.nzb</guid>
|
||||
<enclosure url="http://indexer.local/nzb/bb4/One.Child.S01E01.720p.HDTV.x264-TLA.nzb" length="2048" type="text/xml" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Midsomer.Murders.S18E06.Harvest.Of.Souls.HDTV.x264-ORGANiC</title>
|
||||
<link>http://indexer.local/nzb/17c/Midsomer.Murders.S18E06.Harvest.Of.Souls.HDTV.x264-ORGANiC.nzb</link>
|
||||
<description>
|
||||
Midsomer.Murders.S18E06.Harvest.Of.Souls.HDTV.x264-ORGANiC
|
||||
(Size:730 Mb)
|
||||
</description>
|
||||
<category>tv-sd</category>
|
||||
<pubDate>2/17/2016 10:55:33 PM</pubDate>
|
||||
<guid isPermaLink="true">http://indexer.local/nzb/17c/Midsomer.Murders.S18E06.Harvest.Of.Souls.HDTV.x264-ORGANiC.nzb</guid>
|
||||
<enclosure url="http://indexer.local/nzb/17c/Midsomer.Murders.S18E06.Harvest.Of.Souls.HDTV.x264-ORGANiC.nzb" length="2048" type="text/xml" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Forget.and.Forgive.2014.HDTV.x264-SQUEAK</title>
|
||||
<link>http://indexer.local/nzb/f3f/Forget.and.Forgive.2014.HDTV.x264-SQUEAK.nzb</link>
|
||||
<description>
|
||||
Forget.and.Forgive.2014.HDTV.x264-SQUEAK
|
||||
(Size:719 Mb)
|
||||
</description>
|
||||
<category>tv-sd</category>
|
||||
<pubDate>2/17/2016 10:25:28 PM</pubDate>
|
||||
<guid isPermaLink="true">http://indexer.local/nzb/f3f/Forget.and.Forgive.2014.HDTV.x264-SQUEAK.nzb</guid>
|
||||
<enclosure url="http://indexer.local/nzb/f3f/Forget.and.Forgive.2014.HDTV.x264-SQUEAK.nzb" length="2048" type="text/xml" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>National.Geographic.The.Lakeshore.Killers.HDTV.x264-SQUEAK</title>
|
||||
<link>http://indexer.local/nzb/828/National.Geographic.The.Lakeshore.Killers.HDTV.x264-SQUEAK.nzb</link>
|
||||
<description>
|
||||
National.Geographic.The.Lakeshore.Killers.HDTV.x264-SQUEAK
|
||||
(Size:436 Mb)
|
||||
</description>
|
||||
<category>tv-sd</category>
|
||||
<pubDate>2/17/2016 10:20:36 PM</pubDate>
|
||||
<guid isPermaLink="true">http://indexer.local/nzb/828/National.Geographic.The.Lakeshore.Killers.HDTV.x264-SQUEAK.nzb</guid>
|
||||
<enclosure url="http://indexer.local/nzb/828/National.Geographic.The.Lakeshore.Killers.HDTV.x264-SQUEAK.nzb" length="2048" type="text/xml" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<title>Desert.Lands.of.The.Middle.East.E01.Turkeys.Harsh.Paradise.HDTV.x264-SQUEAK</title>
|
||||
<link>http://indexer.local/nzb/210/Desert.Lands.of.The.Middle.East.E01.Turkeys.Harsh.Paradise.HDTV.x264-SQUEAK.nzb</link>
|
||||
<description>
|
||||
Desert.Lands.of.The.Middle.East.E01.Turkeys.Harsh.Paradise.HDTV.x264-SQUEAK
|
||||
(Size:460 Mb)
|
||||
</description>
|
||||
<category>tv-sd</category>
|
||||
<pubDate>2/17/2016 10:18:29 PM</pubDate>
|
||||
<guid isPermaLink="true">http://indexer.local/nzb/210/Desert.Lands.of.The.Middle.East.E01.Turkeys.Harsh.Paradise.HDTV.x264-SQUEAK.nzb</guid>
|
||||
<enclosure url="http://indexer.local/nzb/210/Desert.Lands.of.The.Middle.East.E01.Turkeys.Harsh.Paradise.HDTV.x264-SQUEAK.nzb" length="2048" type="text/xml" />
|
||||
</item>
|
||||
|
||||
</channel>
|
||||
</rss>
|
@ -0,0 +1,57 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using NzbDrone.Core.Indexers.FileList;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.FileListTests
|
||||
{
|
||||
[TestFixture]
|
||||
public class FileListFixture : CoreTest<FileList>
|
||||
{
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Subject.Definition = new IndexerDefinition()
|
||||
{
|
||||
Name = "FileList",
|
||||
Settings = new FileListSettings() { Username = "someuser", Passkey = "somepass" }
|
||||
};
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_parse_recent_feed_from_FileList()
|
||||
{
|
||||
var recentFeed = ReadAllText(@"Files/Indexers/FileList/recentfeed.json");
|
||||
|
||||
Mocker.GetMock<IHttpClient>()
|
||||
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
|
||||
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
|
||||
|
||||
var releases = Subject.FetchRecent();
|
||||
|
||||
releases.Should().HaveCount(4);
|
||||
releases.First().Should().BeOfType<TorrentInfo>();
|
||||
|
||||
var torrentInfo = releases.First() as TorrentInfo;
|
||||
|
||||
torrentInfo.Title.Should().Be("Storming.Juno.2010.1080p.BluRay.x264-GUACAMOLE");
|
||||
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
|
||||
torrentInfo.DownloadUrl.Should().Be("https://filelist.ro/download.php?id=665873&passkey=somepass");
|
||||
torrentInfo.InfoUrl.Should().Be("https://filelist.ro/details.php?id=665873");
|
||||
torrentInfo.CommentUrl.Should().BeNullOrEmpty();
|
||||
torrentInfo.Indexer.Should().Be(Subject.Definition.Name);
|
||||
torrentInfo.PublishDate.Should().Be(DateTime.Parse("2020-01-25 22:20:19"));
|
||||
torrentInfo.Size.Should().Be(8300512414);
|
||||
torrentInfo.InfoHash.Should().Be(null);
|
||||
torrentInfo.MagnetUrl.Should().Be(null);
|
||||
torrentInfo.Peers.Should().Be(2 + 12);
|
||||
torrentInfo.Seeders.Should().Be(12);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
using System.Linq;
|
||||
using FluentAssertions;
|
||||
using Newtonsoft.Json;
|
||||
using NUnit.Framework;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers.FileList;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Test.Framework;
|
||||
|
||||
namespace NzbDrone.Core.Test.IndexerTests.FileListTests
|
||||
{
|
||||
public class FileListRequestGeneratorFixture : CoreTest<FileListRequestGenerator>
|
||||
{
|
||||
private MovieSearchCriteria _movieSearchCriteria;
|
||||
|
||||
[SetUp]
|
||||
public void Setup()
|
||||
{
|
||||
Subject.Settings = new FileListSettings()
|
||||
{
|
||||
BaseUrl = "http://127.0.0.1:1234/",
|
||||
Categories = new[] { 1, 2 },
|
||||
Passkey = "abcd",
|
||||
Username = "somename"
|
||||
};
|
||||
|
||||
_movieSearchCriteria = new MovieSearchCriteria
|
||||
{
|
||||
Movie = new Movies.Movie { ImdbId = "tt0076759", Title = "Star Wars", Year = 1977 }
|
||||
};
|
||||
}
|
||||
|
||||
private void MovieWithoutIMDB()
|
||||
{
|
||||
_movieSearchCriteria.Movie.ImdbId = null;
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_use_categories_for_feed()
|
||||
{
|
||||
var results = Subject.GetRecentRequests();
|
||||
|
||||
results.GetAllTiers().Should().HaveCount(1);
|
||||
|
||||
var page = results.GetAllTiers().First().First();
|
||||
|
||||
page.Url.Query.Should().Contain("&category=1,2&");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_not_search_by_imdbid_if_not_supported()
|
||||
{
|
||||
var results = Subject.GetSearchRequests(_movieSearchCriteria);
|
||||
|
||||
results.GetAllTiers().Should().HaveCount(1);
|
||||
|
||||
var page = results.GetAllTiers().First().First();
|
||||
|
||||
page.Url.Query.Should().Contain("type=imdb");
|
||||
page.Url.Query.Should().Contain("query=tt0076759");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_search_by_name_and_year_if_missing_imdbid()
|
||||
{
|
||||
MovieWithoutIMDB();
|
||||
|
||||
var results = Subject.GetSearchRequests(_movieSearchCriteria);
|
||||
|
||||
results.GetAllTiers().Should().HaveCount(1);
|
||||
|
||||
var page = results.GetAllTiers().First().First();
|
||||
|
||||
page.Url.Query.Should().Contain("type=name");
|
||||
page.Url.Query.Should().Contain("query=Star Wars 1977");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
using NLog;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Configuration;
|
||||
using NzbDrone.Core.Parser;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
public class FileList : HttpIndexerBase<FileListSettings>
|
||||
{
|
||||
public override string Name => "FileList.ro";
|
||||
public override DownloadProtocol Protocol => DownloadProtocol.Torrent;
|
||||
public override bool SupportsRss => true;
|
||||
public override bool SupportsSearch => true;
|
||||
|
||||
public FileList(IHttpClient httpClient, IIndexerStatusService indexerStatusService, IConfigService configService, IParsingService parsingService, Logger logger)
|
||||
: base(httpClient, indexerStatusService, configService, parsingService, logger)
|
||||
{
|
||||
}
|
||||
|
||||
public override IIndexerRequestGenerator GetRequestGenerator()
|
||||
{
|
||||
return new FileListRequestGenerator() { Settings = Settings };
|
||||
}
|
||||
|
||||
public override IParseIndexerResponse GetParser()
|
||||
{
|
||||
return new FileListParser(Settings);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
public class FileListTorrent
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public long Size { get; set; }
|
||||
public int Leechers { get; set; }
|
||||
public int Seeders { get; set; }
|
||||
[JsonProperty(PropertyName = "times_completed")]
|
||||
public uint TimesCompleted { get; set; }
|
||||
public uint Comments { get; set; }
|
||||
public uint Files { get; set; }
|
||||
[JsonProperty(PropertyName = "imdb")]
|
||||
public string ImdbId { get; set; }
|
||||
[JsonProperty(PropertyName = "freeleech")]
|
||||
public bool FreeLeech { get; set; }
|
||||
[JsonProperty(PropertyName = "upload_date")]
|
||||
public DateTime UploadDate { get; set; }
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Newtonsoft.Json;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.Indexers.Exceptions;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
public class FileListParser : IParseIndexerResponse
|
||||
{
|
||||
private readonly FileListSettings _settings;
|
||||
|
||||
public FileListParser(FileListSettings settings)
|
||||
{
|
||||
_settings = settings;
|
||||
}
|
||||
|
||||
public IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
|
||||
{
|
||||
var torrentInfos = new List<ReleaseInfo>();
|
||||
|
||||
if (indexerResponse.HttpResponse.StatusCode != HttpStatusCode.OK)
|
||||
{
|
||||
throw new IndexerException(indexerResponse,
|
||||
"Unexpected response status {0} code from API request",
|
||||
indexerResponse.HttpResponse.StatusCode);
|
||||
}
|
||||
|
||||
var queryResults = JsonConvert.DeserializeObject<List<FileListTorrent>>(indexerResponse.Content);
|
||||
|
||||
foreach (var result in queryResults)
|
||||
{
|
||||
var id = result.Id;
|
||||
|
||||
IndexerFlags flags = 0;
|
||||
|
||||
if (result.FreeLeech)
|
||||
{
|
||||
flags |= IndexerFlags.G_Freeleech;
|
||||
}
|
||||
|
||||
var imdbId = 0;
|
||||
if (result.ImdbId.Length > 2)
|
||||
{
|
||||
imdbId = int.Parse(result.ImdbId.Substring(2));
|
||||
}
|
||||
|
||||
torrentInfos.Add(new TorrentInfo()
|
||||
{
|
||||
Guid = string.Format("FileList-{0}", id),
|
||||
Title = result.Name,
|
||||
Size = result.Size,
|
||||
DownloadUrl = GetDownloadUrl(id),
|
||||
InfoUrl = GetInfoUrl(id),
|
||||
Seeders = result.Seeders,
|
||||
Peers = result.Leechers + result.Seeders,
|
||||
PublishDate = result.UploadDate,
|
||||
ImdbId = imdbId,
|
||||
IndexerFlags = flags
|
||||
});
|
||||
}
|
||||
|
||||
return torrentInfos.ToArray();
|
||||
}
|
||||
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
private string GetDownloadUrl(string torrentId)
|
||||
{
|
||||
var url = new HttpUri(_settings.BaseUrl)
|
||||
.CombinePath("/download.php")
|
||||
.AddQueryParam("id", torrentId)
|
||||
.AddQueryParam("passkey", _settings.Passkey);
|
||||
|
||||
return url.FullUri;
|
||||
}
|
||||
|
||||
private string GetInfoUrl(string torrentId)
|
||||
{
|
||||
var url = new HttpUri(_settings.BaseUrl)
|
||||
.CombinePath("/details.php")
|
||||
.AddQueryParam("id", torrentId);
|
||||
|
||||
return url.FullUri;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common.Extensions;
|
||||
using NzbDrone.Common.Http;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
public class FileListRequestGenerator : IIndexerRequestGenerator
|
||||
{
|
||||
public FileListSettings Settings { get; set; }
|
||||
public Func<IDictionary<string, string>> GetCookies { get; set; }
|
||||
public Action<IDictionary<string, string>, DateTime?> CookiesUpdater { get; set; }
|
||||
|
||||
public virtual IndexerPageableRequestChain GetRecentRequests()
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
pageableRequests.Add(GetRequest("latest-torrents", ""));
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
public virtual IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria)
|
||||
{
|
||||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
if (searchCriteria.Movie.ImdbId.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
pageableRequests.Add(GetRequest("search-torrents", string.Format("&type=imdb&query={0}", searchCriteria.Movie.ImdbId)));
|
||||
}
|
||||
else
|
||||
{
|
||||
var titleYearSearchQuery = string.Format("{0} {1}", searchCriteria.Movie.Title, searchCriteria.Movie.Year);
|
||||
pageableRequests.Add(GetRequest("search-torrents", string.Format("&type=name&query={0}", titleYearSearchQuery.Trim())));
|
||||
}
|
||||
|
||||
return pageableRequests;
|
||||
}
|
||||
|
||||
private IEnumerable<IndexerRequest> GetRequest(string searchType, string parameters)
|
||||
{
|
||||
var categoriesQuery = string.Join(",", Settings.Categories.Distinct());
|
||||
|
||||
var baseUrl = string.Format("{0}/api.php?action={1}&category={2}&username={3}&passkey={4}{5}", Settings.BaseUrl.TrimEnd('/'), searchType, categoriesQuery, Settings.Username.Trim(), Settings.Passkey.Trim(), parameters);
|
||||
|
||||
yield return new IndexerRequest(baseUrl, HttpAccept.Json);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
using System.Collections.Generic;
|
||||
using FluentValidation;
|
||||
using NzbDrone.Core.Annotations;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Validation;
|
||||
|
||||
namespace NzbDrone.Core.Indexers.FileList
|
||||
{
|
||||
public class FileListSettingsValidator : AbstractValidator<FileListSettings>
|
||||
{
|
||||
public FileListSettingsValidator()
|
||||
{
|
||||
RuleFor(c => c.BaseUrl).ValidRootUrl();
|
||||
RuleFor(c => c.Username).NotEmpty();
|
||||
RuleFor(c => c.Passkey).NotEmpty();
|
||||
|
||||
RuleFor(c => c.SeedCriteria).SetValidator(_ => new SeedCriteriaSettingsValidator());
|
||||
}
|
||||
}
|
||||
|
||||
public class FileListSettings : ITorrentIndexerSettings
|
||||
{
|
||||
private static readonly FileListSettingsValidator Validator = new FileListSettingsValidator();
|
||||
|
||||
public FileListSettings()
|
||||
{
|
||||
BaseUrl = "https://filelist.ro";
|
||||
MinimumSeeders = IndexerDefaults.MINIMUM_SEEDERS;
|
||||
|
||||
Categories = new int[] { (int)FileListCategories.Movie_HD, (int)FileListCategories.Movie_SD, (int)FileListCategories.Movie_4K };
|
||||
MultiLanguages = new List<int>();
|
||||
RequiredFlags = new List<int>();
|
||||
}
|
||||
|
||||
[FieldDefinition(0, Label = "Username")]
|
||||
public string Username { get; set; }
|
||||
|
||||
[FieldDefinition(1, Label = "Passkey")]
|
||||
public string Passkey { get; set; }
|
||||
|
||||
//[FieldDefinition(2, Type = FieldType.Tag, SelectOptions = typeof(Language), Label = "Multi Languages", HelpText = "What languages are normally in a multi release on this indexer?", Advanced = true)]
|
||||
public IEnumerable<int> MultiLanguages { get; set; }
|
||||
|
||||
[FieldDefinition(3, Label = "API URL", Advanced = true, HelpText = "Do not change this unless you know what you're doing. Since your API key will be sent to that host.")]
|
||||
public string BaseUrl { get; set; }
|
||||
|
||||
[FieldDefinition(4, Label = "Categories", Type = FieldType.TagSelect, SelectOptions = typeof(FileListCategories), Advanced = true, HelpText = "Categories for use in search and feeds. If unspecified, all options are used.")]
|
||||
public IEnumerable<int> Categories { get; set; }
|
||||
|
||||
[FieldDefinition(5, Type = FieldType.Number, Label = "Minimum Seeders", HelpText = "Minimum number of seeders required.", Advanced = true)]
|
||||
public int MinimumSeeders { get; set; }
|
||||
|
||||
[FieldDefinition(6, Type = FieldType.TagSelect, SelectOptions = typeof(IndexerFlags), Label = "Required Flags", HelpText = "What indexer flags are required?", HelpLink = "https://github.com/Radarr/Radarr/wiki/Indexer-Flags#1-required-flags", Advanced = true)]
|
||||
public IEnumerable<int> RequiredFlags { get; set; }
|
||||
|
||||
[FieldDefinition(7)]
|
||||
public SeedCriteriaSettings SeedCriteria { get; set; } = new SeedCriteriaSettings();
|
||||
|
||||
public NzbDroneValidationResult Validate()
|
||||
{
|
||||
return new NzbDroneValidationResult(Validator.Validate(this));
|
||||
}
|
||||
}
|
||||
|
||||
public enum FileListCategories
|
||||
{
|
||||
Movie_SD = 1,
|
||||
Movie_DVD = 2,
|
||||
Movie_DVDRO = 3,
|
||||
Movie_HD = 4,
|
||||
Movie_HDRO = 19,
|
||||
Movie_BluRay = 20,
|
||||
Movie_BluRay4K = 26,
|
||||
Movie_3D = 25,
|
||||
Movie_4K = 6,
|
||||
Xxx = 7
|
||||
}
|
||||
}
|
Loading…
Reference in new issue