mirror of
https://codeberg.org/lucida/lucida.git
synced 2026-11-12 14:47:24 -05:00
oops all bug fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lucida",
|
||||
"version": "1.2.3",
|
||||
"version": "1.2.4",
|
||||
"description": "A modular downloader tool",
|
||||
"main": "build/index.js",
|
||||
"type": "module",
|
||||
|
||||
@@ -232,7 +232,8 @@ async function fetchKey(response: string) {
|
||||
if (typeof streamKey == 'string') continue
|
||||
|
||||
const key = keys[i].split(`"`)[0]
|
||||
const keyregex = /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$/
|
||||
const keyregex =
|
||||
/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)$/
|
||||
if (!keyregex.test(key)) continue
|
||||
|
||||
const script = await (await fetch(key)).text()
|
||||
|
||||
@@ -64,7 +64,7 @@ export async function parseAlbum(raw: RawAlbum): Promise<Album> {
|
||||
releaseDate: new Date(raw.release_date),
|
||||
artists: [parseArtist(raw.user)]
|
||||
}
|
||||
if (raw.tracks?.[0]?.artwork_url) {
|
||||
if (raw.tracks?.[0]?.artwork_url != undefined) {
|
||||
album.coverArtwork = [
|
||||
await parseCoverArtwork(raw.tracks[0].artwork_url.replace('-large', '-original'))
|
||||
]
|
||||
@@ -94,8 +94,8 @@ export async function parseTrack(raw: RawTrack): Promise<Track> {
|
||||
durationMs: raw.media?.transcodings?.[0]?.duration
|
||||
}
|
||||
|
||||
if (raw.artwork_url) {
|
||||
track.coverArtwork = [await parseCoverArtwork(raw.artwork_url?.replace('-large', '-original'))]
|
||||
if (raw?.artwork_url != undefined) {
|
||||
track.coverArtwork = [await parseCoverArtwork(raw?.artwork_url?.replace('-large', '-original'))]
|
||||
}
|
||||
|
||||
return track
|
||||
|
||||
Reference in New Issue
Block a user