Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Song matching improvements #1279

Merged
merged 18 commits into from
May 24, 2021
Merged

Song matching improvements #1279

merged 18 commits into from
May 24, 2021

Conversation

xnetcat
Copy link
Member

@xnetcat xnetcat commented Apr 29, 2021

Title

Song matching improvements

Description

We were getting videos, songs, playlists, users etc from ytmusicapi and filtering only songs and videos. Now instead we first lookup for songs only and try to find result with avgMatch of 80 or higher. If we don't find such result we make another query to yt music requesting video results. Then we just sort all results and get the one with highest match value

Related Issue

#1273

Motivation and Context

Sometimes users could get wrong results or no results. This PR fixes this

How Has This Been Tested?

Screenshots (if appropriate)

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have read the CONTRIBUTING document
  • I have read the CORE VALUES document
  • I have added tests to cover my changes
  • All new and existing tests passed

@xnetcat xnetcat linked an issue Apr 29, 2021 that may be closed by this pull request
@xnetcat xnetcat added Bug Fix PRs that fix bugs Enhancement Enhancing spotDL labels Apr 29, 2021
@xnetcat xnetcat requested review from a user and Silverarmor May 1, 2021 09:40
@ghost
Copy link

ghost commented May 1, 2021

I'll review it when free but first look through this thread, Levenshtein distances are a big part of the matching problem. It's convenient but not necessarily the best. It's also a heavy dependency that's barely used.

Also look at this, some results are best dropped at the search level before figuring out the avg_match as these are "obviously wrong results".

@Silverarmor Silverarmor merged commit a50db1a into spotDL:dev May 24, 2021
@xnetcat xnetcat deleted the song-matching-imporvements branch May 24, 2021 11:25
Silverarmor added a commit that referenced this pull request May 25, 2021
Publish v3.6.0

* ignore .cache and other hidden files (#1274)

* Bump minimal required python version to 3.6.1 (#1278)

* Remove FFmpeg normalization causing "quiet" songs. (#1276)

* Saved Songs Download and User Authentication (#1240)

* regenerate cassettes (#1290)

* Use ffmpeg_path to check for version (#1289)

* Skip already downloaded songs before doing youtube search (#1287)

* Fix security risk (#1285)

* Song matching improvements (#1279)

* Artist songs fixes (#1284)

* More output formats (#1244)

* Bump version number to 3.6.0

* Update .gitignore to remove duplicate cache

* docs update (#1293)


Co-authored-by: Silverarmor <23619946+Silverarmor@users.noreply.github.com>
Co-authored-by: Jakub Kot <42355410+xnetcat@users.noreply.github.com>
Co-authored-by: Peyton Creery <44987569+phcreery@users.noreply.github.com>
Co-authored-by: AZMCode <adrianozambrana@protonmail.com>
Co-authored-by: Aiden Gardner <19619206+aiden2480@users.noreply.github.com>
Co-authored-by: Oliver Blanthorn <freedom4cows@gmail.com>
Co-authored-by: Andrzej Klajnert <github@aklajnert.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Fix PRs that fix bugs Enhancement Enhancing spotDL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Song Download Mismatch (Wrong Download/No Downloaded)
2 participants