mirror of
https://github.com/p-stream/providers.git
synced 2026-05-20 20:22:05 +00:00
update docs
This commit is contained in:
parent
8d2ac208b9
commit
401f38a9d5
2 changed files with 31 additions and 6 deletions
|
|
@ -351,6 +351,9 @@ if (!apiResponse.success) {
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Protected Streams
|
### 4. Protected Streams
|
||||||
|
There are several ways to bypass protections on streams.
|
||||||
|
|
||||||
|
Using the M3U8 proxy:
|
||||||
```typescript
|
```typescript
|
||||||
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
import { createM3U8ProxyUrl } from '@/utils/proxy';
|
||||||
|
|
||||||
|
|
@ -366,7 +369,28 @@ return {
|
||||||
id: 'primary',
|
id: 'primary',
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
playlist: createM3U8ProxyUrl(originalPlaylist, streamHeaders),
|
playlist: createM3U8ProxyUrl(originalPlaylist, streamHeaders),
|
||||||
flags: [], // Proxy handles CORS
|
flags: [flags.CORS_ALLOWED], // Proxy bypasses cors so we say it's allowed
|
||||||
|
captions: []
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
Using the browser extension:
|
||||||
|
```typescript
|
||||||
|
// For streams that require special headers
|
||||||
|
const streamHeaders = {
|
||||||
|
'Referer': 'https://player.example.com/',
|
||||||
|
'Origin': 'https://player.example.com',
|
||||||
|
'User-Agent': 'Mozilla/5.0...'
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
stream: [{
|
||||||
|
id: 'primary',
|
||||||
|
type: 'hls',
|
||||||
|
playlist: originalPlaylist,
|
||||||
|
headers: streamHeaders,
|
||||||
|
flags: [], // Use the extension becuase it can pass headers
|
||||||
captions: []
|
captions: []
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|
@ -448,7 +472,7 @@ pnpm cli --source-id turbovid --url "https://turbovid.eu/embed/DjncbDBEmbLW"
|
||||||
type: 'hls',
|
type: 'hls',
|
||||||
id: 'primary',
|
id: 'primary',
|
||||||
playlist: 'https://proxy.fifthwit.net/m3u8-proxy?url=https%3A%2F%2Fqueenselti.pro%2Fwrofm%2Fuwu.m3u8&headers=%7B%22referer%22%3A%22https%3A%2F%2Fturbovid.eu%2F%22%2C%22origin%22%3A%2F%2Fturbovid.eu%22%7D',
|
playlist: 'https://proxy.fifthwit.net/m3u8-proxy?url=https%3A%2F%2Fqueenselti.pro%2Fwrofm%2Fuwu.m3u8&headers=%7B%22referer%22%3A%22https%3A%2F%2Fturbovid.eu%2F%22%2C%22origin%22%3A%2F%2Fturbovid.eu%22%7D',
|
||||||
flags: [],
|
flags: [flags.CORS_ALLOWED],
|
||||||
captions: []
|
captions: []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,15 @@ Run all providers one by one in order of their built-in ranking.
|
||||||
You can attach events if you need to know what is going on while it is processing.
|
You can attach events if you need to know what is going on while it is processing.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
(Use the cli to learn more specifics about inputs)
|
||||||
```ts
|
```ts
|
||||||
// media from TMDB
|
// media from TMDB
|
||||||
const media = {
|
const media = {
|
||||||
type: 'movie',
|
type: 'movie', // "movie" | "show"
|
||||||
title: 'Hamilton',
|
title: 'Hamilton',
|
||||||
releaseYear: 2020,
|
tmdbId: '556574',
|
||||||
tmdbId: '556574'
|
// season: '1',
|
||||||
|
// episode: '1'
|
||||||
}
|
}
|
||||||
|
|
||||||
// scrape a stream
|
// scrape a stream
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue