Kylart / Nyaapi

Non-official api to access Nyaa.si and Nyaa.pantsu.cat (search, upload,...)
MIT License
108 stars 17 forks source link

Feature/API URL Customization #23

Closed guydht closed 3 years ago

guydht commented 3 years ago

Hey I'd love this package to include the possibility to specify the base url for the apis. For example. I want to stop using nyaa.si and instead use nyaa.iss.one It could be as easy as:

si.setBaseUrl('https://nyaa.iss.one')

Kylart commented 3 years ago

Sorry for the very long answer.

You can now use the helper method to do exactly that in v2.4.0.

const { si, pantsu } = require('nyaapi')

si.config.updateBaseUrl('https://nyaa.iss.one')

pantsu.config.updateBaseUrl('https://nyaa.pantsu.net')