From 52f4e9d796a70c5470f051ab5f106c3ce13ff6e8 Mon Sep 17 00:00:00 2001 From: konhi#1588 Date: Mon, 16 Aug 2021 18:49:15 +0200 Subject: [PATCH 01/16] List missing plugins --- readme.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 7df27f0c..bd4ce62b 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ Install the `youtube-music-bin` package from the AUR. For AUR installation instr ## Available plugins: - **Ad Blocker**: block all ads and tracking out of the box -- **Downloader**: download to MP3 directly from the interface (youtube-dl) +- **Downloader**: download to MP3 directly from the interface [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) - **No Google Login**: remove Google login buttons and links from the interface - **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music - **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser @@ -44,6 +44,13 @@ Install the `youtube-music-bin` package from the AUR. For AUR installation instr - **Hide video player**: no video in the interface when playing music - **Notifications**: display a notification when a song starts playing - **Touchbar**: custom TouchBar layout for macOS +- [**Discord**](https://discord.com/): show your friends what you listen to with [Rich Presence](https://user-images.githubusercontent.com/28219076/104362104-a7a0b980-5513-11eb-9744-bb89eabe0016.png) +- **In-app menu**: control app from your tray +- [**Last.fm**](https://www.last.fm/): scrobbles support +- **Playback speed**: listen fast, listen slow! +- **Precise volume**: more control over the volume for more comfort +- [**SponsorBlock**](https://github.com/ajayyy/SponsorBlock): skips non-music parts +- **Taskbar media control**: control app from your [Windows taskbar](https://user-images.githubusercontent.com/78568641/111916130-24a35e80-8a82-11eb-80c8-5021c1aa27f4.png) ## Dev From 6040fe1cbd0abe3299ac4c585c4c8fbd0a779b02 Mon Sep 17 00:00:00 2001 From: konhi Date: Thu, 19 Aug 2021 00:08:17 +0200 Subject: [PATCH 02/16] update descriptions and add images --- readme.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/readme.md b/readme.md index bd4ce62b..39d5889c 100644 --- a/readme.md +++ b/readme.md @@ -36,19 +36,19 @@ Install the `youtube-music-bin` package from the AUR. For AUR installation instr ## Available plugins: - **Ad Blocker**: block all ads and tracking out of the box -- **Downloader**: download to MP3 directly from the interface [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) +- **Downloader**: downloads MP3 [directly from the interface[(https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png)] [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) - **No Google Login**: remove Google login buttons and links from the interface - **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music - **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser -- **Auto confirm when paused**: when the "Continue Watching?" modal appears, automatically click "Yes" +- **Auto confirm when paused**: when the ["Continue Watching?"](https://user-images.githubusercontent.com/61631665/129977894-01c60740-7ec6-4bf0-9a2c-25da24491b0e.png) modal appears, automatically click "Yes" - **Hide video player**: no video in the interface when playing music -- **Notifications**: display a notification when a song starts playing +- **Notifications**: display a [notification](https://user-images.githubusercontent.com/78568641/114102651-63ce0e00-98d0-11eb-9dfe-c5a02bb54f9c.png) when a song starts playing - **Touchbar**: custom TouchBar layout for macOS - [**Discord**](https://discord.com/): show your friends what you listen to with [Rich Presence](https://user-images.githubusercontent.com/28219076/104362104-a7a0b980-5513-11eb-9744-bb89eabe0016.png) -- **In-app menu**: control app from your tray +- **In-app menu**: allows you to [control app from your tray](https://user-images.githubusercontent.com/61631665/129975597-65491d42-47bd-426a-a1a0-7c91114255ff.png) and [gives bars a fancy, dark look](https://user-images.githubusercontent.com/78568641/112215894-923dbf00-8c29-11eb-95c3-3ce15db27eca.png) - [**Last.fm**](https://www.last.fm/): scrobbles support -- **Playback speed**: listen fast, listen slow! -- **Precise volume**: more control over the volume for more comfort +- **Playback speed**: listen fast, listen slow! [Adds a slider that controls song speed](https://user-images.githubusercontent.com/61631665/129976003-e55db5ba-bf42-448c-a059-26a009775e68.png) +- **Precise volume**: customizable volume steps for more comfort, allows controlling the volume in precisely using mousewheel - [**SponsorBlock**](https://github.com/ajayyy/SponsorBlock): skips non-music parts - **Taskbar media control**: control app from your [Windows taskbar](https://user-images.githubusercontent.com/78568641/111916130-24a35e80-8a82-11eb-80c8-5021c1aa27f4.png) From aff0415816308902ca91135ba253a5291a49c58d Mon Sep 17 00:00:00 2001 From: konhi#1588 Date: Thu, 19 Aug 2021 00:15:25 +0200 Subject: [PATCH 03/16] Fix broken link Oops. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 39d5889c..0eb8d560 100644 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ Install the `youtube-music-bin` package from the AUR. For AUR installation instr ## Available plugins: - **Ad Blocker**: block all ads and tracking out of the box -- **Downloader**: downloads MP3 [directly from the interface[(https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png)] [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) +- **Downloader**: downloads MP3 [directly from the interface](https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png) [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) - **No Google Login**: remove Google login buttons and links from the interface - **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music - **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser From 086048780a1b6fa0c2928bba1ce8fcb998bb7816 Mon Sep 17 00:00:00 2001 From: konhi#1588 Date: Thu, 19 Aug 2021 15:04:47 +0200 Subject: [PATCH 04/16] suggestions from @Araxeus and @cpiber --- readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 0eb8d560..a0338f5b 100644 --- a/readme.md +++ b/readme.md @@ -34,23 +34,23 @@ You can check out the [latest release](https://github.com/th-ch/youtube-music/re Install the `youtube-music-bin` package from the AUR. For AUR installation instructions, take a look at this [wiki page](https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_packages). ## Available plugins: - - **Ad Blocker**: block all ads and tracking out of the box -- **Downloader**: downloads MP3 [directly from the interface](https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png) [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) -- **No Google Login**: remove Google login buttons and links from the interface -- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music -- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser - **Auto confirm when paused**: when the ["Continue Watching?"](https://user-images.githubusercontent.com/61631665/129977894-01c60740-7ec6-4bf0-9a2c-25da24491b0e.png) modal appears, automatically click "Yes" +- **Disable autoplay**: makes every song start in "paused" mode +- **Downloader**: downloads MP3 [directly from the interface](https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png) [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) - **Hide video player**: no video in the interface when playing music +- **In-app menu**: [gives bars a fancy, dark look](https://user-images.githubusercontent.com/78568641/112215894-923dbf00-8c29-11eb-95c3-3ce15db27eca.png) +- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser +- **No Google Login**: remove Google login buttons and links from the interface - **Notifications**: display a [notification](https://user-images.githubusercontent.com/78568641/114102651-63ce0e00-98d0-11eb-9dfe-c5a02bb54f9c.png) when a song starts playing +- **Playback speed**: listen fast, listen slow! [Adds a slider that controls song speed](https://user-images.githubusercontent.com/61631665/129976003-e55db5ba-bf42-448c-a059-26a009775e68.png) +- **Precise volume**: customizable volume steps for more comfort, allows controlling the volume precisely using mousewheel +- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music, you may setup custom global hotkeys for play/pause/next/previous song +- **Taskbar media control**: control app from your [Windows taskbar](https://user-images.githubusercontent.com/78568641/111916130-24a35e80-8a82-11eb-80c8-5021c1aa27f4.png) - **Touchbar**: custom TouchBar layout for macOS - [**Discord**](https://discord.com/): show your friends what you listen to with [Rich Presence](https://user-images.githubusercontent.com/28219076/104362104-a7a0b980-5513-11eb-9744-bb89eabe0016.png) -- **In-app menu**: allows you to [control app from your tray](https://user-images.githubusercontent.com/61631665/129975597-65491d42-47bd-426a-a1a0-7c91114255ff.png) and [gives bars a fancy, dark look](https://user-images.githubusercontent.com/78568641/112215894-923dbf00-8c29-11eb-95c3-3ce15db27eca.png) - [**Last.fm**](https://www.last.fm/): scrobbles support -- **Playback speed**: listen fast, listen slow! [Adds a slider that controls song speed](https://user-images.githubusercontent.com/61631665/129976003-e55db5ba-bf42-448c-a059-26a009775e68.png) -- **Precise volume**: customizable volume steps for more comfort, allows controlling the volume in precisely using mousewheel - [**SponsorBlock**](https://github.com/ajayyy/SponsorBlock): skips non-music parts -- **Taskbar media control**: control app from your [Windows taskbar](https://user-images.githubusercontent.com/78568641/111916130-24a35e80-8a82-11eb-80c8-5021c1aa27f4.png) ## Dev From 878ec1f6c1775458927ce3c5b9e71a30e45d702f Mon Sep 17 00:00:00 2001 From: konhi#1588 Date: Thu, 19 Aug 2021 15:09:31 +0200 Subject: [PATCH 05/16] sort alphabetically --- readme.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index a0338f5b..c47170c1 100644 --- a/readme.md +++ b/readme.md @@ -37,20 +37,20 @@ Install the `youtube-music-bin` package from the AUR. For AUR installation instr - **Ad Blocker**: block all ads and tracking out of the box - **Auto confirm when paused**: when the ["Continue Watching?"](https://user-images.githubusercontent.com/61631665/129977894-01c60740-7ec6-4bf0-9a2c-25da24491b0e.png) modal appears, automatically click "Yes" - **Disable autoplay**: makes every song start in "paused" mode +- [**Discord**](https://discord.com/): show your friends what you listen to with [Rich Presence](https://user-images.githubusercontent.com/28219076/104362104-a7a0b980-5513-11eb-9744-bb89eabe0016.png) - **Downloader**: downloads MP3 [directly from the interface](https://user-images.githubusercontent.com/61631665/129977677-83a7d067-c192-45e1-98ae-b5a4927393be.png) [(youtube-dl)](https://github.com/ytdl-org/youtube-dl) - **Hide video player**: no video in the interface when playing music - **In-app menu**: [gives bars a fancy, dark look](https://user-images.githubusercontent.com/78568641/112215894-923dbf00-8c29-11eb-95c3-3ce15db27eca.png) +- [**Last.fm**](https://www.last.fm/): scrobbles support - **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser - **No Google Login**: remove Google login buttons and links from the interface - **Notifications**: display a [notification](https://user-images.githubusercontent.com/78568641/114102651-63ce0e00-98d0-11eb-9dfe-c5a02bb54f9c.png) when a song starts playing - **Playback speed**: listen fast, listen slow! [Adds a slider that controls song speed](https://user-images.githubusercontent.com/61631665/129976003-e55db5ba-bf42-448c-a059-26a009775e68.png) - **Precise volume**: customizable volume steps for more comfort, allows controlling the volume precisely using mousewheel - **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music, you may setup custom global hotkeys for play/pause/next/previous song +- [**SponsorBlock**](https://github.com/ajayyy/SponsorBlock): skips non-music parts - **Taskbar media control**: control app from your [Windows taskbar](https://user-images.githubusercontent.com/78568641/111916130-24a35e80-8a82-11eb-80c8-5021c1aa27f4.png) - **Touchbar**: custom TouchBar layout for macOS -- [**Discord**](https://discord.com/): show your friends what you listen to with [Rich Presence](https://user-images.githubusercontent.com/28219076/104362104-a7a0b980-5513-11eb-9744-bb89eabe0016.png) -- [**Last.fm**](https://www.last.fm/): scrobbles support -- [**SponsorBlock**](https://github.com/ajayyy/SponsorBlock): skips non-music parts ## Dev From 7fa1278b31ec44bdaf8f4d9c7fd3e7ca8f3d738f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Szyma=C5=84ski?= Date: Thu, 19 Aug 2021 16:16:49 +0200 Subject: [PATCH 06/16] Add "Listen Along" button --- plugins/discord/back.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/discord/back.js b/plugins/discord/back.js index c6faadd7..a2eef1f5 100644 --- a/plugins/discord/back.js +++ b/plugins/discord/back.js @@ -29,6 +29,9 @@ module.exports = (win, {activityTimoutEnabled, activityTimoutTime}) => { songInfo.uploadDate, songInfo.views.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + " views" ].join(' || '), + buttons: [ + { label: "Listen Along", url: songInfo.url }, + ] }; if (songInfo.isPaused) { From 4b1dfa1173717e16861f9343d18ae4b9b79a0a52 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Thu, 19 Aug 2021 21:20:28 +0000 Subject: [PATCH 07/16] fix: upgrade @cliqz/adblocker-electron from 1.22.2 to 1.22.3 Snyk has created this PR to upgrade @cliqz/adblocker-electron from 1.22.2 to 1.22.3. See this package in npm: See this project in Snyk: https://app.snyk.io/org/th-ch/project/81809c53-bb7b-46b9-a0d7-806d45d74ac6?utm_source=github&utm_medium=upgrade-pr --- package.json | 2 +- yarn.lock | 62 ++++++++++++++++++++++++++-------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index a2db61fa..65487895 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "npm": "Please use yarn and not npm" }, "dependencies": { - "@cliqz/adblocker-electron": "^1.22.1", + "@cliqz/adblocker-electron": "^1.22.3", "@ffmpeg/core": "^0.10.0", "@ffmpeg/ffmpeg": "^0.10.0", "YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.9.0", diff --git a/yarn.lock b/yarn.lock index 187191be..8abc1dda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -439,45 +439,45 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@cliqz/adblocker-content@^1.22.2": - version "1.22.2" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-content/-/adblocker-content-1.22.2.tgz#643849d5f08c167eb84a2e7e3f1f9fbc41a3889b" - integrity sha512-EsV00IdW8sGujGnylOGR8dm401FdIfPRAjuevsRlZjgDE+hQKj6n5wwrZaylPIh994hWesg6bxWTmXpJ2Sy2QQ== +"@cliqz/adblocker-content@^1.22.4": + version "1.22.4" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-content/-/adblocker-content-1.22.4.tgz#442f4d9cf5d5854d9783553f7baa5162c95c66ed" + integrity sha512-ddWU1Qg2cRA8vj15EcMDNeIYzUN5LpFjAR7bLvuxsp+0jiNNuz3ZxaXmYunXYpZbTsumMEBz1LWzkLX1kk+eow== dependencies: - "@cliqz/adblocker-extended-selectors" "^1.22.2" + "@cliqz/adblocker-extended-selectors" "^1.22.4" -"@cliqz/adblocker-electron-preload@^1.22.2": - version "1.22.2" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron-preload/-/adblocker-electron-preload-1.22.2.tgz#eea674767a60abe4e5f9ccb46188d33656f551d0" - integrity sha512-4JSqNNYo4hXMoZjnyBVTd3z2yV2n5qeoNPk+WaeOFEF9uJXhqPR+Sz7scNB6nMYnRuSQfraeogtdaA4s0JkJWQ== +"@cliqz/adblocker-electron-preload@^1.22.4": + version "1.22.4" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron-preload/-/adblocker-electron-preload-1.22.4.tgz#f3507e6f0e3898d4b9fa4f0e4ad6a37f57309f35" + integrity sha512-wUuqlfV0kYjqz6HUjZXzWz2NFXTA+e7T61xEt8pUbbgfgA9Bsn66Adb6rFsnRaMKLlgyyab7MWp9uEWMQac2ig== dependencies: - "@cliqz/adblocker-content" "^1.22.2" + "@cliqz/adblocker-content" "^1.22.4" -"@cliqz/adblocker-electron@^1.22.1": - version "1.22.2" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron/-/adblocker-electron-1.22.2.tgz#85af3b49f7f653e6fb0d008b6523e3b3ba0dd41e" - integrity sha512-uSQjbcv9/csjQOO0AgqK8AnqdpKseebPkwXozglU1uFVVnuSOTs/4RohL3yac9uMkJtfyAIhT3mnbw9Cf4o+gQ== +"@cliqz/adblocker-electron@^1.22.3": + version "1.22.4" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron/-/adblocker-electron-1.22.4.tgz#eb62395595179b45fe25027ead52ac51e3e80e4f" + integrity sha512-wyI/9UxUdc3fZC4vWgmdNBLm0jKH+DYClNvTAQ6fLRIyhiD5efOsFdpiwr+OWPhgNpKDs9c9dQyApy3SVNdw+Q== dependencies: - "@cliqz/adblocker" "^1.22.2" - "@cliqz/adblocker-electron-preload" "^1.22.2" + "@cliqz/adblocker" "^1.22.4" + "@cliqz/adblocker-electron-preload" "^1.22.4" tldts-experimental "^5.6.21" -"@cliqz/adblocker-extended-selectors@^1.22.2": - version "1.22.2" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-extended-selectors/-/adblocker-extended-selectors-1.22.2.tgz#1cad3c1569b765d9e7f8672c85b2a7b1e8e9ee90" - integrity sha512-/u4SmQ1wr7d80iGP705fZrfHjJUTf/1MyRXz5Wltt7i3OHvOCQEoST2mqNlfx0W/9gIWzxA7cFRLY0/aITmzTw== +"@cliqz/adblocker-extended-selectors@^1.22.4": + version "1.22.4" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-extended-selectors/-/adblocker-extended-selectors-1.22.4.tgz#4069136353a95cb2291d7db9951ea4e85c303e2c" + integrity sha512-Puae9uK3gIXUGNY7Nj8TtZZXw/QYOih+tKS3YnQwtLgtFR2TkoKzYyHCu1OPu49NLRbuieiHAkaAG6AHflVtPg== -"@cliqz/adblocker@^1.22.2": - version "1.22.2" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker/-/adblocker-1.22.2.tgz#99a14d56327734d3083a077d96fe7b91c236bf7a" - integrity sha512-P+a8gYbRbQy38mYsr7932h2cnK/7AEuQrmCEfLTO1+abCr2v5RM2Qb+cCn/JVnQSeqnysebAIXoV+PUzrjfpiQ== +"@cliqz/adblocker@^1.22.4": + version "1.22.4" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker/-/adblocker-1.22.4.tgz#835be918f4c08b849b68efda5e01787f1041ad4a" + integrity sha512-SDgSiKLkWTqX57MUH2DYBVJjh2/EiclUDvXi2oLRLFT9KXXXYNUctSqh5gOchPoWPKreLIeEleLsdTvHKkagaA== dependencies: - "@cliqz/adblocker-content" "^1.22.2" - "@cliqz/adblocker-extended-selectors" "^1.22.2" + "@cliqz/adblocker-content" "^1.22.4" + "@cliqz/adblocker-extended-selectors" "^1.22.4" "@remusao/guess-url-type" "^1.1.2" "@remusao/small" "^1.1.2" "@remusao/smaz" "^1.7.1" - "@types/chrome" "^0.0.145" + "@types/chrome" "^0.0.153" "@types/firefox-webext-browser" "^82.0.0" tldts-experimental "^5.6.21" @@ -1203,10 +1203,10 @@ "@types/node" "*" "@types/responselike" "*" -"@types/chrome@^0.0.145": - version "0.0.145" - resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.145.tgz#6c53ae0af5f25350b07bfd24cf459b5fe65cd9b8" - integrity sha512-vLvTMmfc8mvwOZzkmn2UwlWSNu0t0txBkyuIv8NgihRkvFCe6XJX65YZAgAP/RdBit3enhU2GTxCr+prn4uZmA== +"@types/chrome@^0.0.153": + version "0.0.153" + resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.153.tgz#6c3009eb7be1d0fbace82be159122fd99e4a6465" + integrity sha512-J8VrwjuJLh6BPmUTmZQd41zJJjVpRnnMZ/E9uHfQZ3RRAESVqYxin8YeCdZUak7+5dUI6wr8Sr6UfR3dehLIdQ== dependencies: "@types/filesystem" "*" "@types/har-format" "*" From 6bc1d1606f95c7d91b5bf41d33fd19e6042c1293 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 23 Aug 2021 01:05:45 +0200 Subject: [PATCH 08/16] Bump node to v14 --- .github/workflows/build.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67feb14a..ccd5e1ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v1 with: - node-version: "12.x" + node-version: "14.x" - name: Get yarn cache directory path id: yarn-cache-dir-path diff --git a/package.json b/package.json index a2db61fa..4be16161 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "release:win": "yarn run clean && electron-builder --win -p always" }, "engines": { - "node": ">=12.20", + "node": ">=14.0.0", "npm": "Please use yarn and not npm" }, "dependencies": { From c66ff2bf0564722b7054db101ca80099318ee07a Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 23 Aug 2021 00:49:00 +0200 Subject: [PATCH 09/16] Apply clean up util to title + enrich prefixes --- plugins/downloader/youtube-dl.js | 7 +++++-- providers/song-info.js | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/plugins/downloader/youtube-dl.js b/plugins/downloader/youtube-dl.js index f0f47cec..906fc35c 100644 --- a/plugins/downloader/youtube-dl.js +++ b/plugins/downloader/youtube-dl.js @@ -15,7 +15,7 @@ const ytdl = require("ytdl-core"); const { triggerAction, triggerActionSync } = require("../utils"); const { ACTIONS, CHANNEL } = require("./actions.js"); const { getFolder, urlToJPG } = require("./utils"); -const { cleanupArtistName } = require("../../providers/song-info"); +const { cleanupName } = require("../../providers/song-info"); const { createFFmpeg } = FFmpeg; const ffmpeg = createFFmpeg({ @@ -40,7 +40,10 @@ const downloadVideoToMP3 = async ( const { videoDetails } = await ytdl.getInfo(videoUrl); const thumbnails = videoDetails?.thumbnails; metadata = { - artist: videoDetails?.media?.artist || cleanupArtistName(videoDetails?.author?.name) || "", + artist: + videoDetails?.media?.artist || + cleanupName(videoDetails?.author?.name) || + "", title: videoDetails?.media?.song || videoDetails?.title || "", imageSrcYTPL: thumbnails ? urlToJPG(thumbnails[thumbnails.length - 1].url, videoDetails?.videoId) diff --git a/providers/song-info.js b/providers/song-info.js index 08eaf944..0ef0f868 100644 --- a/providers/song-info.js +++ b/providers/song-info.js @@ -55,8 +55,9 @@ const songInfo = { const handleData = async (responseText, win) => { let data = JSON.parse(responseText); - songInfo.title = data?.videoDetails?.title; - songInfo.artist = await getArtist(win) || cleanupArtistName(data?.videoDetails?.author); + songInfo.title = cleanupName(data?.videoDetails?.title); + songInfo.artist = + (await getArtist(win)) || cleanupName(data?.videoDetails?.author); songInfo.views = data?.videoDetails?.viewCount; songInfo.imageSrc = data?.videoDetails?.thumbnail?.thumbnails?.pop()?.url; songInfo.songDuration = data?.videoDetails?.lengthSeconds; @@ -98,8 +99,15 @@ const registerProvider = (win) => { }); }; -const suffixesToRemove = [' - Topic', 'VEVO']; -function cleanupArtistName(artist) { +const suffixesToRemove = [ + " - Topic", + "VEVO", + " (Performance Video)", + " (Official Music Video)", + " (Official Video)", + " (Clip officiel)", +]; +function cleanupName(artist) { if (!artist) { return artist; } @@ -114,4 +122,4 @@ function cleanupArtistName(artist) { module.exports = registerCallback; module.exports.setupSongInfo = registerProvider; module.exports.getImage = getImage; -module.exports.cleanupArtistName = cleanupArtistName; +module.exports.cleanupName = cleanupName; From acbe0ac25d568c25fedb514e0e96c66497b0f2d6 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 23 Aug 2021 00:50:49 +0200 Subject: [PATCH 10/16] Add Genius lyrics plugin --- plugins/lyrics-genius/back.js | 52 ++++++++++++++++++++++++++ plugins/lyrics-genius/front.js | 65 +++++++++++++++++++++++++++++++++ plugins/lyrics-genius/style.css | 7 ++++ 3 files changed, 124 insertions(+) create mode 100644 plugins/lyrics-genius/back.js create mode 100644 plugins/lyrics-genius/front.js create mode 100644 plugins/lyrics-genius/style.css diff --git a/plugins/lyrics-genius/back.js b/plugins/lyrics-genius/back.js new file mode 100644 index 00000000..302425d3 --- /dev/null +++ b/plugins/lyrics-genius/back.js @@ -0,0 +1,52 @@ +const { join } = require("path"); + +const { ipcMain } = require("electron"); +const is = require("electron-is"); +const fetch = require("node-fetch"); + +const { cleanupName } = require("../../providers/song-info"); +const { injectCSS } = require("../utils"); + +module.exports = async (win) => { + injectCSS(win.webContents, join(__dirname, "style.css")); + + ipcMain.on("search-genius-lyrics", async (event, extractedSongInfo) => { + const metadata = JSON.parse(extractedSongInfo); + const queryString = `${cleanupName(metadata.artist)} ${cleanupName( + metadata.title + )}`; + + let response = await fetch( + `https://genius.com/api/search/multi?per_page=5&q=${encodeURI( + queryString + )}` + ); + if (!response.ok) { + event.returnValue = null; + return; + } + + const info = await response.json(); + let url = ""; + try { + url = info.response.sections.filter( + (section) => section.type === "song" + )[0].hits[0].result.url; + } catch { + event.returnValue = null; + return; + } + + if (is.dev()) { + console.log("Fetching lyrics from Genius:", url); + } + + response = await fetch(url); + if (!response.ok) { + event.returnValue = null; + return; + } + + event.returnValue = await response.text(); + }); +}; diff --git a/plugins/lyrics-genius/front.js b/plugins/lyrics-genius/front.js new file mode 100644 index 00000000..e1354d26 --- /dev/null +++ b/plugins/lyrics-genius/front.js @@ -0,0 +1,65 @@ +const { ipcRenderer } = require("electron"); + +module.exports = () => { + ipcRenderer.on("update-song-info", (_, extractedSongInfo) => { + const lyricsTab = document.querySelector('tp-yt-paper-tab[tabindex="-1"]'); + + // Check if disabled + if (!lyricsTab || !lyricsTab.hasAttribute("disabled")) { + return; + } + + const html = ipcRenderer.sendSync( + "search-genius-lyrics", + extractedSongInfo + ); + if (!html) { + return; + } + + const wrapper = document.createElement("div"); + wrapper.innerHTML = html; + const lyricsSelector1 = wrapper.querySelector(".lyrics"); + const lyricsSelector2 = wrapper.querySelector( + '[class^="Lyrics__Container"]' + ); + const lyrics = lyricsSelector1 + ? lyricsSelector1.innerHTML + : lyricsSelector2 + ? lyricsSelector2.innerHTML + : null; + if (!lyrics) { + return; + } + + lyricsTab.removeAttribute("disabled"); + lyricsTab.removeAttribute("aria-disabled"); + document.querySelector("tp-yt-paper-tab").onclick = () => { + lyricsTab.removeAttribute("disabled"); + lyricsTab.removeAttribute("aria-disabled"); + }; + + lyricsTab.onclick = () => { + const tabContainer = document.querySelector("ytmusic-tab-renderer"); + console.log("tabContainer", tabContainer); + const observer = new MutationObserver((_, observer) => { + const lyricsContainer = document.querySelector( + '[page-type="MUSIC_PAGE_TYPE_TRACK_LYRICS"] > ytmusic-message-renderer' + ); + if (lyricsContainer) { + lyricsContainer.innerHTML = `
+ ${lyrics} + + Source : Genius +
`; + observer.disconnect(); + } + }); + observer.observe(tabContainer, { + attributes: true, + childList: true, + subtree: true, + }); + }; + }); +}; diff --git a/plugins/lyrics-genius/style.css b/plugins/lyrics-genius/style.css new file mode 100644 index 00000000..7807a814 --- /dev/null +++ b/plugins/lyrics-genius/style.css @@ -0,0 +1,7 @@ +/* Disable links in Genius lyrics */ +.genius-lyrics a { + color: var(--ytmusic-text-primary); + display: inline-block; + pointer-events: none; + text-decoration: none; +} From f27ff526894f9bbebce02ad47dc2c089b3c64f59 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 22 Aug 2021 23:16:24 +0000 Subject: [PATCH 11/16] Bump jszip from 3.5.0 to 3.7.1 Bumps [jszip](https://github.com/Stuk/jszip) from 3.5.0 to 3.7.1. - [Release notes](https://github.com/Stuk/jszip/releases) - [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md) - [Commits](https://github.com/Stuk/jszip/compare/v3.5.0...v3.7.1) --- updated-dependencies: - dependency-name: jszip dependency-type: indirect ... Signed-off-by: dependabot[bot] --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 187191be..c659590c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5990,9 +5990,9 @@ jsprim@^1.2.2: verror "1.10.0" jszip@^3.1.0: - version "3.5.0" - resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.5.0.tgz#b4fd1f368245346658e781fec9675802489e15f6" - integrity sha512-WRtu7TPCmYePR1nazfrtuF216cIVon/3GWOvHS9QR5bIwSbnxtdpma6un3jyGGNhHsKCSzn5Ypk+EkDRvTGiFA== + version "3.7.1" + resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.7.1.tgz#bd63401221c15625a1228c556ca8a68da6fda3d9" + integrity sha512-ghL0tz1XG9ZEmRMcEN2vt7xabrDdqHHeykgARpmZ0BiIctWxM47Vt63ZO2dnp4QYt/xJVLLy5Zv1l/xRdh2byg== dependencies: lie "~3.3.0" pako "~1.0.2" From e888b5c896ad4bd9e79f14c8b74d65df912ab815 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 23 Aug 2021 01:17:29 +0200 Subject: [PATCH 12/16] Update menu buttons to new format --- plugins/downloader/style.css | 8 ++ plugins/downloader/templates/download.html | 58 ++++---- plugins/playback-speed/templates/slider.html | 138 ++++++++++--------- 3 files changed, 114 insertions(+), 90 deletions(-) diff --git a/plugins/downloader/style.css b/plugins/downloader/style.css index 8119fc5e..6f29fc6b 100644 --- a/plugins/downloader/style.css +++ b/plugins/downloader/style.css @@ -6,8 +6,16 @@ cursor: pointer; } +.menu-item > .yt-simple-endpoint:hover { + background-color: var(--ytmusic-menu-item-hover-background-color); +} + .menu-icon { flex: var(--ytmusic-menu-item-icon_-_flex); margin: var(--ytmusic-menu-item-icon_-_margin); fill: var(--ytmusic-menu-item-icon_-_fill); + stroke: var(--iron-icon-stroke-color, none); + width: var(--iron-icon-width, 24px); + height: var(--iron-icon-height, 24px); + animation: var(--iron-icon_-_animation); } diff --git a/plugins/downloader/templates/download.html b/plugins/downloader/templates/download.html index d4f455d0..ede5ec02 100644 --- a/plugins/downloader/templates/download.html +++ b/plugins/downloader/templates/download.html @@ -1,5 +1,5 @@ diff --git a/plugins/playback-speed/templates/slider.html b/plugins/playback-speed/templates/slider.html index 67ced7a4..85865af0 100644 --- a/plugins/playback-speed/templates/slider.html +++ b/plugins/playback-speed/templates/slider.html @@ -1,79 +1,87 @@