---
id: hdspain
name: HD-Spain
description: "HD-Spain is a SPANISH site for HD content"
language: es-ES
type: private
encoding: ISO-8859-1
links:
  - https://www.hd-spain.com/

caps:
  categorymappings:
    - {id: 1, cat: Movies/HD, desc: "Películas"}
    - {id: 5, cat: Movies/HD, desc: "Pelíc. Anim."}
    - {id: 4, cat: TV/HD, desc: "Series"}
    - {id: 3, cat: TV/HD, desc: "Series Anim."}
    - {id: 6, cat: TV/Documentary, desc: "Documentales"}
    - {id: 11, cat: TV/Sport, desc: "Deportes"}
    - {id: 7, cat: Audio/Video, desc: "Música/Espec."}
    - {id: 9, cat: TV/Other, desc: "Programas TV"}
    - {id: 8, cat: Audio/Lossless, desc: "Audios"}
    - {id: 10, cat: XXX/x264, desc: "XXX"}

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

settings:
  - name: cookie
    type: text
    label: Cookie
  - name: info
    type: info
    label: How to get the Cookie
    default: "<ol><li>Login to this tracker with your browser<li>Open the <b>DevTools</b> panel by pressing <b>F12</b><li>Select the <b>Network</b> tab<li>Click on the <b>Doc</b> button (Chrome Browser) or <b>HTML</b> button (FireFox)<li>Refresh the page by pressing <b>F5</b><li>Click on the first row entry<li>Select the <b>Headers</b> tab on the Right panel<li>Find <b>'cookie:'</b> in the <b>Request Headers</b> section<li><b>Select</b> and <b>Copy</b> the whole cookie string <i>(everything after 'cookie: ')</i> and <b>Paste</b> here.</ol>"

login:
  method: cookie
  inputs:
    cookie: "{{ .Config.cookie }}"
  test:
    path: index.php
    selector: .tcabecera

search:
  path: index.php
  keywordsfilters:
    - name: re_replace
      args: ["(?i)\\bS0*(\\d+)\\b", "T$1"]
    - name: re_replace
      args: ["(?i)S0?(\\d{1,2})E(\\d{1,2})", "$1x$2"]
  inputs:
    sec: listado
    ord: 9
    b: "{{ .Keywords }}"
    # 0 incldead, 1 onlyactive, 2 onlydead
    ver: 0
    # 0 new and relaunch, 1 onlynew, 2 onlyrelaunch
    relanz: 0
    $raw: "{{ range .Categories }}&cat[]={{.}}{{end}}"

  rows:
    selector: "table.listatorrents tr:not(:first-child)"

  fields:
    category:
      selector: td.categorias a
      attribute: href
      filters:
        - name: querystring
          args: cat
    extras:
      optional: true
      selector: td.titulo a[class]
      filters:
        - name: prepend
          args: "["
        - name: append
          args: "]"
        - name: re_replace
          args: ["(?i)(MEGAPACK)", "REPACK"]
        - name: re_replace
          args: ["(?i)(AUDIOEDITADO)", "PROPER"]
        - name: re_replace
          args: ["(?i)(VERSIÓN MEJORADA)", "PROPER"]
    title_vose:
      selector: td.titulo a[id]:contains("VOSE")
      optional: true
      filters:
        - name: append
          args: "{{ .Result.extras }} English"
        - name: re_replace
          args: ["(?i)T(\\d{1,2})\\b", "S$1"]
    title_notvose:
      selector: td.titulo a[id]:not(:contains("VOSE"))
      optional: true
      filters:
        - name: append
          args: "{{ .Result.extras }} Spanish"
        - name: re_replace
          args: ["(?i)T(\\d{1,2})\\b", "S$1"]
    title:
      text: "{{ if .Result.title_vose }}{{ .Result.title_vose }}{{ else }}{{ .Result.title_notvose }}{{ end }}"
    details:
      selector: td.titulo a[id]
      attribute: href
    download:
      selector: td.descargar a
      attribute: href
    description:
      selector: td.titulo a[class]
    size:
      selector: td.tamano
    seeders:
      selector: td.usuarios.seeds a
    leechers:
      selector: td.usuarios.leechers a
    grabs:
      selector: td.usuarios.completados
    date_optional:
      optional: true
      selector: td.fecha
      attribute: title
      filters:
        - name: replace
          args: ["Lunes", "Monday"]
        - name: replace
          args: ["Martes", "Tuesday"]
        - name: re_replace
          args: ["Miércoles", "Wednesday"]
        - name: replace
          args: ["Jueves", "Thursday"]
        - name: replace
          args: ["Viernes", "Friday"]
        - name: re_replace
          args: ["Sábado", "Saturday"]
        - name: replace
          args: ["Domingo", "Sunday"]
        - name: replace
          args: ["Enero", "January"]
        - name: replace
          args: ["Febrero", "February"]
        - name: replace
          args: ["Marzo", "March"]
        - name: replace
          args: ["Abril", "April"]
        - name: replace
          args: ["Mayo", "May"]
        - name: replace
          args: ["Junio", "June"]
        - name: replace
          args: ["Julio", "July"]
        - name: replace
          args: ["Agosto", "August"]
        - name: replace
          args: ["Septiembre", "September"]
        - name: replace
          args: ["Octubre", "October"]
        - name: replace
          args: ["Noviembre", "November"]
        - name: replace
          args: ["Diciembre", "December"]
        - name: append
          args: " +01:00" # CET
        - name: dateparse
          args: "Monday 2 January 2006, 15:04 -07:00"
    date:
      text: "{{ if .Result.date_optional }}{{ .Result.date_optional }}{{ else }}now{{ end }}"
    downloadvolumefactor_optional:
      optional: true
      selector: td.descargar a b strong
      case:
        "Freeleech": 0
        "Freeleech X2": 0
        "*": 1
    downloadvolumefactor:
      text: "{{ if .Result.downloadvolumefactor_optional }}{{ .Result.downloadvolumefactor_optional }}{{ else }}1{{ end }}"
    uploadvolumefactor_optional:
      optional: true
      selector: td.descargar a b strong
      case:
        "Freeleech X2": 2
        "*": 1
    uploadvolumefactor:
      text: "{{ if .Result.uploadvolumefactor_optional }}{{ .Result.uploadvolumefactor_optional }}{{ else }}1{{ end }}"
    minimumratio:
      text: 1.0
    minimumseedtime:
      text: 345600
# engine n/a
