---
id: torrenthr
name: TorrentHR
description: "TorrentHR is a ratioless CROATIAN Private Torrent Tracker for 0DAY / GENERAL"
language: hr-HR
type: private
encoding: windows-1250
links:
  - https://www.torrenthr.org/

caps:
  categorymappings:
    - {id: 31, cat: TV/Anime, desc: "Anime"}
    - {id: 4, cat: Movies/SD, desc: "Filmovi/SD"}
    - {id: 18, cat: Movies/Foreign, desc: "Crtani Filmovi"}
    - {id: 5, cat: PC/Games, desc: "Igre/PC"}
    - {id: 7, cat: TV/SD, desc: "Serije/SD"}
    - {id: 1, cat: PC/0day, desc: "Aplikacije"}
    - {id: 14, cat: Movies/DVD, desc: "Filmovi/DVD"}
    - {id: 12, cat: TV/Documentary, desc: "Dokumentarni Filmovi"}
    - {id: 27, cat: Console/PS4, desc: "Igre/PS"}
    - {id: 34, cat: TV/HD, desc: "Serije/HD"}
    - {id: 25, cat: Books, desc: "E-books"}
    - {id: 17, cat: Movies/HD, desc: "Filmovi/HD"}
    - {id: 11, cat: Audio, desc: "Koncerti/Spotovi"}
    - {id: 28, cat: Console/Wii, desc: "Igre/Wii"}
    - {id: 30, cat: Books/Comics, desc: "Stripovi"}
    - {id: 38, cat: PC/Mobile-Other, desc: "Smartphone"}
    - {id: 40, cat: Movies/BluRay, desc: "Filmovi/BD"}
    - {id: 3, cat: Audio/MP3, desc: "Glazba/MP3"}
    - {id: 26, cat: Console/XBox, desc: "Igre/Xbox"}
    - {id: 10, cat: XXX, desc: "XXX/SD"}
    - {id: 16, cat: TV, desc: "THR Packs"}
    - {id: 15, cat: TV/Sport, desc: "Sport"}
    - {id: 29, cat: Audio/Lossless, desc: "Glazba/FLAC"}
    - {id: 13, cat: Other, desc: "Ostalo"}
    - {id: 36, cat: XXX, desc: "XXX/HD"}

  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: 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

login:
  path: takelogin.php
  method: post
  inputs:
    username: "{{ .Config.username }}"
    password: "{{ .Config.password }}"
    ssl: yes
  error:
    - selector: div.glavni:has(div.glavni_naslov:contains("Greška"))
  test:
    path: index.php
    selector: a[href*="logout.php"]

search:
  paths:
    - path: browse.php
  inputs:
    $raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
    search: "{{ if .Query.IMDBID }}{{ .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}"
    # 0 name, 1 descr, 2 both
    blah: "{{ if .Query.IMDBID }}2{{ else }}0{{ end }}"
    # 0 active, 1 incldead, 2 onlydead
    incldead: 1
    sort: "{{ .Config.sort }}"
    type: "{{ .Config.type }}"

  rows:
    selector: div.glavni_txt table > tbody > tr[id^="record-"]:not(:has(img[src="/pic/nuked.gif"]))

  fields:
    category:
      selector: a[href^="browse.php?cat="]
      attribute: href
      filters:
        - name: querystring
          args: cat
    title_default:
      selector: a[href^="details.php?id="]
    title_optional:
      optional: true
      selector: a[href^="details.php?id="][title]
      attribute: title
    title_optional2:
      optional: true
      selector: a[href^="details.php?id="][onmousemove]
      attribute: onmousemove
      filters:
        - name: regexp
          args: "return overlibImage\\('(.*)','.*'\\);"
    title:
      text: "{{ if or .Result.title_optional .Result.title_optional2 }}{{ or .Result.title_optional .Result.title_optional2 }}{{ else }}{{ .Result.title_default }}{{ end }}"
    details:
      selector: a[href^="details.php?id="]
      attribute: href
    download:
      selector: a[href^="download.php?id="]
      attribute: href
    files:
      selector: td:nth-child(5)
    size:
      selector: td:nth-child(7)
    grabs:
      selector: td:nth-child(8)
    seeders:
      selector: td:nth-child(9)
    leechers:
      selector: td:nth-child(10)
    poster:
      selector: a[href^="details.php?id="][onmousemove]
      attribute: onmousemove
      filters:
        - name: regexp
          args: "return overlibImage\\('.*','(.*)'\\);"
    downloadvolumefactor:
      text: 0
    uploadvolumefactor:
      text: 1
    date:
      selector: td:nth-child(2) > small
      # auto adjusted by site account profile
      filters:
        - name: replace
          args: [" u ", " "]
        - name: dateparse
          args: "dd.MM.yyyy HH:mm:ss"
    description:
      selector: td:nth-child(2)
      remove: a, br, small
    minimumratio:
      text: 1.0
    minimumseedtime:
      # 3 days (as seconds = 3 x 24 x 60 x 60)
      text: 259200
# engine tbd
