diff --git a/src/Jackett.Common/Definitions/theleachzone-api.yml b/src/Jackett.Common/Definitions/theleachzone-api.yml
new file mode 100644
index 000000000..91ec19c01
--- /dev/null
+++ b/src/Jackett.Common/Definitions/theleachzone-api.yml
@@ -0,0 +1,180 @@
+---
+id: theleachzone-api
+name: TheLeachZone (API)
+description: "The Leach Zone (TLZ) is a Private Torrent Tracker for MOVIES / TV / GENERAL"
+language: en-US
+type: private
+encoding: UTF-8
+links:
+ - https://tlzdigital.com/
+legacylinks:
+ - https://tlz.digital/
+
+caps:
+ categorymappings:
+ - {id: 2, cat: TV, desc: "TV"}
+ - {id: 1, cat: Movies, desc: "Movies"}
+ - {id: 3, cat: Audio, desc: "Music"}
+ - {id: 4, cat: Books, desc: "Books"}
+ - {id: 5, cat: Console, desc: "Games"}
+ - {id: 6, cat: PC, desc: "Application"}
+ - {id: 7, cat: Other, desc: "Other"}
+
+ modes:
+ search: [q]
+ tv-search: [q, season, ep, imdbid, tvdbid, tmdbid]
+ movie-search: [q, imdbid, tmdbid]
+ music-search: [q]
+ book-search: [q]
+
+settings:
+ - name: apikey
+ type: text
+ label: APIKey
+ - name: info_key
+ type: info
+ label: About your API key
+ default: "Find or Generate a new API Token by accessing your TLZ account Settings page and clicking on the API Key tab."
+ - name: freeleech
+ type: checkbox
+ label: Search freeleech only
+ default: false
+ - name: sort
+ type: select
+ label: Sort requested from site
+ default: created_at
+ options:
+ created_at: created
+ seeders: seeders
+ size: size
+ name: title
+ - name: type
+ type: select
+ label: Order requested from site
+ default: desc
+ options:
+ desc: desc
+ asc: asc
+ - name: info_activity
+ type: info
+ label: Account Inactivity
+ default: "
- Accounts with zero activity (0 bytes download and 0 bytes upload) are automatically deleted after 30 days.
- Inactive VIP and unparked accounts are automatically deleted after 40 days.
"
+
+login:
+ path: /api/torrents
+ method: get
+ error:
+ - selector: a[href*="/login"]
+ message:
+ text: "The API key was not accepted by {{ .Config.sitelink }}."
+
+search:
+ paths:
+ # https://github.com/HDInnovations/UNIT3D-Community-Edition/wiki/Torrent-API-(UNIT3D-v8.x.x)
+ # https://github.com/HDInnovations/UNIT3D-Community-Edition/blob/master/app/Http/Controllers/API/TorrentController.php#L476
+ - path: "/api/torrents/filter"
+ response:
+ type: json
+
+ headers:
+ Authorization: ["Bearer {{ .Config.apikey }}"]
+
+ inputs:
+ # if we have an id based search, add Season and Episode as query in name for UNIT3D < v6. Else pass S/E Params for UNIT3D >= v6
+ $raw: "{{ range .Categories }}&categories[]={{.}}{{end}}"
+ name: "{{ .Keywords }}"
+ seasonNumber: "{{ .Query.Season }}"
+ episodeNumber: "{{ .Query.Ep }}"
+ imdbId: "{{ .Query.IMDBIDShort }}"
+ tmdbId: "{{ .Query.TMDBID }}"
+ tvdbId: "{{ .Query.TVDBID }}"
+ "free[]": "{{ if .Config.freeleech }}100{{ else }}{{ end }}"
+ sortField: "{{ .Config.sort }}"
+ sortDirection: "{{ .Config.type }}"
+ perPage: 100
+
+ keywordsfilters:
+ - name: re_replace
+ args: ["\\.", " "]
+
+ rows:
+ selector: data
+ attribute: attributes
+
+ fields:
+ category:
+ selector: category_id
+ title:
+ selector: name
+ details:
+ selector: details_link
+ download:
+ selector: download_link
+ infohash:
+ selector: info_hash
+ poster:
+ selector: meta.poster
+ filters:
+ - name: replace
+ args: ["https://via.placeholder.com/90x135", ""]
+ imdbid:
+ selector: imdb_id
+ tmdbid:
+ selector: tmdb_id
+ tvdbid:
+ selector: tvdb_id
+ genre:
+ selector: meta.genres
+ filters:
+ - name: re_replace
+ args: ["(?i)^None$", ""]
+ - name: re_replace
+ args: ["(?i)(Science Fiction)", "Science_Fiction"]
+ - name: re_replace
+ args: ["(?i)(TV Movie)", "TV_Movie"]
+ - name: replace
+ args: [" & ", "_&_"]
+ description:
+ text: "{{ .Result.genre }}"
+ files:
+ selector: num_file
+ seeders:
+ selector: seeders
+ leechers:
+ selector: leechers
+ grabs:
+ selector: times_completed
+ date:
+ # "created_at": "2021-10-18T00:34:50.000000Z" is returned by Newtonsoft.Json.Linq as 18/10/2021 00:34:50
+ selector: created_at
+ filters:
+ - name: append
+ args: " +00:00" # GMT
+ - name: dateparse
+ args: "MM/dd/yyyy HH:mm:ss zzz"
+ size:
+ selector: size
+ downloadvolumefactor:
+ # api returns 0%, 25%, 50%, 75%, 100%
+ selector: freeleech
+ case:
+ 0%: 1 # not free
+ 25%: 0.75
+ 50%: 0.5
+ 75%: 0.25
+ 100%: 0 # freeleech
+ "*": 0 # catch errors
+ uploadvolumefactor:
+ # api returns False, True
+ selector: double_upload
+ case:
+ False: 1 # normal
+ True: 2 # double
+ minimumratio:
+ text: 1.0
+ minimumseedtime:
+ selector: freeleech
+ case:
+ 100%: 172800 # freeleech 2 days (as seconds = 2 x 24 x 60 x 60)
+ "*": 129600 # normal 36h (as seconds = 36 x 60 x 60)
+# json UNIT3D 7.2.5
diff --git a/src/Jackett.Common/Definitions/theleachzone.yml b/src/Jackett.Common/Definitions/theleachzone.yml
deleted file mode 100644
index 4fb3064da..000000000
--- a/src/Jackett.Common/Definitions/theleachzone.yml
+++ /dev/null
@@ -1,188 +0,0 @@
----
-id: theleachzone
-name: TheLeachZone
-description: "The Leach Zone (TLZ) is a Private Torrent Tracker for MOVIES / TV / GENERAL"
-language: en-US
-type: private
-encoding: UTF-8
-links:
- - https://tlz.digital/
-
-caps:
- categorymappings:
- - {id: 21, cat: PC, desc: "Appz"}
- - {id: 35, cat: Books/Comics, desc: "Comics/Mags"}
- - {id: 27, cat: Books/EBook, desc: "E-Books"}
- - {id: 28, cat: Console, desc: "Games/Console"}
- - {id: 22, cat: PC/Games, desc: "Games"}
- - {id: 33, cat: PC/Games, desc: "Games/PC"}
- - {id: 23, cat: Other, desc: "Misc"}
- - {id: 26, cat: Movies/SD, desc: "Movies/Cam"}
- - {id: 36, cat: Movies/Foreign, desc: "Movies/Foreign"}
- - {id: 11, cat: Movies/HD, desc: "Movies/HD"}
- - {id: 3, cat: Movies, desc: "Movies/Packs"}
- - {id: 24, cat: Movies/SD, desc: "Movies/SD"}
- - {id: 30, cat: Movies/UHD, desc: "Movies/UHD"}
- - {id: 37, cat: Movies/WEB-DL, desc: "Movies/Web-DL"}
- - {id: 20, cat: Audio/Lossless, desc: "Music/FLAC"}
- - {id: 4, cat: Audio/MP3, desc: "Music/MP3"}
- - {id: 17, cat: Audio, desc: "Music/Packs"}
- - {id: 34, cat: Audio/Video, desc: "Music/Video"}
- - {id: 31, cat: TV/Anime, desc: "TV/Anime"}
- - {id: 18, cat: TV/HD, desc: "TV/HD"}
- - {id: 16, cat: TV, desc: "TV/Packs"}
- - {id: 19, cat: TV/SD, desc: "TV/SD"}
- - {id: 29, cat: TV/UHD, desc: "TV/UHD"}
-
- modes:
- search: [q]
- tv-search: [q, season, ep, genre]
- movie-search: [q, genre]
- music-search: [q, genre]
- book-search: [q, genre]
-
-settings:
- - name: username
- type: text
- label: Username
- - name: password
- type: password
- label: Password
- - name: freeleech
- type: checkbox
- label: Search freeleech only
- default: false
- - name: sort
- type: select
- label: Sort requested from site
- default: 4
- options:
- 4: created
- 7: seeders
- 5: size
- 1: title
- - name: type
- type: select
- label: Order requested from site
- default: desc
- options:
- desc: desc
- asc: asc
- - name: info_tpp
- type: info
- label: Results Per Page
- default: For best results, change the Torrents per page: setting to 100 on your account profile.
- - name: info_activity
- type: info
- label: Account Inactivity
- default: "Accounts inactive for more than 42 days are automatically deleted."
-
-login:
- path: login.php
- method: form
- form: form[action="takelogin.php"]
- inputs:
- username: "{{ .Config.username }}"
- password: "{{ .Config.password }}"
- use_ssl: 1
- perm_ssl: ""
- returnto: /
- error:
- - selector: table.main:contains("Login failed!")
- message:
- selector: table tr td.colhead2
- test:
- path: /
- selector: a[href*="logout.php?hash_please="]
-
-search:
- paths:
- # https://tlz.digital/browse.php?c21=1&c22=1&c23=1&search=&searchin=title&incldead=0&sort=4&type=desc
- - path: browse.php
- inputs:
- $raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
- search: "{{ if .Query.Genre }}{{ .Query.Genre }} {{ else }}{{ end }}{{ .Keywords }}"
- # title, descr, genre, all
- searchin: "{{ if .Query.Genre }}all{{ else }}title{{ end }}"
- # 0 active, 1 incldead, 2 onlydead
- incldead: 1
- only_free: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
- sort: "{{ .Config.sort }}"
- type: "{{ .Config.type }}"
-
- keywordsfilters:
- - name: re_replace
- args: ["(\\w+)", "+$1"] # prepend + to each word
-
- rows:
- selector: table.table-bordered tr:has(a[href^="download.php?torrent="])
-
- fields:
- category:
- selector: a[href^="browse.php?cat="]
- attribute: href
- filters:
- - name: querystring
- args: cat
- title:
- selector: a[href^="details.php?id="]
- attribute: onmouseover
- filters:
- - name: regexp
- args: "Tip\\('(.+?)"
- details:
- selector: a[href^="details.php?id="]
- attribute: href
- download:
- selector: a[href^="download.php?torrent="]
- attribute: href
- poster:
- selector: a[href^="details.php?id="]
- attribute: onmouseover
- filters:
- - name: regexp
- args: src=\\'(.+?)\\'
- - name: replace
- args: ["./pic/noposter.png", ""]
- genre:
- selector: i
- description:
- text: "{{ .Result.genre }}"
- files:
- selector: td:nth-child(5)
- date_day:
- selector: td:nth-child(7):contains("day")
- # auto adjusted by site account profile
- optional: true
- filters:
- - name: fuzzytime
- date_year:
- selector: td:nth-child(7):not(:contains("day"))
- # auto adjusted by site account profile
- optional: true
- filters:
- - name: dateparse
- args: "MMM d yyyy hh:mm tt"
- date:
- text: "{{ if or .Result.date_day .Result.date_year }}{{ or .Result.date_day .Result.date_year }}{{ else }}now{{ end }}"
- size:
- selector: td:nth-child(8)
- grabs:
- selector: td:nth-child(9)
- seeders:
- selector: td:nth-child(10)
- leechers:
- selector: td:nth-child(11)
- downloadvolumefactor:
- case:
- "a.info:contains(\"[FREE]\")": 0
- "a.info:contains(\"[SILVER]\")": 0.5
- "*": 1
- uploadvolumefactor:
- text: 1
- minimumratio:
- text: 1.0
- minimumseedtime:
- # 2 days (as seconds = 2 x 24 x 60 x 60)
- text: 172800
-# U-232 V5
diff --git a/src/Jackett.Updater/Program.cs b/src/Jackett.Updater/Program.cs
index 32ff81bf2..42e740c05 100644
--- a/src/Jackett.Updater/Program.cs
+++ b/src/Jackett.Updater/Program.cs
@@ -623,6 +623,7 @@ namespace Jackett.Updater
"Definitions/the-devils-lounge.yml",
"Definitions/thedarkcommunity-api.yml",
"Definitions/thehorrorcharnel.yml",
+ "Definitions/theleachzone.yml", // switch to *-API #11185
"Definitions/the-madhouse.yml",
"Definitions/themoviecave.yml",
"Definitions/therebels-api.yml",