---
  site: magico
  name: Magico
  description: "Magico (Trellas) is a GREEK Private Torrent Tracker for MOVIES / TV / GENERAL"
  language: el-gr
  type: private
  encoding: UTF-8
  links:
    - https://magico.info/

  caps:
    categorymappings:
      - {id: 1, cat: Movies, desc: "Movies"}
      - {id: 84, cat: Movies, desc: "N ees (2016, 2017)"}
      - {id: 14, cat: Movies/SD, desc: "DVDRip-BDRip-BRRip (e?? 2015) FREE"}
      - {id: 16, cat: Movies/SD, desc: "In Avouri (CAM) FREE"}
      - {id: 17, cat: Movies/BluRay, desc: "B LU-RAY"}
      - {id: 44, cat: Movies, desc: "E English Movies"}
      - {id: 76, cat: Movies, desc: "N tokimanter"}
      - {id: 82, cat: Movies, desc: "I EATP"}

      - {id: 52, cat: TV, desc: "series"}
      - {id: 53, cat: TV/SD, desc: ", O Enes"}
      - {id: 70, cat: TV/HD, desc: "O Enes (720p)"}
      - {id: 54, cat: TV, desc: "E English"}
      - {id: 86, cat: TV, desc: "O Enes Complete Seasons"}
      - {id: 92, cat: TV, desc: "O Enes Complete Seasons (720p)"}
      - {id: 87, cat: TV, desc: "E English Complete Seasons"}
      - {id: 63, cat: TV, desc: "Y ychagogikes Emissions"}
      - {id: 83, cat: TV/Sport, desc: "TV Sports"}

      - {id: 55, cat: Movies, desc: "Children"}
      - {id: 38, cat: Movies, desc: "M etaglotismena (Movies)"}
      - {id: 39, cat: Movies, desc: "M e Subtitled (Movies)"}
      - {id: 93, cat: Movies, desc: "M etaglotismena (Series)"}
      - {id: 94, cat: Movies, desc: "M e Subtitled (Series)"}
      - {id: 45, cat: Movies, desc: "I absent Anime"}
      - {id: 98, cat: Movies, desc: "M etaglotismena 3D"}
      - {id: 64, cat: Movies, desc: "M music for Children"}

      - {id: 7, cat: Audio, desc: "Foreign music"}
      - {id: 21, cat: Audio, desc: "N ees Releases"}
      - {id: 46, cat: Audio, desc: "P. Alai Releases"}
      - {id: 32, cat: Audio, desc: "D. iskografies"}
      - {id: 20, cat: Audio, desc: "In ylloges"}
      - {id: 102, cat: Audio, desc: "M AGICO Radio"}
      - {id: 81, cat: Audio, desc: "K araoke"}
      - {id: 95, cat: Audio, desc: "Soundtrack"}

      - {id: 47, cat: Audio, desc: "Greek music"}
      - {id: 48, cat: Audio, desc: "N ees Releases"}
      - {id: 49, cat: Audio, desc: "P. Alai Releases"}
      - {id: 51, cat: Audio, desc: "D. iskografies"}
      - {id: 50, cat: Audio, desc: "In ylloges"}
      - {id: 101, cat: Audio, desc: "M AGICO Radio"}
      - {id: 97, cat: Audio, desc: "Live Cd 's"}
      - {id: 57, cat: Audio, desc: "P empetika"}
      - {id: 58, cat: Audio, desc: "D. imotika"}
      - {id: 59, cat: Audio, desc: "K exception of preservatives"}
      - {id: 60, cat: Audio, desc: "N isiotika"}
      - {id: 62, cat: Audio, desc: "P. ontiaka"}
      - {id: 80, cat: Audio, desc: "K araoke"}
      - {id: 96, cat: Audio, desc: "Soundtracks"}

      - {id: 73, cat: Audio, desc: "seasonal Music"}
      - {id: 74, cat: Audio, desc: "X ristougenna"}
      - {id: 79, cat: Audio, desc: "P. ascha"}
      - {id: 75, cat: Audio, desc: "A pokriatika"}
      - {id: 78, cat: Audio, desc: "A Tariff Valentine"}

      - {id: 33, cat: Books, desc: "Books"}
      - {id: 41, cat: Books, desc: "E nglis"}
      - {id: 65, cat: Books, desc: "K omix"}
      - {id: 43, cat: Books, desc: "P. periods"}
      - {id: 72, cat: Books, desc: "P. aidika"}
      - {id: 66, cat: Books, desc: "L. exika - Educational"}
      - {id: 42, cat: Books, desc: "O enoglossa"}
      - {id: 67, cat: Books, desc: "E. Konya-Photos"}

      - {id: 6, cat: PC, desc: "programs"}
      - {id: 18, cat: PC/0day, desc: "PC"}
      - {id: 40, cat: PC/Phone-Android, desc: "Android"}
      - {id: 19, cat: PC/Mac, desc: "Mac"}

      - {id: 2, cat: PC/Games, desc: "Games"}
      - {id: 27, cat: PC/Games, desc: "PC"}
      - {id: 68, cat: PC/Phone-Android, desc: "Android"}

      - {id: 88, cat: Other, desc: "Design / Tutorials / Accessories"}
      - {id: 89, cat: Other, desc: "Photoshop Tutorials"}
      - {id: 91, cat: Other, desc: "Illustrator Tutorials"}
      - {id: 90, cat: Other, desc: "After Effects Tutorials"}

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

  login:
    path: /?p=home&pid=1
    method: form
    form: form#loginbox_form
    submitpath: /ajax/login.php
    inputs:
      action: "login"
      loginbox_membername: "{{ .Config.username }}"
      loginbox_password: "{{ .Config.password }}"
      loginbox_remember: "true"
    selectorinputs:
      securitytoken:
        selector: "script:contains(\"stKey: \")"
        filters:
          - name: regexp
            args: "stKey: \"(.+?)\","
    error:
      - selector: ":contains(\"-ERROR-\")"
    test:
      path: /?p=torrents&pid=32
      selector: a#logout

  search:
    paths:
      - path: /
    keywordsfilters: 
      - name: replace # use this as a workaround till #893 is implemented
        args: ["Greys Anatomy", "Grey's Anatomy"]
      - name: re_replace
        args: ["[^a-zA-Z0-9]+", "%25"]
    inputs:
      p: "torrents"
      pid: "32"
      $raw: "{{range .Categories}}cid[]={{.}}&{{end}}"
      keywords: "{{ .Keywords }}"
      search_type: "name"
      searchin: "title"
    error:
      - selector: div#show_error font
    rows:
      selector: div#content > div.torrent-box[id^="torrent_"]
      filters:
        - name: andmatch
    fields:
      title:
        selector: a[href*="?p=torrents&pid=10&action=details"]
        filters:
          - name: replace
            args: ["Grey's Anatomy", "Greys Anatomy"]
      category:
        selector: div.categoryImage > a
        attribute: href
        filters:
          - name: querystring
            args: cid
      details:
        selector: a[href*="?p=torrents&pid=10&action=details"]
        attribute: href
      download:
        selector: a[href*="?p=torrents&pid=10&action=download"]
        attribute: href
      imdb:
        selector: a[href^="http://www.imdb.com/title/tt"]
        attribute: href
      size:
        selector: a[rel="torrent_size"]
      seeders:
        selector: a[rel="torrent_seeders"]
      leechers:
        selector: a[rel="torrent_leechers"]
      grabs:
        selector: a[rel="times_completed"]
      banner:
        optional: true
        selector: a[rel="fancybox"]
        attribute: href
      description:
        selector: div.torrentDetails > div:has(span.floatright)
      downloadvolumefactor:
        case:
          "img[title=\"No Record!\"]": "0"
          "*": "1"
      uploadvolumefactor:
        case:
          "*": "1"
      date:
        optional: true
        selector: div.torrentOwner > abbr.timeago
        attribute: data-time
      date:
        optional: true
        selector: div.torrentOwner:not(:has(abbr.timeago))
        remove: span
        filters:
          - name: replace
            args: ["Ανέβηκε ", ""] # Uploaded
          - name: replace
            args: [" από", ""] # by
          - name: replace
            args: [" τον/την", ""] # him/her
          - name: replace
            args: ["στις ", ""] # at
          - name: replace
            args: ["σήμερα", "Today"]
          - name: replace
            args: ["εχθές", "Yesterday"]
          - name: replace
            args: ["Δευτέρα", "Monday"]
          - name: replace
            args: ["Τρίτη", "Tuesday"]
          - name: replace
            args: ["Τετάρτη", "Wednesday"]
          - name: replace
            args: ["Πέμπτη", "Thursday"]
          - name: replace
            args: ["Παρασκευή", "Friday"]
          - name: replace
            args: ["Σάββατο", "Saturday"]
          - name: replace
            args: ["Κυριακή", "Sunday"]
          - name: dateparse
            args: "02-01-2006 15:04"

        
