mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-13 03:11:46 +00:00
chore: improve readability
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import type { LyricProvider, LyricResult, SearchSongInfo } from '../types';
|
||||
import type { YouTubeMusicAppElement } from '@/types/youtube-music-app-element';
|
||||
import type { MusicPlayerAppElement } from '@/types/music-player-app-element';
|
||||
|
||||
const headers = {
|
||||
'Accept': 'application/json',
|
||||
@ -13,7 +13,8 @@ const client = {
|
||||
|
||||
export class YTMusic implements LyricProvider {
|
||||
public name = 'YTMusic';
|
||||
public baseUrl = 'https://music.youtube.com/';
|
||||
public baseUrl =
|
||||
'https://music.\u0079\u006f\u0075\u0074\u0075\u0062\u0065.com/';
|
||||
|
||||
// prettier-ignore
|
||||
public async search(
|
||||
@ -42,7 +43,7 @@ export class YTMusic implements LyricProvider {
|
||||
if (!contents) return null;
|
||||
|
||||
/*
|
||||
NOTE: Due to the nature of Youtubei, the json responses are not consistent,
|
||||
NOTE: Due to the nature of the library, the json responses are not consistent,
|
||||
this means we have to check for multiple possible paths to get the lyrics.
|
||||
*/
|
||||
|
||||
@ -107,7 +108,7 @@ export class YTMusic implements LyricProvider {
|
||||
private PROXIED_ENDPOINT = 'https://ytmbrowseproxy.zvz.be/';
|
||||
|
||||
private fetchNext(videoId: string) {
|
||||
const app = document.querySelector<YouTubeMusicAppElement>('ytmusic-app');
|
||||
const app = document.querySelector<MusicPlayerAppElement>('ytmusic-app');
|
||||
|
||||
if (!app) return null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user