chore: improve readability

This commit is contained in:
Su-Yong
2025-10-12 14:28:29 +09:00
parent 4f716d8e0b
commit ffa61687bf
137 changed files with 2625 additions and 2626 deletions

View File

@ -7,13 +7,13 @@ export const extractToken = (cookie = document.cookie) =>
export const getHash = async (
papisid: string,
millis = Date.now(),
origin: string = 'https://music.youtube.com',
origin: string = 'https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com',
) => (await SHA1Hash(`${millis} ${papisid} ${origin}`)).toLowerCase();
export const getAuthorizationHeader = async (
papisid: string,
millis = Date.now(),
origin: string = 'https://music.youtube.com',
origin: string = 'https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com',
) => {
return `SAPISIDHASH ${millis}_${await getHash(papisid, millis, origin)}`;
};

View File

@ -1,4 +1,4 @@
import type { YouTubeMusicAppElement } from '@/types/youtube-music-app-element';
import type { MusicPlayerAppElement } from '@/types/music-player-app-element';
import type { QueueElement } from '@/types/queue';
type QueueRendererResponse = {
@ -13,7 +13,7 @@ export const getMusicQueueRenderer = async (
videoIds: string[],
): Promise<QueueRendererResponse | null> => {
const queue = document.querySelector<QueueElement>('#queue');
const app = document.querySelector<YouTubeMusicAppElement>('ytmusic-app');
const app = document.querySelector<MusicPlayerAppElement>('ytmusic-app');
if (!app) return null;
const store = queue?.queue.store.store;