mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 12:43:25 +00:00
switched to guider
This commit is contained in:
44
.docs/pages/api-reference/ProviderControlsrunEmbedScraper.md
Normal file
44
.docs/pages/api-reference/ProviderControlsrunEmbedScraper.md
Normal file
@@ -0,0 +1,44 @@
|
||||
# `ProviderControls.runEmbedScraper`
|
||||
|
||||
Run a specific embed scraper and get its emitted streams.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { SourcererOutput } from '@movie-web/providers';
|
||||
|
||||
// scrape a stream from upcloud
|
||||
let output: EmbedOutput;
|
||||
try {
|
||||
output = await providers.runEmbedScraper({
|
||||
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;
|
||||
};
|
||||
```
|
Reference in New Issue
Block a user