mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 14:53:24 +00:00
Quotes
This commit is contained in:
@@ -5,14 +5,14 @@ Run a specific source scraper and get its outputted streams.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { SourcererOutput, NotFoundError } from "@movie-web/providers";
|
||||
import { SourcererOutput, NotFoundError } from '@movie-web/providers';
|
||||
|
||||
// media from TMDB
|
||||
const media = {
|
||||
type: 'movie',
|
||||
title: "Hamilton",
|
||||
title: 'Hamilton',
|
||||
releaseYear: 2020,
|
||||
tmdbId: "556574"
|
||||
tmdbId: '556574'
|
||||
}
|
||||
|
||||
// scrape a stream from flixhq
|
||||
@@ -24,15 +24,15 @@ try {
|
||||
})
|
||||
} catch (err) {
|
||||
if (err instanceof NotFoundError) {
|
||||
console.log("source doesnt have this media");
|
||||
console.log('source doesnt have this media');
|
||||
} else {
|
||||
console.log("failed to scrape")
|
||||
console.log('failed to scrape')
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!output.stream && output.embeds.length === 0) {
|
||||
console.log("no streams found");
|
||||
console.log('no streams found');
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user