mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-14 11:51:47 +00:00
chore: improve readability
This commit is contained in:
@ -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)}`;
|
||||
};
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user