Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Adding a New Site

vi default- scraper-config.json

Code Block
{
  "magnetDL": {
    "name": "magnetDL",
    "url": "https://www.magnetdl.org/search/?q={{query}}&m=1&x=0&y=0",
    "list": "table[class=download] tbody tr",
    "result": {
      "name": [ "td[class=n]", "a[href]", "@title" ],
      "url": [ "td[class=n]", "a[href]", "@href" ],
      "magnet": [ "td[class=m]", "a[href]", "@href" ],
      "size": "td:nth-child(6)",
      "seeds": "td[class=s]"
    }
  },
...
}

...


Push to Github


Updating Docker Container Scraping Config

Update docker container config file located in /

Code Block
vi cloud-torrent.yaml 


Revise scraperurl

Code Block
...
scraperurl: https://raw.githubusercontent.com/xxx/simple-torrent/master/scraper-config.json
...


Testing a Scraping Configuration

Using jpillora/scraper https://github.com/jpillora/scraper/tree/master

...

Code Block
curl https://i.jpillora.com/scraper | bash
sudo mv ./scraper /usr/local/bin


Create a Scraping Configuration

vi config.json

...

Code Block
curl "localhost:3000/search?query=halo"


Validate Output

Code Block
[
  {
    "magnet": "magnet:?xt=urn:btih:7161c3a3f7068b9784fba7f722b09bb8272e9996&dn=Halo.S02E02.XviD-AFG+%5BTGx%5D&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451&tr=udp://tracker.internetwarriors.net:1337&tr=udp%3A%2F%2Fexodus.desync.com%3A6969",
    "name": "Halo.S02E02.XviD-AFG [TGx]",
    "seeders": "30",
    "size": "276.24 MB",
    "url": "/file/5926991/halo.s02e02.xvid-afg-tgx/"
  },
...
]

...