# Femdomcult uses the Luminance code, which is based on gazelle
# ajax.php API additionally needs the auth=$authkey argument
# Because the API is e.g. missing poster images we use screen scraping instead of the generic gazelle based approach
---
id: femdomcult
name: Femdomcult
description: "Femdomcult is a Private Torrent Tracker for FETISH 3X"
language: en-US
type: private
encoding: UTF-8
links:
  - https://femdomcult.org/

caps:
  categorymappings:
    - {id: 58, cat: XXX, desc: "Amateur/Mainstream"}
    - {id: 60, cat: XXX, desc: "Anime Comics"}
    - {id: 73, cat: XXX, desc: "Asian Femdom"}
    - {id: 61, cat: XXX, desc: "Audio"}
    - {id: 78, cat: XXX, desc: "EBook"}
    - {id: 74, cat: XXX, desc: "Female Muscles"}
    - {id: 59, cat: XXX, desc: "Femdom"}
    - {id: 62, cat: XXX, desc: "Femdom Vip"}
    - {id: 63, cat: XXX, desc: "Fetish"}
    - {id: 68, cat: XXX, desc: "Fetish Vip"}
    - {id: 76, cat: XXX, desc: "Game"}
    - {id: 64, cat: XXX, desc: "Gts-Vore-Crush"}
    - {id: 72, cat: XXX, desc: "Images"}
    - {id: 69, cat: XXX, desc: "Lezdom"}
    - {id: 70, cat: XXX, desc: "Pov"}
    - {id: 65, cat: XXX, desc: "Scat"}
    - {id: 71, cat: XXX, desc: "Strapon"}
    - {id: 66, cat: XXX, desc: "Transdom"}
    - {id: 77, cat: XXX, desc: "Unknown & Low Quality"}
    - {id: 75, cat: XXX, desc: "Virtual Reality"}
    - {id: 0, cat: XXX/Other, desc: "Other"}

  modes:
    search: [q]

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: time
    options:
      time: created
      seeders: seeders
      size: size
  - 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: "User classes Beginner and Perv have to be inactive (= not logged in on the site, tracker activity/seeding does not count) for 4 months before getting disabled automatically. Member class and higher are exempt."

login:
  path: login
  method: form
  inputs:
    username: "{{ .Config.username }}"
    password: "{{ .Config.password }}"
    cinfo: "2550|1350|24|-60"
    keeplogged: 1
  error:
    - selector: form#loginform > span.warning
  test:
    path: torrents.php
    selector: "#nav_userinfo"

search:
  paths:
    - path: torrents.php
  inputs:
    $raw: "{{ range .Categories }}filter_cat[{{.}}]=1&{{end}}"
    title: "{{ .Keywords }}"
    order_by: "{{ .Config.sort }}"
    order_way: "{{ .Config.type }}"
    action: advanced
    filter_freeleech: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"

  rows:
    selector: table#torrent_table > tbody > tr[class^="torrent row"]:has(a[href*="action=download"])

  fields:
    download:
      selector: a[href^="/torrents.php?action=download&id="]
      attribute: href
    description_tags:
      selector: div.tags
    description:
      case:
        span.icon[title*="okay"]: "Verified: {{ .Result.description_tags }}"
        "*": "Unverified: {{ .Result.description_tags }}"
    title:
      selector: a[href^="/torrents.php?id="]
    category:
      selector: a[href*="filter_cat"]
      attribute: href
      filters:
        - name: regexp
          args: "(\\d+)]=1"
    details:
      selector: a[href^="/torrents.php?id="]
      attribute: href
    poster:
      selector: td:nth-child(2) > script
      filters:
        - name: regexp
          args: "src=(.*?)>"
        - name: re_replace
          args: ["[\\\\\"]", ""]
        - name: replace
          args: ["/static/common/noartwork/noimage.png", ""]
    files:
      selector: td:nth-child(3)
    date:
      selector: td:nth-child(5) > span
      attribute: title
      # auto adjusted by site account profile
      filters:
        - name: dateparse
          args: "MMM dd yyyy, HH:mm"
    size:
      selector: td:nth-child(6)
    grabs:
      selector: td:nth-child(7)
    seeders:
      selector: td:nth-child(8)
    leechers:
      selector: td:nth-child(9)
    downloadvolumefactor:
      case:
        i.unlimited_leech: 0
        i.sitewide_leech: 0
        img[alt="Freeleech"]: 0
        "*": 1
    uploadvolumefactor:
      case:
        span.icon[title*="DoubleSeed"]: 2
        img[alt="DoubleSeed"]: 2
        "*": 1
    minimumratio:
      text: 0.5
    # MR is reduced but not removed if MST is met
    # minimumseedtime:
    #   # 3 days (as seconds = 3 x 24 x 60 x 60)
    #   text: 259200
# luminance
