---
id: jpopsuki
name: JPopsuki
description: "JPopSuki is a Private Torrent Tracker for ASIAN MUSIC"
language: en-US
type: private
encoding: UTF-8
requestDelay: 3
links:
  - https://jpopsuki.eu/

caps:
  categorymappings:
    - {id: 1, cat: Audio, desc: "Album"}
    - {id: 2, cat: Audio, desc: "Single"}
    - {id: 3, cat: Movies, desc: "PV"}
    - {id: 4, cat: Movies/DVD, desc: "DVD"}
    - {id: 5, cat: TV, desc: "TV-Music"}
    - {id: 6, cat: TV, desc: "TV-Variety"}
    - {id: 7, cat: TV, desc: "TV-Drama"}
    - {id: 8, cat: Other, desc: "Fansubs"}
    - {id: 9, cat: Other, desc: "Pictures"}
    - {id: 10, cat: Other/Misc, desc: "Misc"}

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

settings:
  - name: username
    type: text
    label: Username
  - name: password
    type: password
    label: Password
  - name: freeleech
    type: checkbox
    label: Search freeleech only
    default: false
  - name: sort
    type: select
    label: Sort requested from site
    default: s3
    options:
      s3: created
      s6: seeders
      s4: size
      s1: title
  - name: type
    type: select
    label: Order requested from site
    default: desc
    options:
      desc: desc
      asc: asc

login:
  path: login.php
  method: post
  inputs:
    username: "{{ .Config.username }}"
    password: "{{ .Config.password }}"
    keeplogged: 1
    login: "Log In!"
  error:
    - selector: form#loginform > span.warning, font[color="red"]
  test:
    path: index.php
    selector: a[href^="logout.php?auth="], a[href^="torrents.php?action=download&id="]

search:
    # https://jpopsuki.eu/ajax.php?section=torrents&searchstr=snow man&action=basic&searchtags=&tags_type=0&order_by=s3&order_way=desc&filter_cat[5]=1
  paths:
    - path: ajax.php
  keywordsfilters:
    - name: re_replace # replace special characters with " " (space)
      args: ["[\\[!\"#$%&'()*+,\\-.\\/:;<=>?@[\\]^_`{|}~]", " "]
  inputs:
    section: torrents
    disablegrouping: 1
    searchstr: "{{ .Keywords }}"
    action: basic
    searchtags: "{{ .Query.Genre }}"
    # 0 Any, 1 All
    tags_type: 1
    order_by: "{{ .Config.sort }}"
    order_way: "{{ .Config.type }}"
    freeleech: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
    $raw: "{{ range .Categories }}&filter_cat[{{.}}]=1{{end}}"
  error:
    - selector: :root:contains("Database error.")

  rows:
    selector: table#torrent_table > tbody > tr[class^="torrent"]:has(a[href^="torrents.php?action=download&id="])

  fields:
    category:
      selector: a[href*="filter_cat"]
      attribute: href
      filters:
        - name: regexp
          args: "%5B(\\d+?)%5D"
    download:
      selector: a[href^="torrents.php?action=download&id="]
      attribute: href
    genre:
      selector: div.tags
      filters:
        - name: replace
          args: [".", "_"]
    description:
      text: "{{ .Result.genre }}"
    artist:
      selector: td:nth-last-child(7) a[href*="artist.php"]
      optional: true
    title:
      selector: td:nth-last-child(7)
      remove: span, div.tags, a[title="View Comments"]
      filters:
        - name: replace
          args: [" ()", ""]
        - name: replace
          args: ["\t", ""]
        - name: replace
          args: [" / Freeleech!", ""]
    details:
      selector: a[href^="torrents.php?id="]
      attribute: href
    poster:
      selector: img[src^="static/images/torrents/"]
      attribute: src
    files:
      selector: td:nth-last-child(6)
    date:
      selector: td:nth-last-child(5)
      attribute: title
      # auto adjusted by site account profile
      filters:
        - name: dateparse
          args: "MMM dd yyyy, HH:mm"
    size:
      selector: td:nth-last-child(4)
    grabs:
      selector: td:nth-last-child(3)
    seeders:
      selector: td:nth-last-child(2)
    leechers:
      selector: td:nth-last-child(1)
    downloadvolumefactor:
      case:
        "strong:contains(\"Freeleech!\")": 0
        "*": 1
    uploadvolumefactor:
      text: 1
    minimumratio:
      text: 0.6
# engine n/a
