Run pre-commit
This commit is contained in:
@@ -9,4 +9,4 @@ public class SyncYtsJob(ICrawlerProvider crawlerProvider) : BaseJob(crawlerProvi
|
||||
public static readonly JobKey Key = new(JobName, nameof(Literals.CrawlersJobs));
|
||||
public static readonly TriggerKey Trigger = new($"{JobName}-trigger", nameof(Literals.CrawlersJobs));
|
||||
protected override string Crawler => nameof(YtsCrawler);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,19 +26,19 @@ public class YtsCrawler(IHttpClientFactory httpClientFactory, ILogger<YtsCrawler
|
||||
Seeders = 0,
|
||||
Leechers = 0,
|
||||
};
|
||||
|
||||
|
||||
HandleInfoHash(itemNode, torrent, "InfoHash");
|
||||
|
||||
|
||||
return torrent;
|
||||
}
|
||||
|
||||
protected override void HandleInfoHash(XElement itemNode, Torrent torrent, string infoHashKey)
|
||||
{
|
||||
var infoHash = itemNode.Element(Mappings[infoHashKey])?.Attribute("url")?.Value.Split("/download/").ElementAtOrDefault(1);
|
||||
|
||||
|
||||
if (infoHash is not null)
|
||||
{
|
||||
torrent.InfoHash = infoHash;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user