mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 17:53:24 +00:00
Quotes
This commit is contained in:
@@ -66,7 +66,7 @@ const myFetcher: Fetcher = (url, ops) => {
|
||||
// Do some fetching
|
||||
return {
|
||||
body: {},
|
||||
finalUrl: "",
|
||||
finalUrl: '',
|
||||
headers: new Headers(), // should only contain headers from ops.readHeaders
|
||||
statusCode: 200,
|
||||
};
|
||||
|
@@ -67,7 +67,7 @@ const providers = buildProviders()
|
||||
rank: 800,
|
||||
flags: [],
|
||||
scrapeMovie(ctx) {
|
||||
throw new Error("Not implemented");
|
||||
throw new Error('Not implemented');
|
||||
}
|
||||
})
|
||||
.build();
|
||||
|
@@ -75,7 +75,7 @@ If your target is set to `BROWSER`. There will never be required headers, as it'
|
||||
All streams have a list of captions at `Stream.captions`. The structure looks like this:
|
||||
```ts
|
||||
type Caption = {
|
||||
type: CaptionType; // language type, either 'srt' or 'vtt'
|
||||
type: CaptionType; // language type, either "srt" or "vtt"
|
||||
id: string; // only unique per stream
|
||||
url: string; // the url pointing to the subtitle file
|
||||
hasCorsRestrictions: boolean; // If true, you will need to proxy it if you're running in a browser
|
||||
|
@@ -56,7 +56,7 @@ npm run cli -- -sid flixhq -tid 556574
|
||||
# Arcane S1E1 - showbox
|
||||
npm run cli -- -sid zoechip -tid 94605 -s 1 -e 1
|
||||
|
||||
# febbox mp4 -
|
||||
# febbox mp4 - get streams from an embed (gotten from a source output)
|
||||
npm run cli -- -sid febbox-mp4 -u URL_HERE
|
||||
```
|
||||
|
||||
|
@@ -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