---
  site: thetorrents
  name: The-Torrents
  description: "The-Torrents is a ROMANIAN Private Torrent Tracker for MOVIES / TV / GENERAL"
  language: ro-ro
  type: private
  encoding: UTF-8
  links:
    - http://the-torrents.org/

  caps:
    categorymappings:
      - {id: 1, cat: TV/Anime, desc: "Anime Movies"}
      - {id: 2, cat: TV/Anime, desc: "Anime Movies-Ro"}
      - {id: 3, cat: Movies/SD, desc: "BDRip Movies"}
      - {id: 4, cat: Movies/SD, desc: "BDRip Movies Ro"}
      - {id: 5, cat: Movies/BluRay, desc: "BluRay Movies"}
      - {id: 6, cat: Movies/BluRay, desc: "BluRay Movies Ro"}
      - {id: 7, cat: Movies/SD, desc: "Cam/TS Movies"}
      - {id: 8, cat: Movies/SD, desc: "Cam/TS Movies Ro"}
      - {id: 9, cat: Movies/DVD, desc: "DVD Movies"}
      - {id: 10, cat: Movies/DVD, desc: "DVD Movies Ro"}
      - {id: 11, cat: Movies/HD, desc: "HD Movies"}
      - {id: 12, cat: Movies/HD, desc: "HD Movies Ro"}
      - {id: 24, cat: Movies/SD, desc: "XVID Movies"}
      - {id: 25, cat: Movies/SD, desc: "XVID Movies Ro"}
      - {id: 16, cat: Movies, desc: "Old Movies"}
      - {id: 17, cat: Movies, desc: "Old Movies Ro"}
      - {id: 18, cat: Movies, desc: "Movie Packs"}
      - {id: 19, cat: Movies, desc: "Movie Packs Ro"}
      - {id: 15, cat: PC/Phone-Other, desc: "Mobile"}
      - {id: 20, cat: TV/SD, desc: "TV Episodes"}
      - {id: 21, cat: TV/SD, desc: "TV Episodes Ro"}
      - {id: 22, cat: TV/SD, desc: "TV Series"}
      - {id: 23, cat: TV/SD, desc: "TV Series Ro"}
      - {id: 13, cat: TV/HD, desc: "HDTV Episodes"}
      - {id: 14, cat: TV/HD, desc: "HDTV Episodes Ro"}
      - {id: 46, cat: TV/HD, desc: "HDTV Series"}
      - {id: 47, cat: TV/HD, desc: "HDTV Series Ro"}
      - {id: 27, cat: XXX, desc: "Adult Movies"}
      - {id: 30, cat: PC/Games, desc: "PC-ISO Games"}
      - {id: 31, cat: PC/Games, desc: "PC-RIP Games"}
      - {id: 32, cat: PC/Games, desc: "GOG Games"}
      - {id: 33, cat: PC/Games, desc: "Game Packs"}
      - {id: 34, cat: Console/Xbox, desc: "XBOX Games"}
      - {id: 35, cat: Console/Xbox360, desc: "XBOX-360 Games"}
      - {id: 36, cat: Console/PS3, desc: "Sony PS2 Games"}
      - {id: 37, cat: Console/PS3, desc: "Sony PS3 Games"}
      - {id: 38, cat: Console/PSP, desc: "Sony PSP Games"}
      - {id: 39, cat: Console/PS3, desc: "Sony PSX Games"}
      - {id: 40, cat: Console/Other, desc: "Nintendo Games"}
      - {id: 41, cat: Console/Wii, desc: "WII Games"}
      - {id: 42, cat: PC/Games, desc: "Game Updates"}
      - {id: 48, cat: PC/Games, desc: "Game Cheats"}
      - {id: 28, cat: Audio, desc: "Music"}
      - {id: 29, cat: Audio/Video, desc: "Music Videos"}
      - {id: 26, cat: PC/0day, desc: "Software"}
      - {id: 43, cat: Other, desc: "Documents"}
      - {id: 44, cat: Other, desc: "Images"}
      - {id: 49, cat: Other, desc: "Diverse"}
      - {id: 45, cat: PC/0day, desc: "Linux"}
      - {id: 50, cat: TV/Sport, desc: "Sport"}

    modes:
      search: [q]
      tv-search: [q, season, ep]

  login:
    path: /login.php
    method: form
    form: form[action="takelogin.php"]
    inputs:
      username: "{{ .Config.username }}"
      password: "{{ .Config.password }}"
    error:
      - selector: table.main > tbody > tr > td.embedded td.text:contains("incorrect")
    test:
      path: /browse.php

  search:
    paths:
      - path: /browse.php
    inputs:
      $raw: "{{range .Categories}}c{{.}}=1&{{end}}"
      search: "{{ .Query.Keywords }}"
      incldead: "1"
    rows:
      selector: table > tbody > tr:has(a[href^="details.php?id="])
      dateheaders:
        selector: td[colspan="9"] > b
        optional: true
        filters:
          - name: dateparse
            args: "Monday 2-January-2006"
    fields:
      title:
        selector: a[href^="details.php?id="]
      details:
        selector: a[href^="details.php?id="]
        attribute: href
      category:
        selector: a[href^="browse.php?cat="]
        attribute: href
        filters:
          - name: querystring
            args: cat
      download:
        selector: a[href^="/download.php"]
        attribute: href
      description:
        selector: td:nth-child(2) > small
        optional: true
        filters:
          - name: append
            args: "\n<br>"
      description|append|1:
        selector: img[title="RoSubbed"]
        optional: true
        filters:
          - name: append
            args: "RoSubbed\n<br>"
      banner:
        selector: a[href^="details.php?id="]
        attribute: onmouseover
        filters:
          - name: regexp
            args: "src=(.+?) "
          - name: replace
            args: ["pic/noposter.jpg", ""]
      files:
        selector: td:nth-child(4)
      grabs:
        selector: td:nth-child(7)
        filters:
          - name: regexp
            args: (\d+)
      size:
        selector: td:nth-child(6)
      seeders:
        selector: td:nth-child(8)
      leechers:
        selector: td:nth-child(9)
      downloadvolumefactor:
        case:
          img[title="FreeLeech"]: "0"
          "*": "1"
      uploadvolumefactor:
        case:
          img[title="DoubleUpload"]: "2"
          "*": "1"
