mirror of
https://github.com/Jackett/Jackett
synced 2025-01-01 04:38:20 +00:00
cardigann: add attribute for download selector (#6891)
This commit is contained in:
parent
74dcf37352
commit
9413006524
58 changed files with 82 additions and 14 deletions
|
@ -140,6 +140,7 @@
|
|||
download:
|
||||
# the .torrent url is on the on the details page
|
||||
selector: ul li a[href^="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -125,6 +125,7 @@
|
|||
thanks: 1
|
||||
rndval: "1487013827343"
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="/download/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -55,7 +55,8 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
- path: browse.php
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
download:
|
||||
selector: a[ href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
download:
|
||||
selector: a#magnetOpen
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
- path: "search/{{if .Keywords}}{{ .Keywords}}{{else}}2019{{end}}"
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
- path: torrents-search.php
|
||||
|
|
|
@ -92,6 +92,7 @@
|
|||
infohash: "\"{{ .DownloadUri.Query.id }}\""
|
||||
thanks: 1
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -142,6 +142,7 @@
|
|||
to: "give"
|
||||
torrent: "{{ .DownloadUri.Query.id }}"
|
||||
selector: a:contains("Télécharger ce torrent")
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -284,6 +284,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -185,6 +185,7 @@
|
|||
thanks: 1
|
||||
rndval: "1487013827343"
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# https://dxp.ru/torrents.php?search=&sort=4&type=desc
|
||||
|
|
|
@ -297,6 +297,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
|
||||
download:
|
||||
selector: a.linktorrent
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
path: "{{ if .Keywords }}torrents-search.php{{else}}torrents.php{{end}}"
|
||||
|
|
|
@ -76,6 +76,7 @@
|
|||
text: "{{ .Config.thankyou }}"
|
||||
submit: Opslaan
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="/download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# http://firebit.net/index.php?do=search&type=simple&q=2019
|
||||
|
|
|
@ -233,6 +233,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="/Telechargement/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
download:
|
||||
selector: a#download_torrent
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -179,6 +179,7 @@
|
|||
to: "give"
|
||||
torrent: "{{ .DownloadUri.Query.id }}"
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
thanks: "1"
|
||||
rndval: "1487013827343"
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -50,6 +50,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# https://hdreactor.net/index.php?do=search&subaction=search&showposts=1&story=2019&catlist[]=2001&catlist[]=2006
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
|
||||
download:
|
||||
selector: a.btn-magnet
|
||||
attribute: href
|
||||
filters:
|
||||
- name: querystring
|
||||
args: url
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="/torrentfiles/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="/dl.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
download:
|
||||
# the .torrent url is on the on the details page
|
||||
selector: a.csprite_dltorrent[href^="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
download:
|
||||
selector: a#download-file
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="/torrents/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
download:
|
||||
selector: a.torrent_download
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -660,6 +660,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="./download/file.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# http://www.nntt.org/search.php?sr=topics&sf=titleonly&fp=1&tracker_search=torrent&keywords=2019&fid[]=154
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -626,6 +626,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -295,6 +295,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="./download/file.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# http://rus-media.org/search.php?tracker_search=torrent&sr=topics&keywords=2019&fid[]=54
|
||||
|
|
|
@ -50,9 +50,10 @@
|
|||
- selector: div.recover-error2
|
||||
test:
|
||||
path: profile.php
|
||||
|
||||
|
||||
download:
|
||||
selector: a[href^="download.php/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href*="/torrent/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# https://seedpeer.me/today
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
_action: "say_thank"
|
||||
id: "{{ .DownloadUri.Query.id }}"
|
||||
selector: a[href^="downloadnew.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="/album/download-torrent/"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
path: recherche
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
type: info
|
||||
label: How to get the Cookie
|
||||
default: "<ol><li>Login to this tracker in your browser<li>Open the <b>DevTools</b> panel by pressing <b>F12</b><li>Select the <b>Network</b> tab<li>Click on the <b>Doc</b> button<li>Refresh the page by pressing <b>F5</b><li>Select the <b>Headers</b> tab<li>Find 'cookie:' in the <b>Request Headers</b> section<li>Copy & paste the whole cookie string to here</ol>"
|
||||
|
||||
|
||||
login:
|
||||
method: cookie
|
||||
inputs:
|
||||
|
@ -100,7 +100,8 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="download.php?id="]
|
||||
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
- path: browse.php
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
torrent: "{{ .DownloadUri.Query.id }}"
|
||||
submit: "Thanks!"
|
||||
selector: a[href^="download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
---
|
||||
---
|
||||
site: tfile
|
||||
name: TFile
|
||||
description: "TFile is a RUSSIAN Public Torrent Tracker for MOVIES / TV / GENERAL"
|
||||
|
@ -854,6 +854,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
@ -923,4 +924,4 @@
|
|||
text: 0
|
||||
uploadvolumefactor:
|
||||
text: 1
|
||||
# engine n/a
|
||||
# engine n/a
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
inputs:
|
||||
torrentid: "{{ .DownloadUri.Query.id }}"
|
||||
selector: a[href*="/download.php?id="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
download:
|
||||
selector: a#torrent
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
# http://topnow.se/search.php?dayq=mandalorian
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
download:
|
||||
selector: a[href^="magnet:?"]
|
||||
attribute: href
|
||||
|
||||
|
||||
search:
|
||||
paths:
|
||||
- path: "{{ if .Keywords }}/search_torrent/{{ re_replace .Keywords \"[']+\" \"\" }}/page-0{{else}}/top_torrent.html{{end}}"
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="{{ .Config.downloadlink }}"]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -67,6 +67,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="magnet:?xt="]
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
# https://torrentparadise.org/search.php?f=monday+night
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="d.php?keyalert1="]
|
||||
attribute: href
|
||||
filters:
|
||||
- name: replace
|
||||
args: ["d.php?keyalert1=", "/dI.php/"]
|
||||
|
|
|
@ -1330,6 +1330,7 @@
|
|||
|
||||
download:
|
||||
selector: a[href^="./download/file.php?id="]:not(img)
|
||||
attribute: href
|
||||
|
||||
search:
|
||||
paths:
|
||||
|
|
|
@ -1734,13 +1734,23 @@ namespace Jackett.Common.Indexers
|
|||
if (response.IsRedirect)
|
||||
response = await RequestStringWithCookies(response.RedirectingTo);
|
||||
var results = response.Content;
|
||||
var SearchResultParser = new HtmlParser();
|
||||
var SearchResultDocument = SearchResultParser.ParseDocument(results);
|
||||
var DlUri = SearchResultDocument.QuerySelector(selector);
|
||||
if (DlUri != null)
|
||||
var searchResultParser = new HtmlParser();
|
||||
var searchResultDocument = searchResultParser.ParseDocument(results);
|
||||
var downloadElement = searchResultDocument.QuerySelector(selector);
|
||||
if (downloadElement != null)
|
||||
{
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): Download selector {1} matched:{2}", ID, selector, DlUri.ToHtmlPretty()));
|
||||
var href = DlUri.GetAttribute("href");
|
||||
logger.Debug(string.Format("CardigannIndexer ({0}): Download selector {1} matched:{2}", ID, selector, downloadElement.ToHtmlPretty()));
|
||||
var href = "";
|
||||
if (Download.Attribute != null)
|
||||
{
|
||||
href = downloadElement.GetAttribute(Download.Attribute);
|
||||
if (href == null)
|
||||
throw new Exception(string.Format("Attribute \"{0}\" is not set for element {1}", Download.Attribute, downloadElement.ToHtmlPretty()));
|
||||
}
|
||||
else
|
||||
{
|
||||
href = downloadElement.TextContent;
|
||||
}
|
||||
href = applyFilters(href, Download.Filters, variables);
|
||||
link = resolvePath(href, link);
|
||||
}
|
||||
|
|
|
@ -197,6 +197,7 @@ namespace Jackett.Common.Models
|
|||
public class downloadBlock
|
||||
{
|
||||
public string Selector { get; set; }
|
||||
public string Attribute { get; set; }
|
||||
public List<filterBlock> Filters { get; set; }
|
||||
public string Method { get; set; }
|
||||
public requestBlock Before { get; set; }
|
||||
|
|
Loading…
Reference in a new issue