---
  site: dragonworldreloaded
  name: Dragonworld Reloaded
  description: "Dragonworld Reloaded is a GERMAN Private Torrent Tracker for MOVIES / TV / GENERAL"
  language: de-de
  type: private
  encoding: UTF-8
  links:
    - https://dragonworld-reloaded.net/

  caps:
    categorymappings:
      # Kino
      - {id: 118, cat: Movies/HD, desc: "Kino - HD"}
      - {id: 4, cat: Movies/SD, desc: "Kino - SD"}
      # Movies
      - {id: 18, cat: Movies/SD, desc: "Movies - x264/XviD"}
      - {id: 2, cat: Movies, desc: "Movies - Pack SD/HD"}
      - {id: 22, cat: Movies/DVD, desc: "Movies - DVD/HD2"}
      - {id: 52, cat: Movies, desc: "Movies - Kids"}
      - {id: 19, cat: Movies/HD, desc: "Movies - HD"}
      - {id: 25, cat: Movies/3D, desc: "Movies - 3D"}
      - {id: 26, cat: Movies/BluRay, desc: "Movies - Blu-Ray"}
      # Serien
      - {id: 40, cat: TV/SD, desc: "Serien - SD"}
      - {id: 41, cat: TV/HD, desc: "Serien - HD"}
      - {id: 42, cat: TV/SD, desc: "Serien - Pack SD"}
      - {id: 80, cat: TV/HD, desc: "Serien - Pack HD"}
      # Musik
      - {id: 119, cat: Audio, desc: "Musik - Alben"}
      - {id: 5, cat: Audio/MP3, desc: "Musik - Mp3"}
      - {id: 6, cat: Audio, desc: "Musik - Mixe"}
      - {id: 92, cat: Audio, desc: "Musik - Discography"}
      - {id: 114, cat: Audio, desc: "Musik - Musik Pack"}
      - {id: 48, cat: Audio/Video, desc: "Musik - Video"}
      # Doku
      - {id: 37, cat: TV/Documentary, desc: "Doku - SD"}
      - {id: 38, cat: TV/Documentary, desc: "Doku - HD"}
      - {id: 81, cat: TV/Documentary, desc: "Doku - Pack "}
      # Anime
      - {id: 73, cat: TV/Anime, desc: "Anime - Movies"}
      - {id: 74, cat: TV/Anime, desc: "Anime - Serien"}
      # Games
      - {id: 16, cat: PC/Games, desc: "Games - PC"}
      - {id: 14, cat: Console/Other, desc: "Games - Wimmelbild"}
      - {id: 7, cat: Console/PSP, desc: "Games - PSP"}
      - {id: 17, cat: Console/PS3, desc: "Games - PS2/PS3"}
      - {id: 29, cat: Console/NDS, desc: "Games - NDS/3DS"}
      - {id: 15, cat: Console/Wii, desc: "Games - Wii"}
      - {id: 8, cat: Console/Xbox, desc: "Games - XboX "}
      # Appz
      - {id: 30, cat: PC/0day, desc: "Appz - Windows"}
      - {id: 31, cat: PC/0day, desc: "Appz - Linux"}
      - {id: 32, cat: PC/Mac, desc: "Appz - Mac"}
      - {id: 106, cat: PC/Phone-Android, desc: "Appz - Android"}
      # Sport
      - {id: 43, cat: TV/Sport, desc: "Sport - SD"}
      - {id: 50, cat: TV/Sport, desc: "Sport - HD"}
      # Sonstiges
      - {id: 34, cat: Books, desc: "Sonstiges - E-Books"}
      - {id: 35, cat: Audio/Audiobook, desc: "Sonstiges - Audiobook"}
      - {id: 36, cat: Other, desc: "Sonstiges - Diverses"}
      # XXX
      - {id: 46, cat: XXX, desc: "XXX - SD"}
      - {id: 47, cat: XXX, desc: "XXX - HD"}
      - {id: 45, cat: XXX, desc: "XXX - Pack"}
      - {id: 49, cat: XXX, desc: "XXX - Sonstiges"}
      - {id: 110, cat: XXX, desc: "XXX - Hentai Serie"}
      - {id: 111, cat: XXX, desc: "XXX - Hentai Movie"}
      - {id: 116, cat: XXX, desc: "XXX - SexBooks"}

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

  settings:
    - name: username
      type: text
      label: Username
    - name: password
      type: password
      label: Password
    - name: pin
      type: text
      label: Pin     

  login:
    path: /login.php
    method: form
    form: form[action="/login.php"]
    cookies: ["JAVA=OK"] # avoid jscheck redirect
    captcha:
      type: image
      selector: img[src^="cap/captcha_math.php"]
      input: stringCaptcha
    inputs:
      username: "{{ .Config.username }}"
      password: "{{ .Config.password }}"
      pin: "{{ .Config.pin }}"
      loggiin: "einloggen"
    error:
      - selector: div#login_error
    test:
      path: selection.php

  download:
    before:
      path: "ajax_det_poll.php"
      method: "post"
      inputs:
        set_thanks: "thanks"
        det_id: "{{ .DownloadUri.Query.torrent }}"
        ajax: "yes"

  search:
    paths:
      - path: selection.php
    inputs:
      search: "{{ .Keywords }}"
      blah: "0"
      orderby: "added"
      sort: "desc"
    rows:
      selector: div.selection_wrap
    fields:
      download:
        selector: a.selection_a
        attribute: href
        filters:
          - name: replace
            args: ["details.php?id=", "download.php?torrent="]
      title:
        selector: a.selection_a
      details:
        selector: a.selection_a
        attribute: href
      category:
        selector: div.kat_cat_pic
        case:
          # Kino
          ":has(div.kat_cat_pic_name:contains(\"Kino\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "118"
          ":has(div.kat_cat_pic_name:contains(\"Kino\")):has(div.kat_cat_pic_name_b:contains(\"SD\"))": "4"
          # Movies
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"x264/XviD\"))": "18"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"Pack SD/HD\"))": "2"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"DVD/HD2\"))": "22"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"Kids\"))": "52"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "19"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"3D\"))": "25"
          ":has(div.kat_cat_pic_name:contains(\"Movies\")):has(div.kat_cat_pic_name_b:contains(\"Blu-Ray\"))": "26"
          # Serien
          ":has(div.kat_cat_pic_name:contains(\"Serien\")):has(div.kat_cat_pic_name_b:contains(\"SD\"))": "40"
          ":has(div.kat_cat_pic_name:contains(\"Serien\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "41"
          ":has(div.kat_cat_pic_name:contains(\"Serien\")):has(div.kat_cat_pic_name_b:contains(\"Pack SD\"))": "42"
          ":has(div.kat_cat_pic_name:contains(\"Serien\")):has(div.kat_cat_pic_name_b:contains(\"Pack HD\"))": "80"
          # Musik
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Alben\"))": "119"
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Mp3\"))": "5"
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Mixe\"))": "6"
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Discography\"))": "92"
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Musik Pack\"))": "114"
          ":has(div.kat_cat_pic_name:contains(\"Musik\")):has(div.kat_cat_pic_name_b:contains(\"Video\"))": "48"
          # Doku
          ":has(div.kat_cat_pic_name:contains(\"Doku\")):has(div.kat_cat_pic_name_b:contains(\"SD\"))": "37"
          ":has(div.kat_cat_pic_name:contains(\"Doku\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "38"
          ":has(div.kat_cat_pic_name:contains(\"Doku\")):has(div.kat_cat_pic_name_b:contains(\"Pack \"))": "81"
          # Anime
          ":has(div.kat_cat_pic_name:contains(\"Anime\")):has(div.kat_cat_pic_name_b:contains(\"Movies\"))": "73"
          ":has(div.kat_cat_pic_name:contains(\"Anime\")):has(div.kat_cat_pic_name_b:contains(\"Serien\"))": "74"
          # Games
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"PC\"))": "16"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"Wimmelbild\"))": "14"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"PSP\"))": "7"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"PS2/PS3\"))": "17"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"NDS/3DS\"))": "29"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"Wii\"))": "15"
          ":has(div.kat_cat_pic_name:contains(\"Games\")):has(div.kat_cat_pic_name_b:contains(\"XboX \"))": "8"
          # Appz
          ":has(div.kat_cat_pic_name:contains(\"Appz\")):has(div.kat_cat_pic_name_b:contains(\"Windows\"))": "30"
          ":has(div.kat_cat_pic_name:contains(\"Appz\")):has(div.kat_cat_pic_name_b:contains(\"Linux\"))": "31"
          ":has(div.kat_cat_pic_name:contains(\"Appz\")):has(div.kat_cat_pic_name_b:contains(\"Mac\"))": "32"
          ":has(div.kat_cat_pic_name:contains(\"Appz\")):has(div.kat_cat_pic_name_b:contains(\"Android\"))": "106"
          # Sport
          ":has(div.kat_cat_pic_name:contains(\"Sport\")):has(div.kat_cat_pic_name_b:contains(\"SD\"))": "43"
          ":has(div.kat_cat_pic_name:contains(\"Sport\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "50"
          # Sonstiges
          ":has(div.kat_cat_pic_name:contains(\"Sonstiges\")):has(div.kat_cat_pic_name_b:contains(\"E-Books\"))": "34"
          ":has(div.kat_cat_pic_name:contains(\"Sonstiges\")):has(div.kat_cat_pic_name_b:contains(\"Audiobook\"))": "35"
          ":has(div.kat_cat_pic_name:contains(\"Sonstiges\")):has(div.kat_cat_pic_name_b:contains(\"Diverses\"))": "36"
          # XXX
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"SD\"))": "46"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"HD\"))": "47"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"Pack\"))": "45"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"Sonstiges\"))": "49"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"Hentai Serie\"))": "110"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"Hentai Movie\"))": "111"
          ":has(div.kat_cat_pic_name:contains(\"XXX\")):has(div.kat_cat_pic_name_b:contains(\"SexBooks\"))": "116"
      banner:
        selector: div[id^="details"] img
        attribute: src
      size:
        selector: div.selection_unter_ad
        filters:
          - name: replace
            args: [".", ""]
          - name: replace
            args: [",", "."]
      grabs:
        selector: div.selection_unter_ae
        filters:
          - name: trim
            args: "x"
          - name: replace
            args: [".", ""]
          - name: replace
            args: [",", "."]
      seeders:
        selector: div.selection_unter_aa
        filters:
          - name: replace
            args: [".", ""]
          - name: replace
            args: [",", "."]
      leechers:
        selector: div.selection_unter_aaa
        filters:
          - name: replace
            args: [".", ""]
          - name: replace
            args: [",", "."]
      downloadvolumefactor:
        case:
          ":root:has(div.onlyup)": "0"
          "*": "1"
      uploadvolumefactor:
        case:
          "*": "1"
      date:
        selector: div.selection_unter_ab
        filters:
          - name: replace
            args: ["Heute", "Today"]
          - name: replace
            args: ["Gestern", "Yesterday"]
          - name: replace
            args: [" um", ""]
          - name: dateparse
            args: "02.01.2006 15:04:05"
      description:
        selector: selection_unter_af
        optional: true
