---
id: xtremebytes
replaces:
  - torrentsurf
name: Xtreme Bytes
description: "Xtreme Bytes (TorrentSurf) is a Private Torrent Tracker for MOVIES / TV / GENERAL"
language: en-US
type: private
encoding: UTF-8
links:
  - https://xtremebytes.net/

caps:
  categorymappings:
    - {id: 1, cat: TV/Anime, desc: "Anime"}
    - {id: 13, cat: PC/Mac, desc: "Appz/Mac"}
    - {id: 3, cat: PC/0day, desc: "Appz/PC"}
    - {id: 35, cat: TV, desc: "Big Brother"}
    - {id: 28, cat: Books/Comics, desc: "Comics"}
    - {id: 4, cat: Books/EBook, desc: "E-Book"}
    - {id: 39, cat: Console, desc: "Games/Console"}
    - {id: 33, cat: PC/Games, desc: "Games/PC"}
    - {id: 27, cat: Other, desc: "Misc"}
    - {id: 37, cat: Movies/SD, desc: "Movies/Cam/TS"}
    - {id: 14, cat: Movies/DVD, desc: "Movies/DVD-R"}
    - {id: 18, cat: Movies/HD, desc: "Movies/HD"}
    - {id: 19, cat: Movies/SD, desc: "Movies/SD"}
    - {id: 42, cat: Movies/HD, desc: "Movies/x264"}
    - {id: 41, cat: Movies/SD, desc: "Movies/Xvid"}
    - {id: 29, cat: Audio, desc: "Music"}
    - {id: 30, cat: TV, desc: "Packs"}
    - {id: 24, cat: TV/HD, desc: "TV/HD"}
    - {id: 25, cat: TV/SD, desc: "TV/SD"}
    - {id: 44, cat: TV/HD, desc: "TV/x264"}
    - {id: 43, cat: TV/SD, desc: "TV/Xvid"}
    - {id: 36, cat: XXX, desc: "XXX"}

  modes:
    search: [q]
    tv-search: [q, season, ep]
    movie-search: [q]
    music-search: [q]
    book-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: seedbox
    type: checkbox
    label: "Use SeedBox Download Link"
    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

login:
  path: takelogin.php
  method: post
  inputs:
    username: "{{ .Config.username }}"
    password: "{{ .Config.password }}"
    returnto: /
  error:
    - selector: table.main:contains("Login failed!")
      message:
        selector: table tr td.text
  test:
    path: browse.php
    selector: a[href="logout.php"]

search:
  paths:
    # https://xtremebytes.net/browse.php?search=&cat=0&incldead=1&c18=1&c42=1
    - path: browse.php
  inputs:
    $raw: "{{ range .Categories }}c{{.}}=1&{{end}}"
    # 0 active, 1 incldead, 2 onlydead, 3 freeleech, 4 descr
    incldead: "{{ if .Config.freeleech }}3{{ else }}1{{ end }}"
    search: "{{ .Keywords }}"
    sort: "{{ .Config.sort }}"
    type: "{{ .Config.type }}"
    # site does not support imdbid searching or display imdb links in results.

  rows:
    selector: table[border="0"][cellspacing="0"][cellpadding="5"] tr:has(a[href^="download.php?id="])

  fields:
    category:
      selector: a[href^="browse.php?cat="]
      attribute: href
      filters:
        - name: querystring
          args: cat
    title:
      selector: a[href^="details.php?id="]
      attribute: title
    details:
      selector: a[href^="details.php?id="]
      attribute: href
    download_1:
      selector: a[href^="download.php"]
      attribute: href
    download_2:
      selector: a[href^="download2.php"]
      attribute: href
    download:
      text: "{{ if .Config.seedbox }}{{ .Result.download_2 }}{{ else }}{{ .Result.download_1 }}{{ end }}"
    files:
      selector: td:nth-child(3)
    grabs:
      selector: td:nth-child(7)
    size:
      selector: td:nth-child(6)
    seeders:
      selector: td:nth-last-child(3)
    leechers:
      selector: td:nth-last-child(2)
    date:
      selector: td:nth-child(5)
      filters:
        - name: append
          args: " -07:00" # PDT
        - name: dateparse
          args: "yyyy-MM-ddHH:mm:ss zzz"
    downloadvolumefactor:
      case:
        img[src="pic/freeleech.png"]: 0
        "*": 1
    uploadvolumefactor:
      text: 1
    minimumratio:
      text: 0.8
# engine n/a
