mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-14 15:47:27 -05:00
lint
This commit is contained in:
@@ -9,6 +9,7 @@ export const DEFAULT_HEADERS = {
|
|||||||
'Sec-Fetch-Mode': 'cors',
|
'Sec-Fetch-Mode': 'cors',
|
||||||
'Sec-Fetch-Site': 'same-site',
|
'Sec-Fetch-Site': 'same-site',
|
||||||
'Sec-GPC': '1',
|
'Sec-GPC': '1',
|
||||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
|
'User-Agent':
|
||||||
|
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
|
||||||
}
|
}
|
||||||
export const SC_VERSION = '1686222762'
|
export const SC_VERSION = '1686222762'
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
|
|
||||||
function headers(oauthToken?: string | undefined): HeadersInit {
|
function headers(oauthToken?: string | undefined): HeadersInit {
|
||||||
const headers: HeadersInit = DEFAULT_HEADERS
|
const headers: HeadersInit = DEFAULT_HEADERS
|
||||||
if (oauthToken) headers['Authorization'] = 'OAuth ' + oauthToken;
|
if (oauthToken) headers['Authorization'] = 'OAuth ' + oauthToken
|
||||||
return headers
|
return headers
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ export default class Soundcloud implements Streamer {
|
|||||||
hostnames = ['soundcloud.com', 'm.soundcloud.com', 'www.soundcloud.com']
|
hostnames = ['soundcloud.com', 'm.soundcloud.com', 'www.soundcloud.com']
|
||||||
oauthToken?: string
|
oauthToken?: string
|
||||||
constructor(options: SoundcloudOptions) {
|
constructor(options: SoundcloudOptions) {
|
||||||
this.oauthToken = options.oauthToken;
|
this.oauthToken = options.oauthToken
|
||||||
}
|
}
|
||||||
async search(query: string, limit = 20): Promise<SearchResults> {
|
async search(query: string, limit = 20): Promise<SearchResults> {
|
||||||
const client = await this.#getClient()
|
const client = await this.#getClient()
|
||||||
@@ -151,7 +151,12 @@ export default class Soundcloud implements Streamer {
|
|||||||
return {
|
return {
|
||||||
type: 'track',
|
type: 'track',
|
||||||
getStream: async () => {
|
getStream: async () => {
|
||||||
return await getStream(api.media.transcodings, api.track_authorization, client, this.oauthToken)
|
return await getStream(
|
||||||
|
api.media.transcodings,
|
||||||
|
api.track_authorization,
|
||||||
|
client,
|
||||||
|
this.oauthToken
|
||||||
|
)
|
||||||
},
|
},
|
||||||
metadata: await parseTrack(api)
|
metadata: await parseTrack(api)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ export interface RawArtist {
|
|||||||
|
|
||||||
export interface Headers {
|
export interface Headers {
|
||||||
Authorization?: string
|
Authorization?: string
|
||||||
"User-Agent": string
|
'User-Agent': string
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseArtist(raw: RawArtist): Artist {
|
export function parseArtist(raw: RawArtist): Artist {
|
||||||
|
|||||||
Reference in New Issue
Block a user