🐛 tries to browse an undefined browseId
This commit is contained in:
parent
e25f7e5546
commit
a5e3121a98
|
|
@ -1,27 +1,19 @@
|
|||
import axios, { AxiosInstance } from "axios"
|
||||
import { Cookie, CookieJar } from "tough-cookie"
|
||||
|
||||
import {
|
||||
AlbumDetailed, AlbumFull, ArtistDetailed, ArtistFull, PlaylistFull, SearchResult, SongDetailed,
|
||||
SongFull, VideoDetailed, VideoFull
|
||||
} from "./"
|
||||
import AlbumParser from "./parsers/AlbumParser"
|
||||
import ArtistParser from "./parsers/ArtistParser"
|
||||
import axios, { AxiosInstance } from "axios"
|
||||
import PlaylistParser from "./parsers/PlaylistParser"
|
||||
import SearchParser from "./parsers/SearchParser"
|
||||
import SongParser from "./parsers/SongParser"
|
||||
import VideoParser from "./parsers/VideoParser"
|
||||
import traverse from "./utils/traverse"
|
||||
import traverseList from "./utils/traverseList"
|
||||
import traverseString from "./utils/traverseString"
|
||||
import VideoParser from "./parsers/VideoParser"
|
||||
import {
|
||||
AlbumDetailed,
|
||||
AlbumFull,
|
||||
ArtistDetailed,
|
||||
ArtistFull,
|
||||
PlaylistFull,
|
||||
SearchResult,
|
||||
SongDetailed,
|
||||
SongFull,
|
||||
VideoDetailed,
|
||||
VideoFull
|
||||
} from "."
|
||||
import { Cookie, CookieJar } from "tough-cookie"
|
||||
import { writeFileSync } from "fs"
|
||||
|
||||
export default class YTMusic {
|
||||
private cookiejar: CookieJar
|
||||
|
|
@ -362,6 +354,8 @@ export default class YTMusic {
|
|||
const artistData = await this.constructRequest("browse", { browseId: artistId })
|
||||
const browseToken = traverse(artistData, "musicShelfRenderer", "title", "browseId")
|
||||
|
||||
if (browseToken instanceof Array) return []
|
||||
|
||||
const songsData = await this.constructRequest("browse", { browseId: browseToken })
|
||||
const continueToken = traverse(songsData, "continuation")
|
||||
const moreSongsData = await this.constructRequest(
|
||||
|
|
|
|||
Loading…
Reference in New Issue