Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Fix for torrentz2.eu #49

Closed
msberends opened this issue Jan 11, 2020 · 6 comments
Closed

Fix for torrentz2.eu #49

msberends opened this issue Jan 11, 2020 · 6 comments

Comments

@msberends
Copy link

For torrentz2 support, I see in your gist:

"torrentz2": {
    "name": "Z2",
    "url": "https://torrentz2.eu/search?f={{query}}&p={{page:1}}",
    "list": "div.results dl",
    "result": {
      "name": "dt a",
      "url": [
        "dt a",
        "@href"
      ],
      "path": [
        "dt a",
        "@href"
      ],
      "size": "dd span:nth-child(3)"
    }
  },

This is broken, probably due to the page number. The first page is page 0, not page 1. Below fix also adds support for seeds and peers.

Please also change the name from Z2 to Torrentz2 as Z2 is extremely unclear and that's perfectly unnecessary.

"torrentz2": {
    "name": "Torrentz2",
    "url": "https://torrentz2.eu/search?f={{query}}&p={{page:0}}",
    "list": "div.results dl",
    "result": {
      "name": "dt a",
      "url": [
        "dt a",
        "@href"
      ],
      "path": [
        "dt a",
        "@href"
      ],
      "size": "dd span:nth-child(3)",
      "seeds": "dd span:nth-child(4)",
      "peers": "dd span:nth-child(5)"
    }
  },

A pull request would be easier, but that's not possible for your gist (see #30), so a repo file would be preferable.

Thanks!

@boypt boypt closed this as completed in 3f38342 Jan 11, 2020
boypt added a commit that referenced this issue Jan 11, 2020
@boypt
Copy link
Owner

boypt commented Jan 11, 2020

thanks for the fix.

the config was put in a gist is because the changes were very often at the beginning, now I think moving it back the the main repo is better.

The scraper module was written by the original author of cloud-torrent, the scraper config has no document at all. I make the scraper json URL configurable as ScraperURL. Will be available next version.

@msberends
Copy link
Author

Wow, you’re fast! That’s awesome!! Many thanks!

@msberends
Copy link
Author

Strange, it’s still not right in version 1.2.2, it shows the second page and not the first one.

To verify: search for “Ubuntu” in SimpleTorrent. Then open a browser, open torrentz2.eu and search for “Ubuntu” there. If you now click on ‘Next page’ you’ll see the results that SimpleTorrent shows (so: page 2). I’ll look into it tonight.

@boypt
Copy link
Owner

boypt commented Jan 12, 2020

torrentz2.eu

That's because torrentz2.eu is counting first page as p=0, but simple torrent is counting the page from 1. This is tricky, not all sites behave like this. I'll figure how to coordinate with them.

@boypt
Copy link
Owner

boypt commented Jan 12, 2020

It's turns out quite a simple solution: a test in javascript: if url has "{{page:0}}" then the request parameter page always minus 1.
Now torrentz2 work as expected in version v1.2.3

@msberends
Copy link
Author

Great 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants