---
id: hqmusic
name: HQMusic
description: "HQMusic is a VIETNAMESE Private Torrent Tracker for MUSIC"
language: vi-VN
type: private
encoding: UTF-8
links:
  - https://tracker.hqmusic.info/

caps:
  categorymappings:
    - {id: 1, cat: Audio, desc: "Music"}

  modes:
    search: [q]
    music-search: [q, album, artist]

settings:
  - name: cookie
    type: text
    label: Cookie
  - name: info_cookie
    type: info_cookie
  - name: freeleech
    type: checkbox
    label: Search freeleech only
    default: false
  - 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
  - name: info_activity
    type: info
    label: Account Inactivity
    default: "Inactive accounts will be deleted according to the following rules:<ol><li> Power Users and above will never have their accounts deleted.</li><li>Users and above will never have their accounts deleted if they park their accounts (See [User CP]).</li><li>Parked accounts will be deleted if they do not log in within 365 days.</li><li>Unparked accounts will be deleted if they do not log in within 240 days.</li><li>Inactive accounts downloading or uploading on the tracker will be deleted after 240 days of not logging in or after 120 days from the time of registration.</li></ol>"

login:
  # switched from the form method to the cookie method due to https://github.com/Prowlarr/Prowlarr/issues/792
  method: cookie
  inputs:
    cookie: "{{ .Config.cookie }}"
  test:
    path: index.php
    selector: a[href="logout.php"]

search:
  paths:
    # https://tracker.hqmusic.info/torrents.php?search=&search_area=0&search_mode=0&incldead=0&haslog=0&cue=0&cover=0&tracks=0&spstate=0
    - path: torrents.php
  inputs:
    search: "{{ if .Query.Artist }}{{ .Query.Artist }}{{ else }}{{ end }}{{ if .Query.Album }} {{ .Query.Album }}{{ else }}{{ end }}{{ if or .Query.Artist .Query.Album }}{{ else }}{{ .Keywords }}{{ end }}"
    # 0 title, 1 descr, 3 uploader, 4 imdburl
    search_area: 0
    # 0 AND, 1 OR, 2 exact
    search_mode: 0
    # 0 incldead, 1 active, 2 dead
    incldead: 0
    # 0 has log, 1 yes, 2 no, 3 100% only, 4 100% Unscored
    haslog: 0
    # 0 cue, 1 yes, 2 no
    cue: 0
    # 0 cover, 1 yes, 2 no
    cover: 0
    # tracks, 1 yes, 2 no
    tracks: 0
    # 0 all, 1 normal, 2 free, 3 2x, 4 2xfree, 5 50%, 6 2x50%, 7 30%
    spstate: "{{ if .Config.freeleech }}2{{ else }}0{{ end }}"
    sort: "{{ .Config.sort }}"
    type: "{{ .Config.type }}"
    notnewword: 1

  rows:
    selector: table.main > tbody > tr > td.embedded > table.torrents > tbody > tr:has(a[href^="download.php?id="])

  fields:
    category:
      text: 1
    title_default:
      selector: a[href*="details.php?id="]
    title:
      selector: a[title][href*="details.php?id="]
      attribute: title
      optional: true
      default: "{{ .Result.title_default }}"
    details:
      selector: a[href*="details.php?id="]
      attribute: href
    download:
      selector: a[href^="download.php?id="]
      attribute: href
    poster:
      selector: img[src^="imagescover"]
      attribute: src
      filters:
        - name: prepend
          args: "https://images.weserv.nl/?url={{ .Config.sitelink }}" # for display on dashboard
        - name: append
          args: "&w=180&h=270" # for display on dashboard
    date_elapsed:
      # time type: time elapsed (default)
      selector: td.rowfollow:nth-child(4) > span[title]
      attribute: title
      optional: true
      filters:
        - name: append
          args: " +07:00" # ICT
        - name: dateparse
          args: "yyyy-MM-dd HH:mm:ss zzz"
    date_added:
      # time added
      selector: td.rowfollow:nth-child(4):not(:has(span))
      optional: true
      filters:
        - name: append
          args: " +07:00" # ICT
        - name: dateparse
          args: "yyyy-MM-ddHH:mm:ss zzz"
    date:
      text: "{{ if or .Result.date_elapsed .Result.date_added }}{{ or .Result.date_elapsed .Result.date_added }}{{ else }}now{{ end }}"
    size:
      selector: td.rowfollow:nth-child(5)
      optional: true
      default: 512MB
    seeders:
      selector: td.rowfollow:nth-child(6)
      optional: true
      default: 0
    leechers:
      selector: td.rowfollow:nth-child(7)
      optional: true
      default: 0
    grabs:
      selector: td.rowfollow:nth-child(8)
      optional: true
      default: 0
    downloadvolumefactor:
      case:
        img.pro_free: 0
        img.pro_free2up: 0
        img.pro_50pctdown: 0.5
        img.pro_50pctdown2up: 0.5
        img.pro_30pctdown: 0.3
        "*": 1
    uploadvolumefactor:
      case:
        img.pro_50pctdown2up: 2
        img.pro_free2up: 2
        img.pro_2up: 2
        "*": 1
    minimumratio:
      text: 0.4
    minimumseedtime:
      # 60 hours (as seconds = 60 x 60 x 60)
      text: 216000
    description:
      selector: td:nth-child(1)
      remove: a, b, font, img, span
# NexusPHP Standard v1.5 Beta 4 (custom)
