mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-17 13:49:58 +00:00
21 lines
458 B
JavaScript
21 lines
458 B
JavaScript
|
import { genericUserAgent } from "../config.js";
|
||
|
|
||
|
const defaultHeaders = {
|
||
|
'user-agent': genericUserAgent
|
||
|
}
|
||
|
|
||
|
const serviceHeaders = {
|
||
|
bilibili: {
|
||
|
referer: 'https://www.bilibili.com/'
|
||
|
},
|
||
|
youtube: {
|
||
|
accept: '*/*',
|
||
|
origin: 'https://www.youtube.com',
|
||
|
referer: 'https://www.youtube.com',
|
||
|
DNT: '?1'
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export function getHeaders(service) {
|
||
|
return { ...defaultHeaders, ...serviceHeaders[service] }
|
||
|
}
|