Versions Compared

Key

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

...

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]"
    }
  },
...
}


Testing 

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 Configuration

vi config.json

Code Block
{
  "/search": {
    "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" ],
      "urlmagnet": [ "td[class=m]", "a[href]", "@href" ],
      "seedersurl": [ "td[class=s]"n]", "a[href]", "@href" ],
      "leachersseeders": "td[class=ls]",
      "size": "td:nth-of-type(6)"


    }
  }
}


Start Scrape Server

Code Block
scraper config.json
2024/02/14 12:36:47 [scraper] Loaded endpoint: /search
2024/02/14 12:36:47 [scraper] Listening on 3000...


Attempt Scrape

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

...