Closed RowanSkie closed 3 years ago
Additional information:
I don't think that this is a bug in spotdl. ytmusicapi
sometimes returns results without artists so spotdl can't filter out the wrong results that's why you get No matches found error
or wrong songs. I am not sure if we can fix this here
Maybe you could use the length data to sort results with the least length mismatch
Maybe you could use the length data to sort results with the least length mismatch
We are already doing this https://github.com/spotDL/spotify-downloader/blob/master/spotdl/search/provider.py#L237
Maybe you could use the length data to sort results with the least length mismatch
We are already doing this https://github.com/spotDL/spotify-downloader/blob/master/spotdl/search/provider.py#L237
for some reason downloaded an hour long version for me, let me recheck, maybe im not using latest
seems weird, i'm on latest, and when downloading this track it looked up this one hour version instead
seems weird, i'm on latest, and when downloading this track it looked up this one hour version instead
What is your ytmusicapi
version? pip show ytmusicapi
to check version
from ytmusicapi import YTMusic
client = YTMusic()
song_results = client.search("clouds", filter="songs")
video_results = client.search("clouds", filter="videos")
results = song_results + video_results
for result in results:
print(result["duration"])
Can you run this script and paste output here? It should look something like this
seems weird, i'm on latest, and when downloading this track it looked up this one hour version instead
What is your
ytmusicapi
version?pip show ytmusicapi
to check versionfrom ytmusicapi import YTMusic client = YTMusic() song_results = client.search("clouds", filter="songs") video_results = client.search("clouds", filter="videos") results = song_results + video_results for result in results: print(result["duration"])
Can you run this script and paste output here? It should look something like this
Okay, so I did that while he hasn't responded, and here's what I got:
C:\Users\xterm>pip show ytmusicapi
Name: ytmusicapi
Version: 0.16.0
Summary: Unofficial API for YouTube Music
Home-page: https://github.com/sigma67/ytmusicapi
Author: sigma67
Author-email:
License: MIT
Location: c:\pl\python39\lib\site-packages
Requires: requests
Required-by: spotdl
C:\Users\xterm>D:
D:\>cd workbench
D:\Workbench>py test.py
4:32
3:05
4:04
3:00
3:52
3:11
3:50
3:10
4:17
4:26
5:24
4:38
4:14
3:05
3:13
5:37
4:35
2:40
2:41
9:20
4:14
3:04
4:38
3:14
3:50
7:14
4:39
3:04
4:04
3:50
2:57
10:00:00
2:44
57:03
3:35
3:05
56:59
3:50
4:16
3:05
Ok, I've did some research
I think I can fix the issue with searching for the first song, but I am not so sure about the second one. The bugfix will probably help with the other problems that you mentioned
https://github.com/xnetcat/spotify-downloader/tree/song-matching-imprv-working
/cc @MikhailZex
Ok, I've did some research
- First track gets the wrong results because youtube music api returns way more video type results than song results and the correct one isn't even included in the api response.
- Second track couldn't be found because on spotify the artist name is "Potap & Nastya", while on the yotube it's "Потап и Настя", they are written in different languages that's why spotdl fails
I think I can fix the issue with searching for the first song, but I am not so sure about the second one. The bugfix will probably help with the other problems that you mentioned
https://github.com/xnetcat/spotify-downloader/tree/song-matching-imprv-working
/cc @MikhailZex
I can ignore the second one, to be honest. It's expected, since it's a Russian song.
@RowanSkie looks like I've fixed the issues with song matching. Here's the code https://github.com/xnetcat/spotify-downloader/tree/song-matching-imprv-working go ahead and try it but be aware that it's not ready for production yet, I am still fixing bugs
The current matching system goes for the best possible match, there are no conditions specified to "discard obviously wrong results" i.e. results that are clearly wrong to human beings looking at them but technically score a closer match according to the chose match criteria. A good example of something like this when spotdl downloads a "instrumental cover" of a song instead of the slightly longer original from YouTube.
The below results are from my personal retrofitted spotdl copy, if they are accurate you can use my copy.
The current matching system goes for the best possible match, there are no conditions specified to "discard obviously wrong results" i.e. results that are clearly wrong to human beings looking at them but technically score a closer match according to the chose match criteria. A good example of something like this when spotdl downloads a "instrumental cover" of a song instead of the slightly longer original from YouTube.
The below results are from my personal retrofitted spotdl copy, if they are accurate you can use my copy.
Okay, so how do I download your copy to my python? I'm not too sure how to install that. The songs are match, after all.
pip install https://github.com/MikhailZex/spotify-downloader/archive/refs/heads/Retrofit.zip --force-reinstall
pip install https://github.com/xnetcat/spotify-downloader/archive/refs/heads/song-matching-improvements.zip --force-reinstall
Okay, so, I've tried both versions and used the following songs:
MikhailZex's version
For xnetcat's version, those that failed got it correct.
What I really like with Zex's version is the fact that it documents the possible errors but it's not... exactly that accurate. Good for personal use, indeed. xnetcat's version is accurate too, except for Chumachechaya Vesna (a Fail with no song detected).
@RowanSkie try again now it should correctly download Chumachechaya Vesna. You will have to reinstall spotdl
What I really like with Zex's version is the fact that it documents the possible errors but it's not... exactly that accurate. Good for personal use, indeed. xnetcat's version is accurate too, except for Chumachechaya Vesna (a Fail with no song detected).
Could you elaborate on the accuracy bit. I'd like to improve it if possible.
What I really like with Zex's version is the fact that it documents the possible errors but it's not... exactly that accurate. Good for personal use, indeed. xnetcat's version is accurate too, except for Chumachechaya Vesna (a Fail with no song detected).
Could you elaborate on the accuracy bit. I'd like to improve it if possible.
I can't really explain it without actually looking on the results. Not sure why, but the fact that two songs failed (A Latin song and a song got the wrong song). It's probably just on the detection side of things, don't worry.
Cool. Could ya send me the Spotify links for the two that failed ?
https://open.spotify.com/track/22C9LUZT1A0BSe09mYrVup (Not Alone)
https://open.spotify.com/track/22C9LUZT1A0BSe09mYrVup (Santiano)
both links are the same
Whoops. Here's for Not Alone: https://open.spotify.com/track/4jkRBTpdsAszuD1N87OI7B?si=1c681684f73142dc
song_name = 'Santiano (feat. SKÁLD)'
album_name = 'Santiano (feat. SKÁLD)'
duration = 129.5 #secs
song_artists = ['The Longest Johns', 'SKÁLD']
The current matching system goes for the best possible match, there are no conditions specified to "discard obviously wrong results" i.e. results that are clearly wrong to human beings looking at them but technically score a closer match according to the chose match criteria. A good example of something like this when spotdl downloads a "instrumental cover" of a song instead of the slightly longer original from YouTube.
As you can see the filtering of "obviously wrong results" filters out most of the returned YTM results. You would get better matches for songs like the 2 that went wrong for you but the total fraction of errors would go up too. Currently the fraction of errors is at ~1% of all results (on a sample set of 600 songs I downloaded to test this). I'd just say bad luck overall.
DURATION_MATCH SKIP: {
"album": null,
"artists": [
"The Longest Johns"
],
"duration": 150,
"link": "https://www.youtube.com/watch?v=oWx7O9bUnMg",
"name": "Santiano (feat. SK\u00c1LD)"
}
----------
DURATION_MATCH SKIP: {
"album": null,
"artists": [
"FlamSparks"
],
"duration": 154,
"link": "https://www.youtube.com/watch?v=4FEeFobviqo",
"name": "SK\u00c1LD ft. The Longest Johns | Santiano (Lyrics & Translation)"
}
----------
DURATION_MATCH SKIP: {
"album": null,
"artists": [
"Lyrics First"
],
"duration": 219,
"link": "https://www.youtube.com/watch?v=6DdRiNmj0wE",
"name": "The Longest Johns - Santiana (Lyrics) (Best Version) | Away Santiana!"
}
----------
DURATION_MATCH SKIP: {
"album": null,
"artists": [
"The Longest Johns"
],
"duration": 242,
"link": "https://www.youtube.com/watch?v=IM6cgSORHt8",
"name": "Lowlands Low | The Longest Johns with @Sean Dagher"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"SK\u00c1LD"
],
"duration": 131,
"link": "https://www.youtube.com/watch?v=aOeFdpVfb8I",
"name": "J\u00f6rmungrund"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"The Longest Johns"
],
"duration": 195,
"link": "https://www.youtube.com/watch?v=8Fow61Zsn2s",
"name": "Leave Her Johnny | The Longest Johns | Mass Choir Community Video Project"
}
----------
NEW TOP MATCH: {
"album": null,
"artists": [
"Colm McGuinness Music"
],
"duration": 115,
"link": "https://www.youtube.com/watch?v=9Qpgh63l2n4",
"name": "Roll, Boys, Roll! (Assassin's Creed IV Black Flag) Shanty"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Longest Johns Gaming"
],
"duration": 6949,
"link": "https://www.youtube.com/watch?v=XB-ljbYRqg4",
"name": "It's folk music time! New banjo! - 11/12/2020 Stream Full VOD"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"The Longest Johns"
],
"duration": 213,
"link": "https://www.youtube.com/watch?v=Dj_0Zz3eOhw",
"name": "The Cruel Wars | The Longest Johns"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Karl Sternau"
],
"duration": 98,
"link": "https://www.youtube.com/watch?v=jPjwCTcqqF0",
"name": "WELLERMAN [German Version by @Der Michel + instrumental by @Karl Sternau [+ English Translation]"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Vikingskog"
],
"duration": 83,
"link": "https://www.youtube.com/watch?v=IErcd74z07Q",
"name": "Mandal-sjanti (Norwegian shanty)"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"SK\u00c1LD"
],
"duration": 138,
"link": "https://www.youtube.com/watch?v=V3qYr1GgmWY",
"name": "S\u00f3larlj\u00f3\u00f0"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Stefan W\u00fcnnemann"
],
"duration": 378,
"link": "https://www.youtube.com/watch?v=4G2bzxNSpsM",
"name": "W\u00fcnne & Udo spielen: \u201cBraw burn the bridges\u201c von The Tannahill Weavers"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Alex Hamel"
],
"duration": 129,
"link": "https://www.youtube.com/watch?v=NdakXBoGFPE",
"name": "Pique le Baleine - AleX Hamel"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Willard Losinger's Music Channel"
],
"duration": 153,
"link": "https://www.youtube.com/watch?v=KlGVEKV18wM",
"name": "Willard Losinger Performs \"Santiano\" (French version) w/ Harmonica & Baritone Ukulele Accompaniment"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Rowan the Bard"
],
"duration": 107,
"link": "https://www.youtube.com/watch?v=Kc2wst6t95c",
"name": "Hondo Ohnaka - Star Shanty #2"
}
----------
NAME_MATCH SKIP: {
"album": null,
"artists": [
"Le Jammie Dodgere"
],
"duration": 230,
"link": "https://www.youtube.com/watch?v=273hw_X1o14",
"name": "Roll Northumbria but your oil tanker is passing through a storm"
}
----------
ALBUM_MATCH SKIP: {
"album": "Santiano",
"artists": [
"The Longest Johns"
],
"duration": 130,
"link": "https://www.youtube.com/watch?v=i7fWziFIJZo",
"name": "Santiano (feat. SK\u00c1LD)"
}
----------
ALBUM_MATCH SKIP: {
"album": "Between Wind And Water",
"artists": [
"The Longest Johns"
],
"duration": 175,
"link": "https://www.youtube.com/watch?v=laY4TcWEbSA",
"name": "Santiana"
}
----------
NAME_MATCH SKIP: {
"album": "Santiano",
"artists": [
"The Longest Johns"
],
"duration": 123,
"link": "https://www.youtube.com/watch?v=GvwqNMvyRRM",
"name": "Tri Martolod"
}
----------
NAME_MATCH SKIP: {
"album": "Between Wind And Water",
"artists": [
"The Longest Johns"
],
"duration": 197,
"link": "https://www.youtube.com/watch?v=qLOJk3eV1zg",
"name": "General Taylor"
}
----------
NAME_MATCH SKIP: {
"album": "Wellerman",
"artists": [
"The Longest Johns",
"Strings Of The London Symphony Orchestra"
],
"duration": 166,
"link": "https://www.youtube.com/watch?v=au7ifkiSnP4",
"name": "Wellerman (with Strings Of The London Symphony Orchestra)"
}
----------
NAME_MATCH SKIP: {
"album": "Between Wind And Water",
"artists": [
"The Longest Johns"
],
"duration": 158,
"link": "https://www.youtube.com/watch?v=uSGpI9ybK9c",
"name": "Sugar In The Hold"
}
----------
NAME_MATCH SKIP: {
"album": "Between Wind And Water",
"artists": [
"The Longest Johns"
],
"duration": 177,
"link": "https://www.youtube.com/watch?v=ZObwftsdOIw",
"name": "Haul Away Joe"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 249,
"link": "https://www.youtube.com/watch?v=4GT59EqPlUQ",
"name": "Oak & Ash & Thorn"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 251,
"link": "https://www.youtube.com/watch?v=uZOJZsxECNw",
"name": "Here's a Health to the Company"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 245,
"link": "https://www.youtube.com/watch?v=V57-k-RaAcQ",
"name": "Bonny Ship the Diamond"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 138,
"link": "https://www.youtube.com/watch?v=flqS1AB3_vI",
"name": "Four Hours"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 201,
"link": "https://www.youtube.com/watch?v=CxdgnEPDDxQ",
"name": "Ashes"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 164,
"link": "https://www.youtube.com/watch?v=u3mbWqRXEJ8",
"name": "Moby Duck"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 172,
"link": "https://www.youtube.com/watch?v=dKB9loUK-BM",
"name": "Got No Beard"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 149,
"link": "https://www.youtube.com/watch?v=0TtxwqQFxEM",
"name": "Fire & Flame"
}
----------
ALBUM_MATCH SKIP: {
"album": "Santiana",
"artists": [
"Gustavo Steiner"
],
"duration": 112,
"link": "https://www.youtube.com/watch?v=Rh0LYF7bTEw",
"name": "Santiana"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 280,
"link": "https://www.youtube.com/watch?v=cfDp8BjR1w4",
"name": "The Banks of the Lee"
}
----------
NAME_MATCH SKIP: {
"album": "Loch Lomond",
"artists": [
"The Hound + The Fox"
],
"duration": 206,
"link": "https://www.youtube.com/watch?v=QiaXrA98ow0",
"name": "Loch Lomond"
}
----------
NAME_MATCH SKIP: {
"album": "A Colm Night At Sea",
"artists": [
"Colm R. McGuinness"
],
"duration": 103,
"link": "https://www.youtube.com/watch?v=r5Qkv4wwtxs",
"name": "Or\u00f3 S\u00e9 do Bheatha 'Bhaile"
}
----------
NAME_MATCH SKIP: {
"album": "Cures What Ails Ya",
"artists": [
"The Longest Johns"
],
"duration": 170,
"link": "https://www.youtube.com/watch?v=Lw3XY6cDEjg",
"name": "Hoist up the Thing"
}
----------
FINAL MATCH: Santiano (feat. SKÁLD) = https://www.youtube.com/watch?v=9Qpgh63l2n4
Huh, that's just weird. I mean, this is just the raw audio Youtube video: https://www.youtube.com/watch?v=i7fWziFIJZo. But hey, that explains why it didn't get detected that close.
What I really like with Zex's version is the fact that it documents the possible errors
If you want you can open new issue, and request this as a feature
Huh, that's just weird. I mean, this is just the raw audio Youtube video: https://www.youtube.com/watch?v=i7fWziFIJZo. But hey, that explains why it didn't get detected that close.
YTM queries don't necessarily return the exact same results as going to music.youtube.com as running as search. So the base results were working with aren't necessarily the same.
It's the same most if the time but not always.
What I really like with Zex's version is the fact that it documents the possible errors
If you want you can open new issue, and request this as a feature
We already tried. I myself self-closed that PR. Fitting in that PR will disrupt almost every other PR created/drafted.
As such is just porting the search system from the redesign to the current version.
Huh, that's just weird. I mean, this is just the raw audio Youtube video: https://www.youtube.com/watch?v=i7fWziFIJZo. But hey, that explains why it didn't get detected that close.
I tried the same:
Oh, well, I guess it's fixed now. Would it be weird if both versions can be merged in a way that doesn't hit the main build itself?
Oh, well, I guess it's fixed now. Would it be weird if both versions can be merged in a way that doesn't hit the main build itself?
Not really
We already tried. I myself self-closed that PR. Fitting in that PR will disrupt almost every other PR created/drafted.
As such is just porting the search system from the redesign to the current version.
Sorry for bumping this issue.
I still find spotdl download the wrong version of the same song sometime
spotdl 'billy joel - pianoman' # piano man works
Maybe add an option to specify the exact youtube link?
@ndgnuh No support is provided for search queries, use Spotify links instead - we are a spotify downloader.
You also are able to pick what youtube video to use:
Environment
System OS: Windows 10
Python Version: Python 3.9.4
Install Source: CMD, pip
Expected Behaviour
Actual Behaviour
For Oak & Ash & Thorn, it downloads this 1 hour video: https://www.youtube.com/watch?v=zIHmPlI4JEs For Chumachechaya Vesna, the song can't be found.
Steps to Reproduce
Traceback
For Oak & Ash & Thorn:
For Chumachechaya Vesna:
Any other information:
Related to other previous issues I've given, specifically #970 and #1089.