mirror of
https://github.com/movie-web/providers.git
synced 2025-09-13 13:33:25 +00:00
Quotes
This commit is contained in:
@@ -66,7 +66,7 @@ const myFetcher: Fetcher = (url, ops) => {
|
|||||||
// Do some fetching
|
// Do some fetching
|
||||||
return {
|
return {
|
||||||
body: {},
|
body: {},
|
||||||
finalUrl: "",
|
finalUrl: '',
|
||||||
headers: new Headers(), // should only contain headers from ops.readHeaders
|
headers: new Headers(), // should only contain headers from ops.readHeaders
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
};
|
};
|
||||||
|
@@ -67,7 +67,7 @@ const providers = buildProviders()
|
|||||||
rank: 800,
|
rank: 800,
|
||||||
flags: [],
|
flags: [],
|
||||||
scrapeMovie(ctx) {
|
scrapeMovie(ctx) {
|
||||||
throw new Error("Not implemented");
|
throw new Error('Not implemented');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.build();
|
.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:
|
All streams have a list of captions at `Stream.captions`. The structure looks like this:
|
||||||
```ts
|
```ts
|
||||||
type Caption = {
|
type Caption = {
|
||||||
type: CaptionType; // language type, either 'srt' or 'vtt'
|
type: CaptionType; // language type, either "srt" or "vtt"
|
||||||
id: string; // only unique per stream
|
id: string; // only unique per stream
|
||||||
url: string; // the url pointing to the subtitle file
|
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
|
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
|
# Arcane S1E1 - showbox
|
||||||
npm run cli -- -sid zoechip -tid 94605 -s 1 -e 1
|
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
|
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
|
## Example
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { targets, makeProviders, makeDefaultFetcher } from "@movie-web/providers";
|
import { targets, makeProviders, makeDefaultFetcher } from '@movie-web/providers';
|
||||||
|
|
||||||
const providers = makeProviders({
|
const providers = makeProviders({
|
||||||
fetcher: makeDefaultFetcher(fetch),
|
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
|
// media from TMDB
|
||||||
const media = {
|
const media = {
|
||||||
type: 'movie',
|
type: 'movie',
|
||||||
title: "Hamilton",
|
title: 'Hamilton',
|
||||||
releaseYear: 2020,
|
releaseYear: 2020,
|
||||||
tmdbId: "556574"
|
tmdbId: '556574'
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrape a stream
|
// scrape a stream
|
||||||
|
@@ -5,14 +5,14 @@ Run a specific source scraper and get its outputted streams.
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { SourcererOutput, NotFoundError } from "@movie-web/providers";
|
import { SourcererOutput, NotFoundError } from '@movie-web/providers';
|
||||||
|
|
||||||
// media from TMDB
|
// media from TMDB
|
||||||
const media = {
|
const media = {
|
||||||
type: 'movie',
|
type: 'movie',
|
||||||
title: "Hamilton",
|
title: 'Hamilton',
|
||||||
releaseYear: 2020,
|
releaseYear: 2020,
|
||||||
tmdbId: "556574"
|
tmdbId: '556574'
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrape a stream from flixhq
|
// scrape a stream from flixhq
|
||||||
@@ -24,15 +24,15 @@ try {
|
|||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof NotFoundError) {
|
if (err instanceof NotFoundError) {
|
||||||
console.log("source doesnt have this media");
|
console.log('source doesnt have this media');
|
||||||
} else {
|
} else {
|
||||||
console.log("failed to scrape")
|
console.log('failed to scrape')
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!output.stream && output.embeds.length === 0) {
|
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
|
## Example
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { SourcererOutput } from "@movie-web/providers";
|
import { SourcererOutput } from '@movie-web/providers';
|
||||||
|
|
||||||
// scrape a stream from upcloud
|
// scrape a stream from upcloud
|
||||||
let output: EmbedOutput;
|
let output: EmbedOutput;
|
||||||
@@ -15,7 +15,7 @@ try {
|
|||||||
url: 'https://example.com/123',
|
url: 'https://example.com/123',
|
||||||
})
|
})
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log("failed to scrape")
|
console.log('failed to scrape')
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -5,7 +5,7 @@ Make a fetcher from a `fetch()` API. It is used for making a instance of provide
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { targets, makeProviders, makeDefaultFetcher } from "@movie-web/providers";
|
import { targets, makeProviders, makeDefaultFetcher } from '@movie-web/providers';
|
||||||
|
|
||||||
const providers = makeProviders({
|
const providers = makeProviders({
|
||||||
fetcher: makeStandardFetcher(fetch),
|
fetcher: makeStandardFetcher(fetch),
|
||||||
|
@@ -5,9 +5,9 @@ Make a fetcher to use with [movie-web/simple-proxy](https://github.com/movie-web
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
```ts
|
```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({
|
const providers = makeProviders({
|
||||||
fetcher: makeDefaultFetcher(fetch),
|
fetcher: makeDefaultFetcher(fetch),
|
||||||
|
Reference in New Issue
Block a user