---
id: torrentleech-pl
name: Torrentleech.pl
description: "Torrentleech.pl is a POLISH Private Torrent Tracker for 0DAY / GENERAL"
language: pl-PL
type: private
encoding: UTF-8
links:
  - https://torrentleech.pl/

caps:
  categorymappings:
    - {id: 32, cat: PC, desc: "Aplikacje PC"}
    - {id: 33, cat: Books, desc: "eBooki/AudioBooki/Prasa"}
    - {id: 65, cat: Movies/3D, desc: "Filmy/3D"}
    - {id: 69, cat: Movies/UHD, desc: "Filmy/4K UHD"}
    - {id: 28, cat: TV/Anime, desc: "Filmy/Animowane"}
    - {id: 66, cat: Movies/BluRay, desc: "Filmy/BDRip"}
    - {id: 61, cat: Movies/BluRay, desc: "Filmy/BRRip"}
    - {id: 67, cat: Movies, desc: "Filmy/CAM-TC-TS"}
    - {id: 58, cat: TV/Documentary, desc: "Filmy/Dokumentalne"}
    - {id: 39, cat: Movies/HD, desc: "Filmy/Full HD"}
    - {id: 36, cat: Movies/HD, desc: "Filmy/HD Ready"}
    - {id: 64, cat: Movies, desc: "Filmy/Kino Polskie"}
    - {id: 59, cat: Movies, desc: "Filmy/PACK"}
    - {id: 40, cat: Movies/SD, desc: "Filmy/SD"}
    - {id: 68, cat: Movies/WEB-DL, desc: "Filmy/WEB-DL"}
    - {id: 62, cat: Console, desc: "Gry/Dodatki"}
    - {id: 41, cat: Console, desc: "Gry/Konsole"}
    - {id: 42, cat: PC/Games, desc: "Gry/PC"}
    - {id: 44, cat: PC/Mobile-Other, desc: "GSM/PDA"}
    - {id: 57, cat: Audio/Video, desc: "Koncerty/Teledyski"}
    - {id: 63, cat: Audio/Lossless, desc: "Muzyka/FLAC"}
    - {id: 46, cat: Audio/MP3, desc: "Muzyka/MP3"}
    - {id: 47, cat: Other, desc: "Różne"}
    - {id: 60, cat: TV/Sport, desc: "Sport"}
    - {id: 53, cat: TV, desc: "TV Seriale"}
    - {id: 56, cat: XXX, desc: "XXX"}
    - {id: 70, cat: TV/Anime, desc: "Anime"}

  modes:
    search: [q]
    tv-search: [q, season, ep, imdbid]
    movie-search: [q, imdbid]
    music-search: [q]
    book-search: [q]

settings:
  - name: username
    type: text
    label: Username
  - name: password
    type: password
    label: Password
  - name: freeleech
    type: checkbox
    label: Search freeleech only
    default: false
  - name: drop_polish_prefix
    type: checkbox
    label: Drop the Polish title prefix
    default: false
  - name: info_flaresolverr
    type: info_flaresolverr
  - name: info_activity
    type: info
    label: Account Inactivity
    default: "Users of the Power User class and below who have been inactive for more than 62 days are deleted. Therefore, if for some reason you can't enter TorrentLeech.pl for a while, Park your account. You won't be able to download torrents, but you can be sure that you won't have to log in for 122 days. However, if you do not log in to your account after this time, it will be deleted."

login:
  path: login.php
  method: form
  form: form[action="takelogin.php"]
  captcha:
    type: image
    selector: img[src="img.php?size=5"]
    input: vImageCodP
  inputs:
    username: "{{ .Config.username }}"
    password: "{{ .Config.password }}"
  error:
    - selector: td.embedded:has(h2:contains("Logowanie nie udane!"))
  test:
    path: index.php
    selector: a[href^="logout.php"]

search:
  paths:
    # https://torrentleech.pl/browse.php?c60=1&c53=1&search=&incldead=1&titlesearch=0&polish=0&cat_film=&napisy=0
    - path: browse.php
  inputs:
    $raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
    search: "{{ if .Query.IMDBID }}{{ .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}"
    # 0 onlyactive, 1 all, 2 onlydead, 3 free
    incldead: "{{ if .Config.freeleech }}3{{ else }}1{{ end }}"
    # 0 title, 1 descr, 2 both
    titlesearch: "{{ if .Query.IMDBID }}1{{ else }}0{{ end }}"
    # 0 all, 1 polish, 2 not polish
    polish: 0
    cat_film: ""
    # subtitles: 0 everything,  1 yes,  2 no
    napisy: 0
    # can search by genre but you need the id. &cat_film=1 for akcja.

  keywordsfilters:
    # remove the year from the titles as the site chokes on them during search #7424
    - name: re_replace
      args: [" +(?:19|20)\\d{2} *$", ""]

  rows:
    selector: table[border="1"][cellspacing="0"][cellpadding="5"] > tbody > tr:has(a[href^="details.php?id="])
    filters:
      - name: andmatch

  fields:
    category:
      selector: a[href^="browse.php?cat="]
      attribute: href
      filters:
        - name: querystring
          args: cat
    title_raw:
      selector: a[href^="details.php?id="]
    title_stripped:
      selector: a[href^="details.php?id="]
      filters:
        - name: re_replace
          args: ["^(.*/)(.*)$", "$2"]
        - name: trim
    title:
      text: "{{ if .Config.drop_polish_prefix }}{{ .Result.title_stripped }}{{ else }}{{ .Result.title_raw }}{{ end }}"
      filters:
        - name: re_replace
          args: ["(?i)^\\[PACK\\]\\s*", ""]
    details:
      selector: a[href^="details.php?id="]
      attribute: href
    download:
      selector: a[href^="download.php/"]
      attribute: href
    imdbid:
      selector: a[href*="imdb.com/title/tt"]
      attribute: href
    genre:
      selector: font[color="blue"]
      filters:
        - name: validate
          args: "akcja, animacja, anime, biograficzny, czarna komedia, dokumentalny, dramat, dramat historyczny, edukacyjny, etiuda, familijny, fantasy, gangsterski, historyczny, horror, katastroficzny, komedia, komedia kryminalna, komedia obyczajowa, komedia romantyczna, krótkometrażowy, kryminał, melodramat, musical, muzyczny, niemy, przygodowy, romans, sci-fi, sensacyjny, sportowy, szpiegowski, thriller, western, wojenny"
    _language:
      optional: true
      selector: img[src="pic/pl.jpg"]
      filters:
        - name: append
          args: "Language: polish\n<br>"
    _subbed:
      optional: true
      selector: img[src="pic/napisy.gif"]
      filters:
        - name: append
          args: "Subbed\n<br>"
    description:
      text: "{{ .Result._language }}{{ .Result._subbed }}{{ if .Result.genre }}Genres: {{ .Result.genre }}{{ else }}{{ end }}"
    date:
      selector: td:nth-child(4)
      # auto adjusted by site account profile
      filters:
        - name: dateparse
          args: "yyyy-MM-ddHH:mm:ss"
    size:
      selector: td:nth-child(5)
    grabs:
      selector: td:nth-child(6)
    seeders:
      selector: td:nth-child(7)
      filters:
        - name: split
          args: ["/", 0]
    leechers:
      selector: td:nth-child(7)
      filters:
        - name: split
          args: ["/", 1]
    downloadvolumefactor:
      case:
        tr.darmowy: 0
        "*": 1
    uploadvolumefactor:
      text: 1
    minimumseedtime:
      # 2 days (as seconds = 2 x 24 x 60 x 60)
      text: 172800
# engine n/a
