mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +00:00
chore: remove unused code
This commit is contained in:
@@ -56,24 +56,11 @@ export const INNERTUBE_HEADERS_BASE = Object.freeze({
|
||||
'accept-encoding': 'gzip, deflate',
|
||||
'content-type': 'application/json'
|
||||
});
|
||||
export const ACCOUNT_SETTINGS = Object.freeze({
|
||||
// Notifications
|
||||
SUBSCRIPTIONS: 'NOTIFICATION_SUBSCRIPTION_NOTIFICATIONS',
|
||||
RECOMMENDED_VIDEOS: 'NOTIFICATION_RECOMMENDATION_WEB_CONTROL',
|
||||
CHANNEL_ACTIVITY: 'NOTIFICATION_COMMENT_WEB_CONTROL',
|
||||
COMMENT_REPLIES: 'NOTIFICATION_COMMENT_REPLY_OTHER_WEB_CONTROL',
|
||||
USER_MENTION: 'NOTIFICATION_USER_MENTION_WEB_CONTROL',
|
||||
SHARED_CONTENT: 'NOTIFICATION_RETUBING_WEB_CONTROL',
|
||||
// Privacy
|
||||
PLAYLISTS_PRIVACY: 'PRIVACY_DISCOVERABLE_SAVED_PLAYLISTS',
|
||||
SUBSCRIPTIONS_PRIVACY: 'PRIVACY_DISCOVERABLE_SUBSCRIPTIONS'
|
||||
});
|
||||
|
||||
export default {
|
||||
URLS,
|
||||
OAUTH,
|
||||
CLIENTS,
|
||||
STREAM_HEADERS,
|
||||
INNERTUBE_HEADERS_BASE,
|
||||
ACCOUNT_SETTINGS
|
||||
INNERTUBE_HEADERS_BASE
|
||||
};
|
||||
@@ -2,8 +2,6 @@ import package_json from '../../package.json';
|
||||
import { FetchFunction } from './HTTPClient';
|
||||
import userAgents from './user-agents.json';
|
||||
|
||||
const VALID_CLIENTS = new Set([ 'YOUTUBE', 'YTMUSIC' ]);
|
||||
|
||||
export class InnertubeError extends Error {
|
||||
date: Date;
|
||||
version: string;
|
||||
@@ -153,21 +151,6 @@ export function timeToSeconds(time: string) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts strings in camelCase to snake_case.
|
||||
* @param string - The string in camelCase.
|
||||
*/
|
||||
export function camelToSnake(string: string) {
|
||||
return string[0].toLowerCase() + string.slice(1, string.length).replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a given client is valid.
|
||||
*/
|
||||
export function isValidClient(client: string) {
|
||||
return VALID_CLIENTS.has(client);
|
||||
}
|
||||
|
||||
/**
|
||||
* Throws an error if given parameters are undefined.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user