---
id: shanaproject
name: Shana Project
description: "Shana Project is a Public torrent site for ANIME"
language: en-US
type: public
encoding: UTF-8
links:
  - https://www.shanaproject.com/

settings:
  - name: sort
    type: select
    label: Sort requested from site
    default: date
    options:
      date: created
      ep: episode
      fsize: size
      title: title
  - name: type
    type: select
    label: Order requested from site
    default: Descending
    options:
      Descending: desc
      Ascending: asc
  - name: info
    type: info
    label: Searching
    default: This site only supports searching for Titles. Do not add a season or episode number, or a quality to your query.

caps:
  categorymappings:
    - {id: Anime, cat: TV/Anime, desc: Anime}

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

search:
  paths:
    - path: search/
  inputs:
    title: "{{ .Keywords }}"
    subber: ""
    sort: "{{ .Config.sort }}"
    dir: "{{ .Config.type }}"
  keywordsfilters:
    # strip season and ep
    - name: re_replace
      args: ["(?i)(?:\\s?[SE]?\\d{1,4}){1,2}$", ""]

  rows:
    selector: div.grid_12 > div[id^="rel"]

  fields:
    category:
      text: Anime
    title:
      selector: div.release_leftover > div.release_text_contents
      filters:
        - name: re_replace
          args: ["^(\\[.*\\]) (.*)", "$2 $1"]
        - name: re_replace
          args: ["(?i)(.mkv)", ""]
    details:
      selector: a
      attribute: href
    download:
      selector: a[href^="/download/"]
      attribute: href
    date_full:
      # Dec. 8, 2022, 6:25 a.m.
      selector: div.release_20:contains(".m."):contains(":")
      optional: true
      filters:
        - name: replace
          args: [".", ""]
        - name: replace
          args: ["Sept", "Sep"]
        - name: replace
          args: ["July", "Jul"]
        - name: replace
          args: ["June", "Jun"]
        - name: re_replace
          args: ["April", "Apr"]
        - name: re_replace
          args: ["March", "Mar"]
        - name: append
          args: " +00:00" # GMT
        - name: dateparse
          args: "MMM d, yyyy, h:mm tt zzz"
    date_abbr:
      # May 8, 2022, 6 a.m.
      selector: div.release_20:contains(".m."):not(:contains(":"))
      optional: true
      filters:
        - name: replace
          args: [".", ""]
        - name: replace
          args: ["Sept", "Sep"]
        - name: replace
          args: ["July", "Jul"]
        - name: replace
          args: ["June", "Jun"]
        - name: re_replace
          args: ["April", "Apr"]
        - name: re_replace
          args: ["March", "Mar"]
        - name: append
          args: " +00:00" # GMT
        - name: dateparse
          args: "MMM d, yyyy, h tt zzz"
    date_noon:
      # Sept. 30, 2022, noon
      selector: div.release_20:contains(", noon")
      optional: true
      filters:
        - name: replace
          args: [".", ""]
        - name: replace
          args: ["Sept", "Sep"]
        - name: replace
          args: ["July", "Jul"]
        - name: replace
          args: ["June", "Jun"]
        - name: re_replace
          args: ["April", "Apr"]
        - name: re_replace
          args: ["March", "Mar"]
        - name: re_replace
          args: [" noon", " 12 pm"]
        - name: append
          args: " +00:00" # GMT
        - name: dateparse
          args: "MMM d, yyyy, h tt zzz"
    date:
      text: "{{ if or .Result.date_full .Result.date_abbr .Result.date_noon }}{{ or .Result.date_full .Result.date_abbr .Result.date_noon }}{{ else }}now{{ end }}"
    size:
      selector: div.release_size
    seeders:
      text: 1
    leechers:
      text: 1
    downloadvolumefactor:
      text: 0
    uploadvolumefactor:
      text: 1
# engine n/a
