2022-03-21 13:21:18 +00:00
|
|
|
// To centralize certain values and URLs as for easier debugging and refactoring
|
2022-03-17 05:57:28 +00:00
|
|
|
|
2022-03-18 06:15:19 +00:00
|
|
|
const url = {
|
2022-03-21 23:47:11 +00:00
|
|
|
YT_URL: "https://www.youtube.com",
|
|
|
|
YT_MOBILE: "https://m.youtube.com",
|
|
|
|
YT_MUSIC_URL: "https://music.youtube.com",
|
|
|
|
YT_BASE_API: "https://www.youtube.com/youtubei/v1",
|
|
|
|
YT_SUGGESTIONS: "https://suggestqueries.google.com/complete",
|
|
|
|
VT_GITHUB: "https://api.github.com/repos/Frontesque/VueTube",
|
|
|
|
};
|
2022-03-18 06:15:19 +00:00
|
|
|
|
|
|
|
const ytApiVal = {
|
2022-03-21 23:47:11 +00:00
|
|
|
VERSION: "16.25",
|
|
|
|
CLIENTNAME: "ANDROID",
|
2022-04-13 10:15:26 +00:00
|
|
|
VERSION_WEB: "2.20220411.09.00",
|
2022-04-21 05:29:50 +00:00
|
|
|
CLIENT_WEB_M: 2,
|
|
|
|
CLIENT_WEB_D: 1,
|
2022-03-21 23:47:11 +00:00
|
|
|
};
|
2022-03-18 06:15:19 +00:00
|
|
|
|
2022-04-07 00:23:01 +00:00
|
|
|
const filesystem = {
|
2022-06-22 05:24:06 +00:00
|
|
|
plugins: "plugins",
|
2022-04-18 05:58:59 +00:00
|
|
|
};
|
2022-04-07 00:23:01 +00:00
|
|
|
|
2022-03-17 05:57:28 +00:00
|
|
|
module.exports = {
|
2022-03-21 23:47:11 +00:00
|
|
|
URLS: url,
|
|
|
|
YT_API_VALUES: ytApiVal,
|
2022-04-07 00:23:01 +00:00
|
|
|
fs: filesystem,
|
2022-03-21 23:47:11 +00:00
|
|
|
LOGGER_NAMES: {
|
|
|
|
search: "Search",
|
|
|
|
autoComplete: "AutoComplete",
|
|
|
|
watch: "Watch",
|
|
|
|
recommendations: "Recommendations",
|
|
|
|
init: "Initialize",
|
|
|
|
innertube: "Innertube",
|
2022-05-04 05:21:14 +00:00
|
|
|
channel: "Channel",
|
2022-03-21 23:47:11 +00:00
|
|
|
},
|
2022-03-19 05:35:28 +00:00
|
|
|
|
2022-03-21 23:47:11 +00:00
|
|
|
INNERTUBE_HEADER: (info) => {
|
|
|
|
let headers = {
|
|
|
|
accept: "*/*",
|
|
|
|
"user-agent": info.userAgent,
|
|
|
|
"accept-language": `${info.hl}-${info.gl},${info.hl};q=0.9`,
|
|
|
|
"content-type": "application/json",
|
|
|
|
"x-goog-authuser": 0,
|
|
|
|
"x-goog-visitor-id": info.visitorData || "",
|
|
|
|
"x-youtube-client-name": ytApiVal.CLIENTNAME,
|
|
|
|
"x-youtube-client-version": ytApiVal.VERSION,
|
|
|
|
};
|
|
|
|
return headers;
|
|
|
|
},
|
2022-03-18 06:15:19 +00:00
|
|
|
|
2022-03-21 23:47:11 +00:00
|
|
|
INNERTUBE_CLIENT: (info) => {
|
|
|
|
let client = {
|
|
|
|
gl: info.gl,
|
|
|
|
hl: info.hl,
|
|
|
|
deviceMake: info.deviceMake,
|
|
|
|
deviceModel: info.deviceModel,
|
|
|
|
userAgent: info.userAgent,
|
|
|
|
clientName: ytApiVal.CLIENTNAME,
|
|
|
|
clientVersion: ytApiVal.VERSION,
|
|
|
|
osName: info.osName,
|
|
|
|
osVersion: info.osVersion,
|
|
|
|
platform: "MOBILE",
|
|
|
|
originalUrl: info.originalUrl,
|
|
|
|
configInfo: info.configInfo,
|
|
|
|
remoteHost: info.remoteHost,
|
|
|
|
visitorData: info.visitorData,
|
|
|
|
};
|
|
|
|
return client;
|
|
|
|
},
|
|
|
|
};
|