Closed lnfnunes closed 6 years ago
@danguilherme please check again!
That's very odd, but I'm trying to reproduce the issue now (in the develop
branch first), and it always returns results from the YouTube search, thus not causing the original error.
I'm running:
$ node index.js playlist "Bostjan Bele" 37i9dQZF1DWTvNyxOwkztu --verbose # running locally
[spotivy v0.4.3]
[DEBUG] Loaded options:
{
"spotifyClientId": "xxx",
"spotifyClientSecret": "xxx",
"youtubeKey": "xxx",
"output": "/home/danguilherme/git/danguilherme/spotivy/media",
"format": "video",
"quality": "highest",
"flat": false,
"audio": false,
"username": "Bostjan Bele",
"playlists": [
"37i9dQZF1DWTvNyxOwkztu"
]
}
Saving media to '/home/danguilherme/git/danguilherme/spotivy/media'
[DEBUG] Spotify login
[Downloading playlist] Chillout Lounge
[DEBUG] Fetching playlist tracks (37i9dQZF1DWTvNyxOwkztu)
[DEBUG] Fetch paginated: "getPlaylistTracks"
[DEBUG] Fetch paginated: loading 0..20
[DEBUG] Fetch paginated: loaded 20/90
[DEBUG] Fetch paginated: pushing down the stream
[Downloading track] Daxten - Late Nights
[DEBUG] Search video: search "Daxten - Late Nights"
[DEBUG] Fetch paginated: next page
[DEBUG] Search video: 20 item(s) returned # <---- HERE - in yours, it doesn't return anything
[DEBUG] Search music video: None of the videos is considered a good result
[DEBUG] Search music video: selected "Daxten - Late Nights", by Stackin' Records
[DEBUG] Download from: https://www.youtube.com/watch?v=WjeZjeM0liY
[DEBUG] Download to : /home/danguilherme/git/danguilherme/spotivy/media/Chillout Lounge/Daxten - Late Nights.mp4
[DEBUG] Finish write: Daxten - Late Nights
... continues ...
Do you have any idea on why this happens?
Hummm... think I got it!
This don't mean shouldn't download the video/audio, this only says no "good" result was found and the first one will be downloaded...
So, the bug (issue) is when the function searchVideo
returns an empty array!
To simulate the bug, change line 31
resolve(results.items);
to resolve([]);
My test case was wrong in the first... fixed now with an update.
Hey, @danguilherme could you test it again? If you find anything else please let me know
Sounds great, thanks!
This PR fixes issue #9
Result: