---
id: brasiltracker
name: BrasilTracker
description: "BrasilTracker is a BRAZILIAN Private Torrent Tracker for MOVIES / TV / GENERAL"
language: pt-BR
encoding: UTF-8
type: private
links:
  - https://brasiltracker.org/

caps:
  categorymappings:
    - {id: 16, cat: Audio/Audiobook, desc: "Audiobooks"}
    - {id: 6, cat: TV/Anime, desc: "Animes"}
    - {id: 11, cat: PC/0day, desc: "Aplicativos"}
    - {id: 15, cat: Other, desc: "Cursos"}
    - {id: 8, cat: TV/Documentary, desc: "Documentários"}
    - {id: 14, cat: TV/Sport, desc: "Esportes"}
    - {id: 3, cat: XXX, desc: "Filmes XXX"}
    - {id: 1, cat: Movies, desc: "Filmes"}
    - {id: 12, cat: Books/Comics, desc: "Histórias em Quadrinhos"}
    - {id: 9, cat: PC/Games, desc: "Jogos"}
    - {id: 13, cat: Books/EBook, desc: "Livros"}
    - {id: 10, cat: Books/Mags, desc: "Revistas"}
    - {id: 2, cat: TV, desc: "Séries"}
    - {id: 5, cat: Audio/Video, desc: "Show"}
    - {id: 7, cat: TV, desc: "Televisão"}

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

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: time
    options:
      time: created
      seeders: seeders
      size: size
  - name: type
    type: select
    label: Order requested from site
    default: desc
    options:
      desc: desc
      asc: asc

login:
  method: cookie
  inputs:
    cookie: "{{ .Config.cookie }}"
  test:
    path: index.php
    selector: a[href^="logout.php?auth="]

search:
  paths:
    # https://brasiltracker.org/torrents.php?order_by=time&order_way=desc&freetorrent=1&filter_cat[6]=1&filter_cat[3]=1&action=basic&searchsubmit=1
    # https://brasiltracker.org/torrents.php?searchstr=mandalorain&order_by=size&order_way=desc&action=basic&searchsubmit=1
    # https://brasiltracker.org/torrents.php?searchstr=tt8179024&order_by=time&order_way=desc&action=basic&searchsubmit=1
    - path: torrents.php
  inputs:
    $raw: "{{ range .Categories }}filter_cat[{{.}}]=1&{{end}}"
    searchstr: "{{ if .Query.IMDBID }}{{ .Query.IMDBID }}{{ else }}{{ .Keywords }}{{ end }}"
    order_by: "{{ .Config.sort }}"
    order_way: "{{ .Config.type }}"
    group_results: 0
    action: basic
    freetorrent: "{{ if .Config.freeleech }}1{{ else }}{{ end }}"
    searchsubmit: 1

  rows:
    selector: table#torrent_table > tbody > tr.torrent

  fields:
    category:
      selector: td.big_info div.group_info
      case:
        "div:contains(\"[Audiobooks]\")": 16
        "div:contains(\"[Animes]\")": 6
        "div:contains(\"[Aplicativos]\")": 11
        "div:contains(\"[Cursos]\")": 15
        "div:contains(\"[Documentários]\")": 8
        "div:contains(\"[Esportes]\")": 14
        "div:contains(\"[Filmes XXX]\")": 3
        "div:contains(\"[Filmes]\")": 1
        "div:contains(\"[Histórias em Quadrinhos]\")": 12
        "div:contains(\"[Jogos]\")": 9
        "div:contains(\"[Livros]\")": 13
        "div:contains(\"[Revistas]\")": 10
        "div:contains(\"[Séries]\")": 2
        "div:contains(\"[Show]\")": 5
        "div:contains(\"[Televisão]\")": 7
        "*": 0 # catch errors
    details:
      selector: a[href^="torrents.php?id="]
      attribute: href
    download:
      selector: a[href^="torrents.php?action=download&id="]
      attribute: href
    description:
      selector: div.tags
    poster:
      selector: img[alt="Cover"]
      attribute: src
    imdbid:
      selector: a[href*="imdb.com/title/tt"]
      attribute: href
    tmdbid:
      selector: a[href*="themoviedb.org/movie/"], a[href*="themoviedb.org/tv/"]
      attribute: href
    files:
      selector: td:nth-child(3)
    date:
      selector: span.time
      attribute: title
      filters:
        - name: append
          args: " -03:00" # BRT
        - name: dateparse
          args: "MMM d yyyy, HH:mm zzz"
    size:
      selector: td:nth-child(5)
    grabs:
      selector: td:nth-child(6)
    seeders:
      selector: td:nth-child(7)
    leechers:
      selector: td:nth-child(8)
    downloadvolumefactor:
      case:
        strong.tl_free: 0
        "*": 1
    uploadvolumefactor:
      text: 1
    title_details:
      selector: div.torrent_info
      remove: strong
    year:
      selector: td.big_info div.group_info
      optional: true
      filters:
        - name: regexp
          args: "\\[((?:19|20)\\d{2})\\]"
    title:
      selector: a[href^="torrents.php?id="]
      filters:
        - name: re_replace
          args: ["\\[([^\\]]+)\\]", " / $1"]
        - name: append
          args: "{{ if .Result.year }} ({{ .Result.year }}){{ else }}{{ end }}"
        - name: append
          args: " {{ .Result.title_details }}"
        - name: re_replace
          args: ["\\bWEB\\b(?![-_. ]?DL)", "WEB-DL"]
        - name: re_replace
          args: ["(?i)\\b4K\\b", "2160p"]
        - name: re_replace
          args: ["(?i)\\bFull HD\\b", "1080p"]
        - name: re_replace
          args: ["(?i)\\b(?<!Full )HD\\b", "720p"]
        - name: re_replace
          args: ["(?i)\\bLegendado\\b", "Subs"]
        - name: re_replace
          args: ["(Dual|[Nn]acional|[Dd]ublado)", "Brazilian $1"]
    minimumratio:
      text: 1.0
    minimumseedtime:
      # 2 days (as seconds = 2 x 24 x 60 x 60)
      text: 172800
# Project Gazelle
