spelling/grammar

This commit is contained in:
Paul Dee
2023-12-31 03:35:48 +00:00
parent ac3dfb98e1
commit 1296915a42
17 changed files with 63 additions and 63 deletions

View File

@@ -1,7 +1,7 @@
# `makeProviders`
Make an instance of provider controls with configuration.
This is the main entrypoint of the library. It is recommended to make one instance globally and reuse it throughout your application.
This is the main entry-point of the library. It is recommended to make one instance globally and reuse it throughout your application.
## Example
@@ -23,9 +23,9 @@ interface ProviderBuilderOptions {
// instance of a fetcher, all webrequests are made with the fetcher.
fetcher: Fetcher;
// instance of a fetcher, in case the request has cors restrictions.
// instance of a fetcher, in case the request has CORS restrictions.
// this fetcher will be called instead of normal fetcher.
// if your environment doesnt have cors restrictions (like Node.JS), there is no need to set this.
// if your environment doesn't have CORS restrictions (like Node.JS), there is no need to set this.
proxiedFetcher?: Fetcher;
// target to get streams for

View File

@@ -1,7 +1,7 @@
# `ProviderControls.runAll`
Run all providers one by one in order of their built-in ranking.
You can attach events if you need to know what is going on while its processing.
You can attach events if you need to know what is going on while it is processing.
## Example
@@ -20,7 +20,7 @@ const stream = await providers.runAll({
})
// scrape a stream, but prioritize flixhq above all
// (other scrapers are stil ran if flixhq fails, it just has priority)
// (other scrapers are still run if flixhq fails, it just has priority)
const flixhqStream = await providers.runAll({
media: media,
sourceOrder: ['flixhq']
@@ -33,12 +33,12 @@ const flixhqStream = await providers.runAll({
function runAll(runnerOps: RunnerOptions): Promise<RunOutput | null>;
interface RunnerOptions {
// overwrite the order of sources to run. list of ids
// any omitted ids are in added to the end in order of rank (highest first)
// overwrite the order of sources to run. List of IDs
// any omitted IDs are added to the end in order of rank (highest first)
sourceOrder?: string[];
// overwrite the order of embeds to run. list of ids
// any omitted ids are in added to the end in order of rank (highest first)
// overwrite the order of embeds to run. List of IDs
// any omitted IDs are added to the end in order of rank (highest first)
embedOrder?: string[];
// object of event functions
@@ -49,13 +49,13 @@ interface RunnerOptions {
}
type RunOutput = {
// source scraper id
// source scraper ID
sourceId: string;
// if from an embed, this is the embed scraper id
// if from an embed, this is the embed scraper ID
embedId?: string;
// the outputed stream
// the emitted stream
stream: Stream;
};
```

View File

@@ -1,6 +1,6 @@
# `ProviderControls.runSourceScraper`
Run a specific source scraper and get its outputted streams.
Run a specific source scraper and get its emitted streams.
## Example
@@ -24,7 +24,7 @@ try {
})
} catch (err) {
if (err instanceof NotFoundError) {
console.log('source doesnt have this media');
console.log('source does not have this media');
} else {
console.log('failed to scrape')
}
@@ -48,13 +48,13 @@ interface SourceRunnerOptions {
// the media you want to see sources from
media: ScrapeMedia;
// id of the source scraper you want to scrape from
// ID of the source scraper you want to scrape from
id: string;
}
type SourcererOutput = {
// list of embeds that the source scraper found.
// embed id is a reference to an embed scraper
// embed ID is a reference to an embed scraper
embeds: {
embedId: string;
url: string;

View File

@@ -1,6 +1,6 @@
# `ProviderControls.runEmbedScraper`
Run a specific embed scraper and get its outputted streams.
Run a specific embed scraper and get its emitted streams.
## Example
@@ -31,10 +31,10 @@ interface EmbedRunnerOptions {
// object of event functions
events?: IndividualScraperEvents;
// the embed url
// the embed URL
url: string;
// id of the embed scraper you want to scrape from
// ID of the embed scraper you want to scrape from
id: string;
}

View File

@@ -1,13 +1,13 @@
# `ProviderControls.listSources`
List all source scrapers that applicable for the target.
They are sorted by rank, highest first
List all source scrapers that are applicable for the target.
They are sorted by rank; highest first
## Example
```ts
const sourceScrapers = providers.listSources();
// Guaranteed to only return type: 'source'
// Guaranteed to only return the type: 'source'
```
## Type

View File

@@ -1,13 +1,13 @@
# `ProviderControls.listEmbeds`
List all embed scrapers that applicable for the target.
They are sorted by rank, highest first
List all embed scrapers that are applicable for the target.
They are sorted by rank; highest first
## Example
```ts
const embedScrapers = providers.listEmbeds();
// Guaranteed to only return type: 'embed'
// Guaranteed to only return the type: 'embed'
```
## Type

View File

@@ -1,7 +1,7 @@
# `ProviderControls.getMetadata`
Get meta data for a scraper, can be either source or embed scraper.
Returns null if the `id` is not recognized.
Returns `null` if the `id` is not recognized.
## Example

View File

@@ -1,6 +1,6 @@
# `makeStandardFetcher`
Make a fetcher from a `fetch()` API. It is used for making a instance of provider controls.
Make a fetcher from a `fetch()` API. It is used for making an instance of provider controls.
## Example