---
id: btmet
name: BTMET
description: "BTMET is a Public magnet indexer"
language: en-US
type: public
encoding: UTF-8
links:
  - https://btmet.com/

caps:
  categories:
    Audio: Audio
    Compressed: Other
    Document: Books
    Image: Other
    Installation: PC
    Other: Other
    TV: TV # dummy cat to allow both Movies,TV to be categorised when Video is found.
    Video: Movies

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

settings:
  - name: sort
    type: select
    label: Sort requested from site
    default: 0
    options:
      0: relevance
      1: created
      2: size
  - name: info_flaresolverr
    type: info_flaresolverr

search:
  paths:
    # https://btmet.com/search.php?q=2022&c=&l=&o=1
    - path: search.php
  inputs:
    q: "{{ if .Keywords }}{{ .Keywords }}{{ else }}{{ .Today.Year }}{{ end }}"
    o: "{{ if .Keywords }}{{ .Config.sort }}{{ else }}1{{ end }}"

  rows:
    selector: div.search-item:has(a[href^="magnet"])
    filters:
      - name: andmatch

  fields:
    category:
      selector: div.item-bar > span[class="cpill blue-pill"]
    category|append:
      # add tv to video
      optional: true
      selector: div.item-bar > span[class="cpill blue-pill"]
      filters:
        - name: replace
          args: ["Video", "TV"]
    title:
      selector: a.smashTitle > script:contains("decodeURIComponent")
      filters:
        - name: urldecode
        - name: replace
          args: ['document.write(decodeURIComponent("', ""]
        - name: replace
          args: ['"));', ""]
        - name: replace
          args: ["<b style='color:#ea644a'>", ""]
        - name: replace
          args: ["</b>", ""]
        - name: htmldecode
    details:
      selector: a.smashTitle
      attribute: href
    infohash:
      selector: a[href^="magnet:?xt="]
      attribute: href
      filters:
        - name: regexp
          args: ([a-f|0-9]{40})
    date:
      # unix
      selector: div.item-bar > span:nth-child(2) > b
      attribute: t
      filters:
        - name: regexp
          args: (\d{10})
    size:
      selector: div.item-bar > span:nth-child(3) > b
    files:
      selector: div.item-bar > span:nth-child(4) > b
    seeders:
      selector: div.item-bar > span:nth-child(5) > b
    leechers:
      text: 1
    downloadvolumefactor:
      text: 0
    uploadvolumefactor:
      text: 1
# engine n/a
