---
  site: inperil
  name: inPeril
  description: "InPeril is a LATVIAN Private Torrent Tracker for 0DAY / GENERAL"
  type: private
  language: lv-lv
  type: private
  encoding: UTF-8
  links:
    - http://www.inperil.net/

  caps:
    categorymappings:
      - {id: 34, cat: TV/Anime, desc: "Animation"}
      - {id: 22, cat: PC/0day, desc: "Appz"}
      - {id: 25, cat: PC/Games, desc: "Games/Console"}
      - {id: 4, cat: PC/Games, desc: "Games/PC"}
      - {id: 27, cat: Other/Misc, desc: "Misc"}
      - {id: 35, cat: Movies/HD, desc: "Movies/HD"}
      - {id: 37, cat: Movies/Foreign, desc: "Movies/LAT"}
      - {id: 42, cat: Movies, desc: "Movies/Pack"}
      - {id: 38, cat: Movies, desc: "Movies/Retro"}
      - {id: 36, cat: Movies/Foreign, desc: "Movies/RUS"}
      - {id: 19, cat: Movies/SD, desc: "Movies/SD"}
      - {id: 6, cat: Audio, desc: "Music"}
      - {id: 26, cat: Audio/Video, desc: "Music Videos"}
      - {id: 31, cat: Audio/Lossless, desc: "Music/FLAC"}
      - {id: 39, cat: TV/HD, desc: "TV/HD"}
      - {id: 43, cat: TV, desc: "TV/Pack"}
      - {id: 7, cat: TV/SD, desc: "TV/SD"}
      - {id: 40, cat: XXX, desc: "XXX/HD"}

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

  login:
    path: /takelogin.php
    method: post
    inputs:
      username: "{{ .Config.username }}"
      password: "{{ .Config.password }}"
    error:
      - selector: font.logintext
    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="])
    fields:
      title:
        selector: a[href^="details.php?id="][title]
        attribute: title
      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
      files:
        selector: td:nth-child(3)
      size:
        selector: td:nth-child(6)
      date:
        selector: td:nth-child(5)
        filters:
          - name: append
            args: " +02:00"
          - name: dateparse
            args: "2006-01-0215:04:05 -07:00"
      grabs:
        selector: td:nth-child(7)
        filters:
          - name: regexp
            args: ([,\d]+)
      seeders:
        selector: td:nth-child(8)
      leechers:
        selector: td:nth-child(9)
      banner:
        selector: a[onmouseover][href^="details.php?id="]
        attribute: onmouseover
        filters:
          - name: regexp
            args: src=([^\s]+)
      downloadvolumefactor:
        case:
          "img[alt=\"Zelta Torrents\"]": "0"
          "img[alt=\"Sudraba Torrents\"]": "0.5"
          "*": "1"
      uploadvolumefactor:
        case:
          "*": "1"
