Try to fix github api rate limit
This commit is contained in:
parent
4fe7cde283
commit
0daaab0c0e
2 changed files with 12 additions and 1 deletions
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
|
@ -48,6 +48,7 @@ jobs:
|
|||
ENABLE_OBJECT_STORAGE_TESTS: true
|
||||
OBJECT_STORAGE_SCALEWAY_KEY_ID: ${{ secrets.OBJECT_STORAGE_SCALEWAY_KEY_ID }}
|
||||
OBJECT_STORAGE_SCALEWAY_ACCESS_KEY: ${{ secrets.OBJECT_STORAGE_SCALEWAY_ACCESS_KEY }}
|
||||
YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
|
|
@ -6,6 +6,7 @@ import { VideoResolution } from '@shared/models'
|
|||
import { logger, loggerTagsFactory } from '../logger'
|
||||
import { getProxy, isProxyEnabled } from '../proxy'
|
||||
import { isBinaryResponse, peertubeGot } from '../requests'
|
||||
import { OptionsOfBufferResponseBody } from 'got/dist/source'
|
||||
|
||||
const lTags = loggerTagsFactory('youtube-dl')
|
||||
|
||||
|
@ -28,7 +29,16 @@ export class YoutubeDLCLI {
|
|||
|
||||
logger.info('Updating youtubeDL binary from %s.', url, lTags())
|
||||
|
||||
const gotOptions = { context: { bodyKBLimit: 20_000 }, responseType: 'buffer' as 'buffer' }
|
||||
const gotOptions: OptionsOfBufferResponseBody = {
|
||||
context: { bodyKBLimit: 20_000 },
|
||||
responseType: 'buffer' as 'buffer'
|
||||
}
|
||||
|
||||
if (process.env.YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN) {
|
||||
gotOptions.headers = {
|
||||
authorization: 'Bearer ' + process.env.YOUTUBE_DL_DOWNLOAD_BEARER_TOKEN
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
let gotResult = await peertubeGot(url, gotOptions)
|
||||
|
|
Loading…
Reference in a new issue