This commit is contained in:
mrjvs
2023-09-27 19:00:40 +02:00
parent 78507a24c8
commit de63979e4d
17 changed files with 428 additions and 45 deletions

View File

@@ -0,0 +1,44 @@
# `ProviderControls.runEmbedScraper`
Run a specific embed scraper and get its outputted streams.
## Example
```ts
import { SourcererOutput } from "@movie-web/providers";
// scrape a stream from upcloud
let output: EmbedOutput;
try {
output = await providers.runSourceScraper({
id: 'upcloud',
url: 'https://example.com/123',
})
} catch (err) {
console.log("failed to scrape")
return;
}
// output.stream now has your stream
```
## Type
```ts
function runEmbedScraper(runnerOps: SourceRunnerOptions): Promise<EmbedOutput>;
interface EmbedRunnerOptions {
// object of event functions
events?: IndividualScraperEvents;
// the embed url
url: string;
// id of the embed scraper you want to scrape from
id: string;
}
type EmbedOutput = {
stream: Stream;
};
```