mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 15:13:25 +00:00
Quotes
This commit is contained in:
@@ -6,7 +6,7 @@ This is the main entrypoint of the library. It is recommended to make one instan
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { targets, makeProviders, makeDefaultFetcher } from "@movie-web/providers";
|
||||
import { targets, makeProviders, makeDefaultFetcher } from '@movie-web/providers';
|
||||
|
||||
const providers = makeProviders({
|
||||
fetcher: makeDefaultFetcher(fetch),
|
||||
|
@@ -9,9 +9,9 @@ You can attach events if you need to know what is going on while its processing.
|
||||
// media from TMDB
|
||||
const media = {
|
||||
type: 'movie',
|
||||
title: "Hamilton",
|
||||
title: 'Hamilton',
|
||||
releaseYear: 2020,
|
||||
tmdbId: "556574"
|
||||
tmdbId: '556574'
|
||||
}
|
||||
|
||||
// scrape a stream
|
||||
|
@@ -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');
|
||||
}
|
||||
```
|
||||
|
||||
|
@@ -5,7 +5,7 @@ Run a specific embed scraper and get its outputted streams.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { SourcererOutput } from "@movie-web/providers";
|
||||
import { SourcererOutput } from '@movie-web/providers';
|
||||
|
||||
// scrape a stream from upcloud
|
||||
let output: EmbedOutput;
|
||||
@@ -15,7 +15,7 @@ try {
|
||||
url: 'https://example.com/123',
|
||||
})
|
||||
} catch (err) {
|
||||
console.log("failed to scrape")
|
||||
console.log('failed to scrape')
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ Make a fetcher from a `fetch()` API. It is used for making a instance of provide
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { targets, makeProviders, makeDefaultFetcher } from "@movie-web/providers";
|
||||
import { targets, makeProviders, makeDefaultFetcher } from '@movie-web/providers';
|
||||
|
||||
const providers = makeProviders({
|
||||
fetcher: makeStandardFetcher(fetch),
|
||||
|
@@ -5,9 +5,9 @@ Make a fetcher to use with [movie-web/simple-proxy](https://github.com/movie-web
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import { targets, makeProviders, makeDefaultFetcher, makeSimpleProxyFetcher } from "@movie-web/providers";
|
||||
import { targets, makeProviders, makeDefaultFetcher, makeSimpleProxyFetcher } from '@movie-web/providers';
|
||||
|
||||
const proxyUrl = "https://your.proxy.workers.dev/"
|
||||
const proxyUrl = 'https://your.proxy.workers.dev/'
|
||||
|
||||
const providers = makeProviders({
|
||||
fetcher: makeDefaultFetcher(fetch),
|
||||
|
Reference in New Issue
Block a user