3 Commits

Author SHA1 Message Date
William Oldham
912765203a docs: add dev-cli page 2023-10-03 23:02:53 +01:00
William Oldham
f6852f1f7f chore: update package-lock to correct version (?) 2023-10-03 23:02:40 +01:00
William Oldham
7322bf4519 chore: fix capitalisation on API title and add ' to you're 2023-10-03 23:02:26 +01:00
5 changed files with 37 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
# Fetchers
When making an instance of the library using `makeProviders()`. It will immediately make a fetcher.
This comes with some considerations depending on the environment youre running.
This comes with some considerations depending on the environment you're running.
## Using `fetch()`
In most cases, you can use the `fetch()` API. This will work in newer versions of Node.js (18 and above) and on the browser.

View File

@@ -1,2 +1,3 @@
icon: ph:file-code-fill
navigation.redirect: /api/makeproviders
navigation.title: API

View File

@@ -0,0 +1,31 @@
# Testing Providers
In order to test providers effectively, a built-in tool can be used which allows testing of individual source and embed providers.
There are two ways to use the tool:
- Command Line Mode - For passing in arguments directly to the script. This is useful in non-interactive environments such as CI or to repeatedly test during development.
- Question Mode - Where the script asks you questions about which source you wish to test.
::code-group
```bash [Interactive]
npm run test:dev
```
```bash [Command Line]
npm run test:dev -- [options]
# Example testing FlixHQ with "Spirited Away"
npm run test:dev -- -sid flixhq -tid 129 -t movie
```
::
The following Command Line Mode arguments are available:
| Argument | Alias | Description | Default |
|---------------|--------|-------------------------------------------------------------------------|--------------|
| `--fetcher` | `-f` | Fetcher type. Either `node-fetch` or `native` | `node-fetch` |
| `--source-id` | `-sid` | Source ID for the source to be tested | |
| `--tmdb-id` | `-tid` | TMDB ID for the media to scrape. Only used if source is a provider | |
| `--type` | `-t` | Media type. Either `movie` or `show`. Only used if source is a provider | `movie` |
| `--season` | `-s` | Season number. Only used if type is `show` | `0` |
| `--episode` | `-e` | Episode number. Only used if type is `show` | `0` |
| `--url` | `-u` | URL to a video embed. Only used if source is an embed | |
| `--help` | `-h` | Shows help for the command arguments | |

View File

@@ -0,0 +1,2 @@
icon: ph:code
navigation.redirect: /developer/dev-cli

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@movie-web/providers",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@movie-web/providers",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"dependencies": {
"cheerio": "^1.0.0-rc.12",