Skip to content

Commit

Permalink
Improve youtube connector
Browse files Browse the repository at this point in the history
Use owner name as artist name as fallback.
  • Loading branch information
alexesprit committed Jun 12, 2019
1 parent 5f26848 commit 9c5f967
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/connectors/youtube.js
Expand Up @@ -32,7 +32,13 @@ Connector.getArtistTrack = () => {
if (byLineMatch) {
return { artist: byLineMatch[1], track: videoTitle };
}
return Util.processYoutubeVideoTitle(videoTitle);

let { artist, track } = Util.processYoutubeVideoTitle(videoTitle);
if (!artist) {
artist = $('#meta-contents #owner-name').text();
}

return { artist, track };
};

/*
Expand Down

0 comments on commit 9c5f967

Please sign in to comment.