This repository was archived by the owner on Mar 11, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 * See LICENSE in the project root for license information.
88 */
99
10+ import * as ytMusic from 'node-youtube-music'
11+
1012import { CacheHandler } from './cacheFile'
11- import { escapeRegExp } from '@/utils/common'
1213import { app } from 'electron'
13- import * as ytMusic from 'node-youtube-music '
14+ import { escapeRegExp } from '@/utils/common '
1415import path from 'path'
1516import ytdl from 'ytdl-core'
1617import ytpl from 'ytpl'
@@ -173,8 +174,9 @@ export class YTScraper extends CacheHandler {
173174 private parseYoutubeMusicPlaylist ( ...playlist : ytMusic . PlaylistPreview [ ] ) : Playlist [ ] {
174175 const playlists : Playlist [ ] = [ ]
175176 for ( const a of playlist ) {
177+ const parsedPlaylistId = a . playlistId ?. startsWith ( 'VL' ) ? a . playlistId . substring ( 2 ) : a . playlistId
176178 playlists . push ( {
177- playlist_id : `youtube-author :${ a . playlistId } ` ,
179+ playlist_id : `youtube-playlist :${ parsedPlaylistId } ` ,
178180 playlist_name : a . title ?? '' ,
179181 playlist_coverPath : a . thumbnailUrl ,
180182 } )
@@ -514,6 +516,7 @@ export class YTScraper extends CacheHandler {
514516 songs = await ytpl . continueReq ( page )
515517 }
516518 } catch ( e ) {
519+ console . error ( e )
517520 return { songs : [ ] }
518521 }
519522
You can’t perform that action at this time.
0 commit comments