---
id: p2pbg
name: P2PBG
description: "P2PBG is a BULGARIAN Private PAY2DL Torrent Tracker for 0DAY / GENERAL"
language: bg-BG
type: private
encoding: UTF-8
links:
  - https://www.p2pbg.com/
legacylinks:
  - http://www.p2pbg.com/
  - http://p2pbg.com/ # site does not support https ERR_CONNECTION_REFUSED

caps:
  categorymappings:
    # movies
    - {id: 1, cat: Movies/SD, desc: "Movies XviD"}
    - {id: 7, cat: TV/Documentary, desc: "Movies Documentaries"}
    - {id: 11, cat: Movies/DVD, desc: "Movies DVD"}
    - {id: 14, cat: TV, desc: "TV Shows"}
    - {id: 15, cat: TV, desc: "TV Boxset"}
    - {id: 16, cat: Movies/HD, desc: "Movies x264"}
    - {id: 17, cat: Movies/HD, desc: "Movies MPEG2"}
    - {id: 18, cat: Movies/BluRay, desc: "Movies BR/HD DVD"}
    - {id: 24, cat: TV/SD, desc: "TV BG"}
    - {id: 34, cat: Movies, desc: "Movies BG"}
    - {id: 35, cat: Movies, desc: "Movies GSM"}
    - {id: 38, cat: TV/Anime, desc: "Cartoons"}
    - {id: 55, cat: Movies/3D, desc: "Movies 3D"}
    - {id: 58, cat: Movies/HD, desc: "Movies x265"}
    - {id: 59, cat: Movies/SD, desc: "Movies VHS"}
    - {id: 60, cat: Movies/UHD, desc: "Movies 4K"}
    # music
    - {id: 2, cat: Audio/MP3, desc: "Music Song"}
    - {id: 3, cat: Audio/Video, desc: "Music DVD"}
    - {id: 19, cat: Audio/Video, desc: "Music Video"}
    - {id: 28, cat: Audio, desc: "Music Album"}
    - {id: 29, cat: Audio, desc: "Music Discography"}
    # games
    - {id: 8, cat: PC/Games, desc: "Games PC ISO"}
    - {id: 9, cat: PC/Games, desc: "Games PC Rips"}
    - {id: 12, cat: Console/PS3, desc: "Games PS2"}
    - {id: 20, cat: Console/PSP, desc: "Games PSP"}
    - {id: 21, cat: Console/XBox, desc: "Games XboX"}
    - {id: 22, cat: Console/XBox 360, desc: "Games X360"}
    - {id: 23, cat: Console/PS3, desc: "Games PS3"}
    - {id: 33, cat: Console/Wii, desc: "Games Wii"}
    # appz
    - {id: 26, cat: PC/ISO, desc: "Appz PC ISO"}
    - {id: 27, cat: PC, desc: "Appz GSM"}
    - {id: 30, cat: PC, desc: "Appz Linux"}
    - {id: 31, cat: PC/0day, desc: "Appz Ripped"}
    - {id: 49, cat: PC/Mac, desc: "Appz MacOS"}
    # sports
    - {id: 5, cat: TV/Sport, desc: "Formula 1"}
    - {id: 51, cat: TV/Sport, desc: "Sport"}
    - {id: 57, cat: TV/Sport, desc: "Formula 2"}
    - {id: 64, cat: TV/Sport, desc: "Football"}
    - {id: 65, cat: TV/Sport, desc: "E-Sports"}
    # other
    - {id: 4, cat: Other, desc: "Other"}
    - {id: 6, cat: Books, desc: "Books"}
    - {id: 37, cat: Other/Misc, desc: "Pictures"}
    - {id: 39, cat: Other, desc: "e-Learning"}
    # 3x
    - {id: 13, cat: XXX, desc: "XXX"}
    - {id: 32, cat: XXX/ImageSet, desc: "XXX Pictures"}
    - {id: 48, cat: XXX, desc: "XXX BG Amateurs"}
    - {id: 53, cat: XXX, desc: "XXX Hentai"}
    - {id: 54, cat: XXX, desc: "XXX 4K"}
    - {id: 56, cat: XXX, desc: "XXX VR"}
    - {id: 61, cat: XXX, desc: "XXX OF"}
    - {id: 66, cat: XXX, desc: "XXX HD"}

  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: info_magnets
    type: info
    label: "About Magnets"
    default: "IF you do not see Magnets in the results then this means that you are not a <b>Super User</b> or <b>VIP</b>.<br />You will need to visit the <a href=\"https://www.p2pbg.com/marketplace\" target=\"_blank\">MarketPlace</a>."
  - name: info_results
    type: info
    label: "Search results"
    default: "Only the <b>Base</b> style is supported with this indexer.<br />For best results, change the <b>Torrents per page:</b> setting to <b>100</b> on your account profile."
  - name: sort
    type: select
    label: Sort requested from site
    default: data
    options:
      data: created
      size: size
  - name: type
    type: select
    label: Order requested from site
    default: DESC
    options:
      DESC: desc
      ASC: asc

login:
  path: login
  method: form
  form: form.auth-form
  inputs:
    uid: "{{ .Config.username }}"
    pwd: "{{ .Config.password }}"
    remember: 1
  error:
    - selector: div.auth-notice:contains("Incorrect")
  test:
    path: index.php
    selector: a[href$="logout"]

search:
  paths:
    # https://www.p2pbg.com/torrents?fakeusernameremembered=&fakepasswordremembered=&search=&category=0&active=0&hidexxx=1
    - path: torrents
  allowEmptyInputs: true
  inputs:
    category: "{{ if .Categories }}{{ range .Categories }}{{.}};{{end}}{{ else }}0{{ end }}"
    fakeusernameremembered: ""
    fakepasswordremembered: ""
    search: "{{ if .Keywords }}{{ .Keywords }}{{ else }}{{ end }}"
    # 0 all 1, active, 2 dead
    active: 0
    order: "{{ .Config.sort }}"
    by: "{{ .Config.type }}"

  rows:
    selector: table.torrent-index__table:not(table.torrent-index__table--recommended) > tbody > tr.torrent-index__row

  fields:
    category:
      selector: a[href*="category="]
      attribute: href
      filters:
        - name: querystring
          args: category
    title:
      selector: td:nth-child(2) a
    _hash:
      selector: td:nth-child(2) a
      attribute: onclick
      filters:
        - name: regexp
          args: ([A-F|a-f|0-9]{40})
    details:
      text: "torrents/{{ .Result._hash }}"
    magnet:
      selector: a[href^="magnet:?xt="]
      attribute: href
      optional: true
    poster:
      selector: a:has(img[src*="/torrentimg/pic"])
      attribute: data-overlib
      filters:
        - name: regexp
          args: src=\"(.*?)\"
    # two flavours
    date_day:
      # Yesterday
      # Вчера
      selector: td:nth-last-child(5):not(:contains("/"))
      # auto adjusted by site account profile
      optional: true
      filters:
        - name: re_replace
          args: ["(?i)сейчас|Сега", "now"]
        - name: re_replace
          args: ["(?i)сегодня|Днес", "Today"]
        - name: re_replace
          args: ["(?i)вчера|Вчера", "Yesterday"]
    date_year:
      # 14/03/2019
      selector: td:nth-last-child(5):contains("/")
      # auto adjusted by site account profile
      optional: true
      filters:
        - name: dateparse
          args: "dd/MM/yyyy"
    date:
      text: "{{ if or .Result.date_day .Result.date_year }}{{ or .Result.date_day .Result.date_year }}{{ else }}now{{ end }}"
    size:
      selector: td:nth-last-child(4)
    seeders:
      selector: td:nth-last-child(3)
    leechers:
      selector: td:nth-last-child(2)
    grabs:
      selector: td:nth-last-child(1)
    downloadvolumefactor:
      text: 1
    uploadvolumefactor:
      text: 1
    minimumratio:
      text: 1.0
# xbtit customised
