From fe9b26ebddb508dbd7634cf277e94e233b09b3cf Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 10 Oct 2022 00:44:11 +0000 Subject: [PATCH 01/36] fix: upgrade async-mutex from 0.3.2 to 0.4.0 Snyk has created this PR to upgrade async-mutex from 0.3.2 to 0.4.0. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index cbcdcdc8..0b7e522f 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "@ffmpeg/core": "^0.11.0", "@ffmpeg/ffmpeg": "^0.11.0", "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6", - "async-mutex": "^0.3.2", + "async-mutex": "^0.4.0", "browser-id3-writer": "^4.4.0", "chokidar": "^3.5.3", "custom-electron-prompt": "^1.5.0", diff --git a/yarn.lock b/yarn.lock index 5cadfd28..04ba8bb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1308,12 +1308,12 @@ async-exit-hook@^2.0.1: resolved "https://registry.yarnpkg.com/async-exit-hook/-/async-exit-hook-2.0.1.tgz#8bd8b024b0ec9b1c01cccb9af9db29bd717dfaf3" integrity sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw== -async-mutex@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.3.2.tgz#1485eda5bda1b0ec7c8df1ac2e815757ad1831df" - integrity sha512-HuTK7E7MT7jZEh1P9GtRW9+aTWiDWWi9InbZ5hjxrnRa39KS4BW04+xLBhYNS2aXhHUIKZSw3gj4Pn1pj+qGAA== +async-mutex@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/async-mutex/-/async-mutex-0.4.0.tgz#ae8048cd4d04ace94347507504b3cf15e631c25f" + integrity sha512-eJFZ1YhRR8UN8eBLoNzcDPcy/jqjsg6I1AP+KvWQX80BqOSW1oJPJXDylPUEeMr2ZQvHgnQ//Lp6f3RQ1zI7HA== dependencies: - tslib "^2.3.1" + tslib "^2.4.0" async@^3.2.3: version "3.2.3" @@ -6251,10 +6251,10 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== tsutils@^3.21.0: version "3.21.0" From 762ef4eede29b53aae912b3b50a1ca53f6765c53 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 10 Oct 2022 00:44:14 +0000 Subject: [PATCH 02/36] fix: upgrade @cliqz/adblocker-electron from 1.25.0 to 1.25.1 Snyk has created this PR to upgrade @cliqz/adblocker-electron from 1.25.0 to 1.25.1. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 62 ++++++++++++++++++++++++++-------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index cbcdcdc8..beafb9a2 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "npm": "Please use yarn and not npm" }, "dependencies": { - "@cliqz/adblocker-electron": "^1.23.9", + "@cliqz/adblocker-electron": "^1.25.1", "@ffmpeg/core": "^0.11.0", "@ffmpeg/ffmpeg": "^0.11.0", "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6", diff --git a/yarn.lock b/yarn.lock index 5cadfd28..fe083e37 100644 --- a/yarn.lock +++ b/yarn.lock @@ -250,45 +250,45 @@ lodash "^4.17.19" to-fast-properties "^2.0.0" -"@cliqz/adblocker-content@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-content/-/adblocker-content-1.25.0.tgz#d8c76fbbf6eb1e93c02e30bbd5cd28a39c548bfb" - integrity sha512-P3DenzNpd0WRpZAwCZHpOMiMs+o4e0lbHOLJSmOl09bVtwgvPV5PNqJeTQ0GNBgclTbrDzfXDbAEjm+NBm3vcA== +"@cliqz/adblocker-content@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-content/-/adblocker-content-1.25.1.tgz#da81e7838e288a6f0fdb8a97a0df8169accb74a1" + integrity sha512-7gl2VdNPBfj7aPoq34B5miwGcnda/7LCr+BqnpcSOjdLV6jjT2FrNSAKGFvcH23q0HM1IFhYDV6ydTgsdWFCnA== dependencies: - "@cliqz/adblocker-extended-selectors" "^1.25.0" + "@cliqz/adblocker-extended-selectors" "^1.25.1" -"@cliqz/adblocker-electron-preload@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron-preload/-/adblocker-electron-preload-1.25.0.tgz#b9d54b7fd72bf5f519a533d8b3829d0625eec36f" - integrity sha512-soyO3iLvBnxdQQQdJqw2T1GUSlHuq5EcG3SE5Arjl5dYjrxKLxG0cQKEzPIFiLp6phrH+iV6y6qwg46+xU0dig== +"@cliqz/adblocker-electron-preload@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron-preload/-/adblocker-electron-preload-1.25.1.tgz#83bd59d8e94436c451af3525d9902fa5fa1be3ab" + integrity sha512-edNVEqGrXqe/Qwi0D9/V8xmtyeJlhNPaelXilYa1ne7jG/OT7pee+7Vi4BWezl0NQ77WF3/mY9Bj4eJkEO0uiQ== dependencies: - "@cliqz/adblocker-content" "^1.25.0" + "@cliqz/adblocker-content" "^1.25.1" -"@cliqz/adblocker-electron@^1.23.9": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron/-/adblocker-electron-1.25.0.tgz#f350b258d23239c69368a191a24e181e14a0dfbb" - integrity sha512-mDtXJ+0xYWR5SQ7rbaom/ruKPDhGFpYDipXV15hJfNcUeXxnUb08rApb2KIUf79Q0AzO1YU0bK92OiaN57XtsQ== +"@cliqz/adblocker-electron@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-electron/-/adblocker-electron-1.25.1.tgz#44d9034e35c78938a772b10f8096df55a4accc41" + integrity sha512-CKStwRTR2L78EjgmuUpLKkV9s/uVnwQNGr7I/hyMkEROXbGdrN7P5LhwO+kkewccZ+3JtE509PBmZAp0EP71dw== dependencies: - "@cliqz/adblocker" "^1.25.0" - "@cliqz/adblocker-electron-preload" "^1.25.0" + "@cliqz/adblocker" "^1.25.1" + "@cliqz/adblocker-electron-preload" "^1.25.1" tldts-experimental "^5.6.21" -"@cliqz/adblocker-extended-selectors@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker-extended-selectors/-/adblocker-extended-selectors-1.25.0.tgz#9de64e3beb798abba6f17a411871904e2bafe3fa" - integrity sha512-8gUGPj1bnTqRVi414ouBlyRB9Y/orhlBBFhMAjjlmFNmcJNDLI0t3wFBjpxe/R95c2wGnTLxk5Fsahy1RamKRQ== +"@cliqz/adblocker-extended-selectors@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker-extended-selectors/-/adblocker-extended-selectors-1.25.1.tgz#cfac0080952311399805fe153cd9e7e1331b3c6d" + integrity sha512-4MdMe/YfIok5d8WYVcLR3Ak7vGrmeUV47frgmXEe945luY93vwlzk1NiLYW1JM5Gdm+VePweoS9cJ1/QUTmv+Q== -"@cliqz/adblocker@^1.25.0": - version "1.25.0" - resolved "https://registry.yarnpkg.com/@cliqz/adblocker/-/adblocker-1.25.0.tgz#2833322691f312eb8be72c1cee423435a96ce3b4" - integrity sha512-hRcPyiZsU6KccHi7OdEmYxTjjE/TGPPLEjVVfnvlRXCwBSvVnBTXhx31BhUi7BHXXS+OvmNxJOb+cue1nu5YGw== +"@cliqz/adblocker@^1.25.1": + version "1.25.1" + resolved "https://registry.yarnpkg.com/@cliqz/adblocker/-/adblocker-1.25.1.tgz#4d3e8894ce48ad0d0f8b26a4a1003f0676b7f734" + integrity sha512-1C1/ELI94/XewdUj/o1+Q4ziOigMvTZQA05UERfDoKqpJ+0cbrEF/UImrzpX7n+kYsR7xTJvmf+iNM3zS0tfsg== dependencies: - "@cliqz/adblocker-content" "^1.25.0" - "@cliqz/adblocker-extended-selectors" "^1.25.0" + "@cliqz/adblocker-content" "^1.25.1" + "@cliqz/adblocker-extended-selectors" "^1.25.1" "@remusao/guess-url-type" "^1.1.2" "@remusao/small" "^1.1.2" "@remusao/smaz" "^1.7.1" - "@types/chrome" "^0.0.195" + "@types/chrome" "^0.0.197" "@types/firefox-webext-browser" "^94.0.0" tldts-experimental "^5.6.21" @@ -789,10 +789,10 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== -"@types/chrome@^0.0.195": - version "0.0.195" - resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.195.tgz#c570f72857e11caa0a453a444828f75bca592cff" - integrity sha512-kmFh1xx7ehXoOVl6OjEBxmiYaquhxCaILjFGwPbW6xwbqzwDKCte+Mzl99aNWg3EP1B4rKVUuRm1vBsiRYks5g== +"@types/chrome@^0.0.197": + version "0.0.197" + resolved "https://registry.yarnpkg.com/@types/chrome/-/chrome-0.0.197.tgz#c1b50cdb72ee40f9bc1411506031a9f8a925ab35" + integrity sha512-m1NfS5bOjaypyqQfaX6CxmJodZVcvj5+Mt/K94EBHkflYjPNmXHAzbxfifdLMa0YM3PDyOxohoTS5ug/e6p5jA== dependencies: "@types/filesystem" "*" "@types/har-format" "*" From 1fef3c4aab55427ab2af5329342b68d007347cc5 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 19 Oct 2022 17:03:11 +0000 Subject: [PATCH 03/36] fix: upgrade custom-electron-titlebar from 4.1.0 to 4.1.1 Snyk has created this PR to upgrade custom-electron-titlebar from 4.1.0 to 4.1.1. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cbcdcdc8..2730ec0a 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "browser-id3-writer": "^4.4.0", "chokidar": "^3.5.3", "custom-electron-prompt": "^1.5.0", - "custom-electron-titlebar": "^4.1.0", + "custom-electron-titlebar": "^4.1.1", "discord-rpc": "^4.0.1", "electron-better-web-request": "^1.0.1", "electron-debug": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 5cadfd28..afa5dfb5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1924,10 +1924,10 @@ custom-electron-prompt@^1.5.0: resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.5.0.tgz#b514267f28e9f0d61011e03f76b1e59473af33d4" integrity sha512-DO+CIfO8c5lG+yzAkXD8PbFunPQ+WCJ4QeGN8bCvos7Fxt3xFDW0Qdnm1v9DKkAMj7iG0SujhdfNzsrtA4fl5g== -custom-electron-titlebar@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.0.tgz#a34b4e557e661d604a5bb7807cd5127a68c46921" - integrity sha512-5iHiOAF+m97ZDBqhrn1KRtQr7j4ALEERNVqljryVx2tMcFv535wAZs4Tj7XSrbALJLHIixKvXQyypnvEf27NhA== +custom-electron-titlebar@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.1.tgz#4e689db787acb2e7a634577146891c562732d1de" + integrity sha512-gLdQDYzHCHA83QVGRITaKlKB6NpJ6HZXD6oRKenkocSRTG3HFL9oXPbNfF5vGRaF1JjxsGoOu+/QS4Y4YGRbTw== dashdash@^1.12.0: version "1.14.1" From 3fdc6e2f0955e189336746fa3dac237253b616ab Mon Sep 17 00:00:00 2001 From: Odd Mathisen Date: Sun, 6 Nov 2022 18:34:54 +0100 Subject: [PATCH 04/36] docs: Added winget install instructions --- readme.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/readme.md b/readme.md index 1abb35a8..ee7c1f3c 100644 --- a/readme.md +++ b/readme.md @@ -46,6 +46,12 @@ scoop bucket add extras scoop install extras/youtube-music ``` +Alternately you can use [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/), Windows 11s official CLI package manager to install the `th-ch.YouTubeMusic` package. + +``` +winget install th-ch.YouTubeMusic +``` + ## Available plugins: - **Ad Blocker**: Block all ads and tracking out of the box From 350e8fb7066350ad2f4efd6722b22aa4498dc5e6 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Fri, 11 Nov 2022 23:13:48 +0000 Subject: [PATCH 05/36] fix: upgrade @ffmpeg/ffmpeg from 0.11.5 to 0.11.6 Snyk has created this PR to upgrade @ffmpeg/ffmpeg from 0.11.5 to 0.11.6. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index cbcdcdc8..633e51c9 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "dependencies": { "@cliqz/adblocker-electron": "^1.23.9", "@ffmpeg/core": "^0.11.0", - "@ffmpeg/ffmpeg": "^0.11.0", + "@ffmpeg/ffmpeg": "^0.11.6", "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6", "async-mutex": "^0.3.2", "browser-id3-writer": "^4.4.0", diff --git a/yarn.lock b/yarn.lock index 5cadfd28..1838eb5e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -364,10 +364,10 @@ resolved "https://registry.yarnpkg.com/@ffmpeg/core/-/core-0.11.0.tgz#fc24fe5af587f83cd2575d0e45de455d8eed9ba9" integrity sha512-9Tt/+2PMpkGPXUK8n6He9G8Y+qR6qmCPSCw9iEKZxHHOvJ9BE/r0Fccj+YgDZTlyu6rXxc9x6EqCaFBIt7qzjA== -"@ffmpeg/ffmpeg@^0.11.0": - version "0.11.5" - resolved "https://registry.yarnpkg.com/@ffmpeg/ffmpeg/-/ffmpeg-0.11.5.tgz#841ab8f0d7298b343723e5616a2f64ee443d2b2d" - integrity sha512-btdfI4bJ7Whqi10GJPcvvIfg22sN9LU5qw7Dbmpqts12enYEWWym+i1TBj1emvwIkDa2yxr61P2HECaELQWjGA== +"@ffmpeg/ffmpeg@^0.11.6": + version "0.11.6" + resolved "https://registry.yarnpkg.com/@ffmpeg/ffmpeg/-/ffmpeg-0.11.6.tgz#9cbe42dfb5132fca74ae5570ebeee2341f8c6e51" + integrity sha512-uN8J8KDjADEavPhNva6tYO9Fj0lWs9z82swF3YXnTxWMBoFLGq3LZ6FLlIldRKEzhOBKnkVfA8UnFJuvGvNxcA== dependencies: is-url "^1.2.4" node-fetch "^2.6.1" From d199a5fce94e58df78ffceb58aa5c3bf1b3e07bc Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Sun, 20 Nov 2022 16:21:32 +0530 Subject: [PATCH 06/36] Update back.js --- plugins/discord/back.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discord/back.js b/plugins/discord/back.js index 30ff95e1..02880fc7 100644 --- a/plugins/discord/back.js +++ b/plugins/discord/back.js @@ -5,7 +5,7 @@ const { dialog, app } = require("electron"); const registerCallback = require("../../providers/song-info"); // Application ID registered by @xn-oah -const clientId = "942539762227630162"; +const clientId = "1042206454515519548"; /** * @typedef {Object} Info From ee01ae1c00c73b0dfd5db8c6e7ff7352783987da Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Sun, 20 Nov 2022 17:33:06 +0530 Subject: [PATCH 07/36] Update back.js --- plugins/discord/back.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discord/back.js b/plugins/discord/back.js index 02880fc7..3b0e364b 100644 --- a/plugins/discord/back.js +++ b/plugins/discord/back.js @@ -5,7 +5,7 @@ const { dialog, app } = require("electron"); const registerCallback = require("../../providers/song-info"); // Application ID registered by @xn-oah -const clientId = "1042206454515519548"; +const clientId = "1043858434585526382"; /** * @typedef {Object} Info From 49eae89886aad0234460c8702656c9c86d120381 Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Sun, 20 Nov 2022 17:34:20 +0530 Subject: [PATCH 08/36] Update back.js --- plugins/discord/back.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discord/back.js b/plugins/discord/back.js index 3b0e364b..d1ff3a01 100644 --- a/plugins/discord/back.js +++ b/plugins/discord/back.js @@ -4,7 +4,7 @@ const { dialog, app } = require("electron"); const registerCallback = require("../../providers/song-info"); -// Application ID registered by @xn-oah +// Application ID registered by @Zo-Bro-23 const clientId = "1043858434585526382"; /** From c2fbc89b91837fbcf87dc55ae2eccc830108d23f Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 20 Nov 2022 20:30:35 +0100 Subject: [PATCH 09/36] Load plugins as soon as the window is created --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 81249b3a..7cf0a99e 100644 --- a/index.js +++ b/index.js @@ -152,6 +152,7 @@ function createMainWindow() { : "default", autoHideMenuBar: config.get("options.hideMenu"), }); + loadPlugins(win); if (windowPosition) { const { x, y } = windowPosition; @@ -284,7 +285,6 @@ app.once("browser-window-created", (event, win) => { } setupSongInfo(win); - loadPlugins(win); setupAppControls(); win.webContents.on("did-fail-load", ( From 3fb219fcd14f6ebe05ad99069b753d2fe925d9c5 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 20 Nov 2022 21:15:05 +0100 Subject: [PATCH 10/36] Bump age restriction plugin --- package.json | 2 +- yarn.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8f16b021..64d32789 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "@cliqz/adblocker-electron": "^1.25.1", "@ffmpeg/core": "^0.11.0", "@ffmpeg/ffmpeg": "^0.11.6", - "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6", + "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.5.4", "async-mutex": "^0.4.0", "browser-id3-writer": "^4.4.0", "chokidar": "^3.5.3", diff --git a/yarn.lock b/yarn.lock index ac224000..1cdd9a6f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1011,9 +1011,9 @@ "@typescript-eslint/types" "4.33.0" eslint-visitor-keys "^2.0.0" -"Simple-YouTube-Age-Restriction-Bypass@https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6": +"Simple-YouTube-Age-Restriction-Bypass@https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.5.4": version "0.0.0" - resolved "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.4.6#ac26ebb688667ce4ec6566ffbd3a75dbe2ac9a55" + resolved "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.5.4#4cdc95d7614baa3fdfe334ebf6b8a99b0d8347f0" abstract-socket@^2.0.0: version "2.1.1" From 335d515e22e4fe721ad73b919871c5656e7bd4c5 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 20 Nov 2022 21:54:23 +0100 Subject: [PATCH 11/36] Do not skip silences if volume is 0 or video is muted --- plugins/skip-silences/front.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/skip-silences/front.js b/plugins/skip-silences/front.js index 77414eb9..16f7ff94 100644 --- a/plugins/skip-silences/front.js +++ b/plugins/skip-silences/front.js @@ -19,8 +19,16 @@ module.exports = () => { isSilent = false; }); - speechEvents.on("stopped_speaking", function () { - if (!(video.paused || video.seeking || video.ended)) { + speechEvents.on("stopped_speaking", function () { + if ( + !( + video.paused || + video.seeking || + video.ended || + video.muted || + video.volume === 0 + ) + ) { isSilent = true; skipSilence(); } From de7bc828b1bca97e7ffbf099a2ea5343c800392b Mon Sep 17 00:00:00 2001 From: MiepHD <63968466+MiepHD@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:55:50 +0100 Subject: [PATCH 12/36] Appended directly to the main-panel --- plugins/video-toggle/front.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/video-toggle/front.js b/plugins/video-toggle/front.js index ab82aef1..9b6985eb 100644 --- a/plugins/video-toggle/front.js +++ b/plugins/video-toggle/front.js @@ -38,7 +38,7 @@ function setup(e) { player = $('ytmusic-player'); video = $('video'); - $('ytmusic-player-page').prepend(switchButtonDiv); + $('#main-panel').append(switchButtonDiv); if (options.hideVideo) { $('.video-switch-button-checkbox').checked = false; From 46bfec299c12eb19b382f9872c9c302fdd9ea870 Mon Sep 17 00:00:00 2001 From: MiepHD <63968466+MiepHD@users.noreply.github.com> Date: Tue, 22 Nov 2022 17:56:23 +0100 Subject: [PATCH 13/36] Centered toggle --- plugins/video-toggle/button-switcher.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/video-toggle/button-switcher.css b/plugins/video-toggle/button-switcher.css index 626d3bd1..7d3de097 100644 --- a/plugins/video-toggle/button-switcher.css +++ b/plugins/video-toggle/button-switcher.css @@ -2,6 +2,10 @@ align-items: unset !important; } +#main-panel { + position: relative; +} + .video-switch-button { z-index: 999; box-sizing: border-box; @@ -18,6 +22,7 @@ color: #fff; padding-right: 120px; position: absolute; + left: calc(50% - 120px); } .video-switch-button:before { From 5d85108c8ae7c8e556fc00eec0bec558c50c45fb Mon Sep 17 00:00:00 2001 From: Odd Mathisen Date: Wed, 23 Nov 2022 00:40:04 +0100 Subject: [PATCH 14/36] doc: Updated readme to include note about MSDSS --- readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/readme.md b/readme.md index ee7c1f3c..8df2f9ec 100644 --- a/readme.md +++ b/readme.md @@ -48,6 +48,8 @@ scoop install extras/youtube-music Alternately you can use [Winget](https://learn.microsoft.com/en-us/windows/package-manager/winget/), Windows 11s official CLI package manager to install the `th-ch.YouTubeMusic` package. +*Note: Microsoft Defender SmartScreen might block the installation since it is from an "unknown publisher". This is also true for the manual installation when trying to run the executable(.exe) after a manual download here on github (same file).* + ``` winget install th-ch.YouTubeMusic ``` From 254758a4f22232a354f4a3d28231e5624b7a7357 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Mon, 28 Nov 2022 08:48:16 +0000 Subject: [PATCH 15/36] fix: upgrade custom-electron-titlebar from 4.1.1 to 4.1.2 Snyk has created this PR to upgrade custom-electron-titlebar from 4.1.1 to 4.1.2. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 64d32789..2abd218c 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "browser-id3-writer": "^4.4.0", "chokidar": "^3.5.3", "custom-electron-prompt": "^1.5.0", - "custom-electron-titlebar": "^4.1.1", + "custom-electron-titlebar": "^4.1.2", "discord-rpc": "^4.0.1", "electron-better-web-request": "^1.0.1", "electron-debug": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 1cdd9a6f..624684fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1924,10 +1924,10 @@ custom-electron-prompt@^1.5.0: resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.5.0.tgz#b514267f28e9f0d61011e03f76b1e59473af33d4" integrity sha512-DO+CIfO8c5lG+yzAkXD8PbFunPQ+WCJ4QeGN8bCvos7Fxt3xFDW0Qdnm1v9DKkAMj7iG0SujhdfNzsrtA4fl5g== -custom-electron-titlebar@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.1.tgz#4e689db787acb2e7a634577146891c562732d1de" - integrity sha512-gLdQDYzHCHA83QVGRITaKlKB6NpJ6HZXD6oRKenkocSRTG3HFL9oXPbNfF5vGRaF1JjxsGoOu+/QS4Y4YGRbTw== +custom-electron-titlebar@^4.1.2: + version "4.1.3" + resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.3.tgz#6b5d0527858bae89314f3d0b4e6a0b9be4efad81" + integrity sha512-9tqiRxp7KG3qgS5Qh0ejSTwzqJ/pkB8RXQrvZHmilIzaWFmvjHiaSnHgCj+1iJcnhvzACYXFiFo2fxD64kFi4A== dashdash@^1.12.0: version "1.14.1" From a1bed628f47bc3032bacbe7c3e04930b20ef6e10 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 25 Dec 2022 23:16:18 +0100 Subject: [PATCH 16/36] Update build badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 8df2f9ec..105bc0e7 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,7 @@ [![GitHub release](https://img.shields.io/github/release/th-ch/youtube-music.svg?style=for-the-badge&logo=youtube-music)](https://github.com/th-ch/youtube-music/releases/) [![GitHub license](https://img.shields.io/github/license/th-ch/youtube-music.svg?style=for-the-badge)](https://github.com/th-ch/youtube-music/blob/master/LICENSE) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg?style=for-the-badge)](https://github.com/sindresorhus/xo) -[![Build status](https://img.shields.io/github/workflow/status/th-ch/youtube-music/Build%20YouTube%20Music?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/) +[![Build status](https://img.shields.io/github/actions/workflow/status/th-ch/youtube-music/build.yml?branch=master&style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/) [![Known Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/th-ch/youtube-music?style=for-the-badge)](https://snyk.io/test/github/th-ch/youtube-music) [![GitHub All Releases](https://img.shields.io/github/downloads/th-ch/youtube-music/total?style=for-the-badge&logo=youtube-music)](https://GitHub.com/th-ch/youtube-music/releases/) [![AUR](https://img.shields.io/aur/version/youtube-music-bin?color=blueviolet&style=for-the-badge&logo=youtube-music)](https://aur.archlinux.org/packages/youtube-music-bin) From 43c501b6d8a293abade78434bdb1807a786985bb Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 26 Dec 2022 18:46:52 +0100 Subject: [PATCH 17/36] Add option in skip-silences plugin to only skip at the beginning --- config/defaults.js | 3 +++ plugins/skip-silences/front.js | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/config/defaults.js b/config/defaults.js index 73c49649..b62432c6 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -91,6 +91,9 @@ const defaultConfig = { "saveSize": false, "hotkey": "P" }, + "skip-silences": { + onlySkipBeginning: false, + }, }, }; diff --git a/plugins/skip-silences/front.js b/plugins/skip-silences/front.js index 16f7ff94..17a534c9 100644 --- a/plugins/skip-silences/front.js +++ b/plugins/skip-silences/front.js @@ -1,7 +1,8 @@ const hark = require("hark/hark.bundle.js"); -module.exports = () => { +module.exports = (options) => { let isSilent = false; + let hasAudioStarted = false; document.addEventListener("apiLoaded", () => { const video = document.querySelector("video"); @@ -10,6 +11,10 @@ module.exports = () => { interval: 2, // ms }); const skipSilence = () => { + if (options.onlySkipBeginning && hasAudioStarted) { + return; + } + if (isSilent && !video.paused) { video.currentTime += 0.2; // in s } @@ -17,6 +22,7 @@ module.exports = () => { speechEvents.on("speaking", function () { isSilent = false; + hasAudioStarted = true; }); speechEvents.on("stopped_speaking", function () { @@ -35,10 +41,12 @@ module.exports = () => { }); video.addEventListener("play", function () { + hasAudioStarted = false; skipSilence(); }); video.addEventListener("seeked", function () { + hasAudioStarted = false; skipSilence(); }); }); From ccedb175457f21c5d711cd6b98e39b4f5a620628 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 26 Dec 2022 23:33:30 +0100 Subject: [PATCH 18/36] Replace rimraf by del-cli --- package.json | 4 +- yarn.lock | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 64d32789..938d85b6 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "icon": "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated", "generate:package": "node utils/generate-package-json.js", "postinstall": "yarn run icon && yarn run plugins", - "clean": "rimraf dist", + "clean": "del dist", "build": "yarn run clean && electron-builder --win --mac --linux", "build:linux": "yarn run clean && electron-builder --linux", "build:mac": "yarn run clean && electron-builder --mac dmg:x64", @@ -123,12 +123,12 @@ "devDependencies": { "@playwright/test": "^1.25.1", "auto-changelog": "^2.4.0", + "del-cli": "^5.0.0", "electron": "^20.1.1", "electron-builder": "^23.0.3", "electron-devtools-installer": "^3.1.1", "electron-icon-maker": "0.0.5", "playwright": "^1.25.1", - "rimraf": "^3.0.2", "xo": "^0.45.0" }, "resolutions": { diff --git a/yarn.lock b/yarn.lock index 1cdd9a6f..d2717e98 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1045,6 +1045,14 @@ agent-base@6: dependencies: debug "4" +aggregate-error@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-4.0.1.tgz#25091fe1573b9e0be892aeda15c7c66a545f758e" + integrity sha512-0poP0T7el6Vq3rstR8Mn4V/IQrpBLO6POkUSrN7RhyY+GF/InCFShQzsQ39T25gkHhLgSLByyAz+Kjb+c2L98w== + dependencies: + clean-stack "^4.0.0" + indent-string "^5.0.0" + ajv-formats@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" @@ -1698,6 +1706,13 @@ clean-stack@^2.1.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +clean-stack@^4.0.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-4.2.0.tgz#c464e4cde4ac789f4e0735c5d75beb49d7b30b31" + integrity sha512-LYv6XPxoyODi36Dp976riBtSY27VmFo+MKqEU9QCCWyTrdEPDog+RWA7xQWHi6Vbp61j5c4cdzzX1NidnwtUWg== + dependencies: + escape-string-regexp "5.0.0" + cli-boxes@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" @@ -2055,6 +2070,14 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" +del-cli@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/del-cli/-/del-cli-5.0.0.tgz#fa79fd57e888ecaaf8a468d87e8a175142a24aa9" + integrity sha512-rENFhUaYcjoMODwFhhlON+ogN7DoG+4+GFN+bsA1XeDt4w2OKQnQadFP1thHSAlK9FAtl88qgP66wOV+eFZZiQ== + dependencies: + del "^7.0.0" + meow "^10.1.3" + del@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/del/-/del-3.0.0.tgz#53ecf699ffcbcb39637691ab13baf160819766e5" @@ -2067,6 +2090,20 @@ del@^3.0.0: pify "^3.0.0" rimraf "^2.2.8" +del@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/del/-/del-7.0.0.tgz#79db048bec96f83f344b46c1a66e35d9c09fe8ac" + integrity sha512-tQbV/4u5WVB8HMJr08pgw0b6nG4RGt/tj+7Numvq+zqcvUFeMaIWWOUFltiU+6go8BSO2/ogsB4EasDaj0y68Q== + dependencies: + globby "^13.1.2" + graceful-fs "^4.2.10" + is-glob "^4.0.3" + is-path-cwd "^3.0.0" + is-path-inside "^4.0.0" + p-map "^5.5.0" + rimraf "^3.0.2" + slash "^4.0.0" + delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -2525,6 +2562,11 @@ escape-goat@^2.0.0: resolved "https://registry.yarnpkg.com/escape-goat/-/escape-goat-2.1.1.tgz#1b2dc77003676c457ec760b2dc68edb648188675" integrity sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q== +escape-string-regexp@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" @@ -2955,6 +2997,17 @@ fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" +fast-glob@^3.2.11: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + fast-glob@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" @@ -3380,6 +3433,17 @@ globby@^12.0.2: merge2 "^1.4.1" slash "^4.0.0" +globby@^13.1.2: + version "13.1.3" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" + integrity sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw== + dependencies: + dir-glob "^3.0.1" + fast-glob "^3.2.11" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^4.0.0" + globby@^6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" @@ -3418,6 +3482,11 @@ graceful-fs@^4.1.6, graceful-fs@^4.2.0: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" integrity sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ== +graceful-fs@^4.2.10: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + "graceful-readlink@>= 1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" @@ -3645,6 +3714,11 @@ ignore@^5.0.5, ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + image-q@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/image-q/-/image-q-1.1.1.tgz#fc84099664460b90ca862d9300b6bfbbbfbf8056" @@ -3942,6 +4016,11 @@ is-path-cwd@^1.0.0: resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-1.0.0.tgz#d225ec23132e89edd38fda767472e62e65f1106d" integrity sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0= +is-path-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-3.0.0.tgz#889b41e55c8588b1eb2a96a61d05740a674521c7" + integrity sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA== + is-path-in-cwd@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz#5ac48b345ef675339bd6c7a48a912110b241cf52" @@ -3961,6 +4040,11 @@ is-path-inside@^3.0.2: resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== +is-path-inside@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-4.0.0.tgz#805aeb62c47c1b12fc3fd13bfb3ed1e7430071db" + integrity sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA== + is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" @@ -4551,6 +4635,24 @@ meow@^10.1.1: type-fest "^1.2.2" yargs-parser "^20.2.9" +meow@^10.1.3: + version "10.1.5" + resolved "https://registry.yarnpkg.com/meow/-/meow-10.1.5.tgz#be52a1d87b5f5698602b0f32875ee5940904aa7f" + integrity sha512-/d+PQ4GKmGvM9Bee/DPa8z3mXs/pkvJE2KEThngVNOqtmljC6K7NMPxtc2JeZYTmpWb9k/TmxjeL18ez3h7vCw== + dependencies: + "@types/minimist" "^1.2.2" + camelcase-keys "^7.0.0" + decamelize "^5.0.0" + decamelize-keys "^1.1.0" + hard-rejection "^2.1.0" + minimist-options "4.1.0" + normalize-package-data "^3.0.2" + read-pkg-up "^8.0.0" + redent "^4.0.0" + trim-newlines "^4.0.2" + type-fest "^1.2.2" + yargs-parser "^20.2.9" + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -5002,6 +5104,13 @@ p-map@^1.1.1: resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.2.0.tgz#e4e94f311eabbc8633a1e79908165fca26241b6b" integrity sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA== +p-map@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/p-map/-/p-map-5.5.0.tgz#054ca8ca778dfa4cf3f8db6638ccb5b937266715" + integrity sha512-VFqfGDHlx87K66yZrNdI4YGtD70IRyd+zSvgks6mzHPRNkoKy+9EKP4SFC77/vTTQYmRmti7dvqC+m5jBrBAcg== + dependencies: + aggregate-error "^4.0.0" + p-try@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" From c38c416813f1253a14370d4f8b339dd39890c963 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Dec 2022 17:27:53 +0000 Subject: [PATCH 19/36] Bump qs from 6.5.2 to 6.5.3 Bumps [qs](https://github.com/ljharb/qs) from 6.5.2 to 6.5.3. - [Release notes](https://github.com/ljharb/qs/releases) - [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md) - [Commits](https://github.com/ljharb/qs/compare/v6.5.2...v6.5.3) --- updated-dependencies: - dependency-name: qs 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 fdfd3fff..c5a07fde 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5486,9 +5486,9 @@ pupa@^2.1.1: escape-goat "^2.0.0" qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== quick-lru@^5.1.1: version "5.1.1" From 74c9fe13e289fd028c42bcac10e5b4bfdc14fda2 Mon Sep 17 00:00:00 2001 From: MiepHD <63968466+MiepHD@users.noreply.github.com> Date: Wed, 28 Dec 2022 10:23:11 +0100 Subject: [PATCH 20/36] Added option to change alignment of video-toggle --- plugins/video-toggle/button-switcher.css | 2 +- plugins/video-toggle/front.js | 15 +++++++++++ plugins/video-toggle/menu.js | 32 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/plugins/video-toggle/button-switcher.css b/plugins/video-toggle/button-switcher.css index 7d3de097..048d1b6a 100644 --- a/plugins/video-toggle/button-switcher.css +++ b/plugins/video-toggle/button-switcher.css @@ -22,7 +22,7 @@ color: #fff; padding-right: 120px; position: absolute; - left: calc(50% - 120px); + left: var(--align); } .video-switch-button:before { diff --git a/plugins/video-toggle/front.js b/plugins/video-toggle/front.js index 9b6985eb..07f966c7 100644 --- a/plugins/video-toggle/front.js +++ b/plugins/video-toggle/front.js @@ -31,6 +31,21 @@ module.exports = (_options) => { document.addEventListener("apiLoaded", setup, { once: true, passive: true }); } } + const mainpanel = document.querySelector("#main-panel"); + switch (_options.align) { + case "right": { + mainpanel.style.setProperty("--align", "calc(100% - 240px)"); + return; + } + case "middle": { + mainpanel.style.setProperty("--align", "calc(50% - 120px)"); + return; + } + default: + case "left": { + mainpanel.style.setProperty("--align", "0px"); + } + } }; function setup(e) { diff --git a/plugins/video-toggle/menu.js b/plugins/video-toggle/menu.js index 2cf4be0a..059aa963 100644 --- a/plugins/video-toggle/menu.js +++ b/plugins/video-toggle/menu.js @@ -33,6 +33,38 @@ module.exports = (win, options) => [ }, ] }, + { + label: "Alignment", + submenu: [ + { + label: "Left", + type: "radio", + checked: options.align === 'left', + click: () => { + options.align = 'left'; + setMenuOptions("video-toggle", options); + } + }, + { + label: "Middle", + type: "radio", + checked: options.align === 'middle', + click: () => { + options.align = 'middle'; + setMenuOptions("video-toggle", options); + } + }, + { + label: "Right", + type: "radio", + checked: options.align === 'right', + click: () => { + options.align = 'right'; + setMenuOptions("video-toggle", options); + } + }, + ] + }, { label: "Force Remove Video Tab", type: "checkbox", From d0ed64928d9cb2fb03b655bf848ef390591c0172 Mon Sep 17 00:00:00 2001 From: TC Date: Wed, 28 Dec 2022 17:54:27 +0100 Subject: [PATCH 21/36] Update readme to get have precise build instructions --- readme.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 105bc0e7..ed490b31 100644 --- a/readme.md +++ b/readme.md @@ -185,9 +185,12 @@ module.exports = () => { ## Build -```sh -yarn build -``` +1. Clone the repo +2. Run `yarn` to install dependencies +3. Run `yarn build:OS` + - `yarn build:win` - Windows + - `yarn build:linux` - Linux + - `yarn build:mac` - MacOS Builds the app for macOS, Linux, and Windows, using [electron-builder](https://github.com/electron-userland/electron-builder). From 31ab27c39ff6319116a6514d952eed1f02dd45fd Mon Sep 17 00:00:00 2001 From: TC Date: Thu, 29 Dec 2022 22:42:53 +0100 Subject: [PATCH 22/36] Bump version and change release type when publishing a new version --- .github/workflows/build.yml | 85 ++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3af10e94..9ff16b1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,9 @@ name: Build YouTube Music on: - push +env: + NODE_VERSION: "16.x" + jobs: build: name: Build YouTube Music @@ -18,7 +21,7 @@ jobs: - name: Setup NodeJS uses: actions/setup-node@v3 with: - node-version: "16.x" + node-version: ${{ env.NODE_VERSION }} - name: Get yarn cache directory path id: yarn-cache-dir-path @@ -116,3 +119,83 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | yarn run release:win + + release: + runs-on: ubuntu-latest + name: Release YouTube Music + if: github.ref == 'refs/heads/master' + needs: build + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup NodeJS + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v3 + id: yarn-cache + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Install dependencies + run: yarn --frozen-lockfile + + - name: Get version + run: | + echo "VERSION_TAG=v$(node -pe "require('./package.json').version")" >> $GITHUB_ENV + + - name: Check if version already exists in tags + run: | + echo "VERSION_HASH=$(git rev-parse -q --verify 'refs/tags/${{ env.VERSION_TAG }}')" >> $GITHUB_ENV + echo "CHANGELOG_ANCHOR=$(echo $VERSION_TAG | sed -e 's/\.//g')" >> $GITHUB_ENV + + - name: Fetch draft release + if: ${{ env.VERSION_HASH == '' }} + uses: cardinalby/git-get-release-action@v1 + id: get_draft_release + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + latest: true + draft: true + searchLimit: 1 + + - name: Publish Release (if it does not exist) + if: ${{ env.VERSION_HASH == '' }} + uses: irongut/EditRelease@v1.2.0 + with: + token: ${{ secrets.GH_TOKEN }} + id: ${{ steps.get_draft_release.outputs.id }} + draft: false + prerelease: false + replacename: true + name: ${{ env.VERSION_TAG }} + replacebody: true + body: | + See [changelog](https://github.com/th-ch/youtube-music/blob/master/changelog.md#${{ env.CHANGELOG_ANCHOR }}) for the list of updates and the full diff. + + Thanks to all contributors! 🏅 + + - name: Update changelog + if: ${{ env.VERSION_HASH == '' }} + run: | + yarn changelog + + - name: Commit changelog + if: ${{ env.VERSION_HASH == '' }} + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Update changelog for ${{ env.VERSION_TAG }} + file_pattern: "changelog.md" + commit_user_name: CI + commit_user_email: th-ch@users.noreply.github.com From 51fdbe2086893a549e536b85321023a2a33c7553 Mon Sep 17 00:00:00 2001 From: TC Date: Sat, 31 Dec 2022 13:32:27 +0100 Subject: [PATCH 23/36] Bump version to 1.19.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9da3ad10..9827b524 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "youtube-music", "productName": "YouTube Music", - "version": "1.18.0", + "version": "1.19.0", "description": "YouTube Music Desktop App - including custom plugins", "license": "MIT", "repository": "th-ch/youtube-music", From fcb92fda84490146a07b70306fd0c24ab377123c Mon Sep 17 00:00:00 2001 From: th-ch Date: Sat, 31 Dec 2022 12:48:44 +0000 Subject: [PATCH 24/36] Update changelog for v1.19.0 --- changelog.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/changelog.md b/changelog.md index 4289094e..2bf98fa6 100644 --- a/changelog.md +++ b/changelog.md @@ -2,8 +2,37 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. +#### [v1.19.0](https://github.com/th-ch/youtube-music/compare/v1.18.0...v1.19.0) + +- Automatic release by CI when version is updated [`#936`](https://github.com/th-ch/youtube-music/pull/936) +- Center toggle of video-toggle [`#894`](https://github.com/th-ch/youtube-music/pull/894) +- Load plugins as soon as the window is created [`#890`](https://github.com/th-ch/youtube-music/pull/890) +- Bump qs from 6.5.2 to 6.5.3 [`#913`](https://github.com/th-ch/youtube-music/pull/913) +- [Snyk] Upgrade custom-electron-titlebar from 4.1.1 to 4.1.2 [`#900`](https://github.com/th-ch/youtube-music/pull/900) +- Add option in skip-silences plugin to only skip at the beginning [`#931`](https://github.com/th-ch/youtube-music/pull/931) +- Replace rimraf by del-cli [`#932`](https://github.com/th-ch/youtube-music/pull/932) +- docs: Added winget install instructions [`#873`](https://github.com/th-ch/youtube-music/pull/873) +- [Snyk] Upgrade async-mutex from 0.3.2 to 0.4.0 [`#855`](https://github.com/th-ch/youtube-music/pull/855) +- [Snyk] Upgrade @cliqz/adblocker-electron from 1.25.0 to 1.25.1 [`#856`](https://github.com/th-ch/youtube-music/pull/856) +- [Snyk] Upgrade custom-electron-titlebar from 4.1.0 to 4.1.1 [`#865`](https://github.com/th-ch/youtube-music/pull/865) +- [Snyk] Upgrade @ffmpeg/ffmpeg from 0.11.5 to 0.11.6 [`#876`](https://github.com/th-ch/youtube-music/pull/876) +- Discord Plugin RPC Fix [`#888`](https://github.com/th-ch/youtube-music/pull/888) +- Bump FFMpeg [`#854`](https://github.com/th-ch/youtube-music/pull/854) +- [Snyk] Upgrade @cliqz/adblocker-electron from 1.23.8 to 1.23.9 [`#823`](https://github.com/th-ch/youtube-music/pull/823) +- [Snyk] Upgrade electron-store from 8.0.2 to 8.1.0 [`#801`](https://github.com/th-ch/youtube-music/pull/801) +- proposal: Adding an option to hide duration before the song ends [`#802`](https://github.com/th-ch/youtube-music/pull/802) +- [Snyk] Security upgrade node-fetch from 2.6.7 to 3.2.10 [`#790`](https://github.com/th-ch/youtube-music/pull/790) +- Update README.md with a new theme repo [`#807`](https://github.com/th-ch/youtube-music/pull/807) +- Fix likes on touchbar (they were inverted) [`#822`](https://github.com/th-ch/youtube-music/pull/822) +- Add Scoop install directions for Windows 🪟 [`#839`](https://github.com/th-ch/youtube-music/pull/839) +- Bump version and change release type when publishing a new version [`31ab27c`](https://github.com/th-ch/youtube-music/commit/31ab27c39ff6319116a6514d952eed1f02dd45fd) +- Lock node-fetch to v2 for commonJS [`c9f610f`](https://github.com/th-ch/youtube-music/commit/c9f610f7fcfcce1317338364045ab0e1bf4249a4) +- fix: upgrade @cliqz/adblocker-electron from 1.25.0 to 1.25.1 [`762ef4e`](https://github.com/th-ch/youtube-music/commit/762ef4eede29b53aae912b3b50a1ca53f6765c53) + #### [v1.18.0](https://github.com/th-ch/youtube-music/compare/v1.17.0...v1.18.0) +> 5 September 2022 + - Bump ytdl-core (bug fix) [`#816`](https://github.com/th-ch/youtube-music/pull/816) - Bump electron and fix tests in CI [`#813`](https://github.com/th-ch/youtube-music/pull/813) - Allow user to pass custom CSS file [`#800`](https://github.com/th-ch/youtube-music/pull/800) From 3412b3504fdaafcd78be8ac00990b401933b64b3 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sat, 7 Jan 2023 04:36:24 +0200 Subject: [PATCH 25/36] use snoretoast CLSID --- index.js | 14 +++++++++++--- plugins/notifications/interactive.js | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 7cf0a99e..7e4e5980 100644 --- a/index.js +++ b/index.js @@ -363,6 +363,9 @@ app.on("ready", () => { // Register appID on windows if (is.windows()) { + // Depends on SnoreToast version https://github.com/KDE/snoretoast/blob/master/CMakeLists.txt#L5 + const toastActivatorClsid = "eb1fdd5b-8f70-4b5a-b230-998a2dc19303"; + const appID = "com.github.th-ch.youtube-music"; app.setAppUserModelId(appID); const appLocation = process.execPath; @@ -372,7 +375,11 @@ app.on("ready", () => { const shortcutPath = path.join(appData, "Microsoft", "Windows", "Start Menu", "Programs", "YouTube Music.lnk"); try { // check if shortcut is registered and valid const shortcutDetails = electron.shell.readShortcutLink(shortcutPath); // throw error if doesn't exist yet - if (shortcutDetails.target !== appLocation || shortcutDetails.appUserModelId !== appID) { + if ( + shortcutDetails.target !== appLocation || + shortcutDetails.appUserModelId !== appID || + shortcutDetails.toastActivatorClsid !== toastActivatorClsid + ) { throw "needUpdate"; } } catch (error) { // if not valid -> Register shortcut @@ -381,9 +388,10 @@ app.on("ready", () => { error === "needUpdate" ? "update" : "create", { target: appLocation, - cwd: appLocation.slice(0, appLocation.lastIndexOf(path.sep)), + cwd: path.dirname(appLocation), description: "YouTube Music Desktop App - including custom plugins", - appUserModelId: appID + appUserModelId: appID, + toastActivatorClsid } ); } diff --git a/plugins/notifications/interactive.js b/plugins/notifications/interactive.js index e692d0c7..b7535ea0 100644 --- a/plugins/notifications/interactive.js +++ b/plugins/notifications/interactive.js @@ -51,7 +51,7 @@ function sendToaster(songInfo) { //download image and get path let imgSrc = notificationImage(songInfo, true); toDelete = { - appID: is.dev() ? undefined : "com.github.th-ch.youtube-music", + appID: "com.github.th-ch.youtube-music", title: songInfo.title || "Playing", message: songInfo.artist, id: parseInt(Math.random() * 1000000, 10), From e6146940b1a5690d2d58e473d7b40b83bfb27519 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Sat, 7 Jan 2023 05:34:24 +0200 Subject: [PATCH 26/36] revert #600 --- .github/workflows/build.yml | 54 ------------------- ...1-Fix-activation-not-writing-to-pipe.patch | 30 ----------- 2 files changed, 84 deletions(-) delete mode 100644 vendor/snoretoast-patch/0001-Fix-activation-not-writing-to-pipe.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ff16b1d..f7a9cfd9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,60 +38,6 @@ jobs: - name: Install dependencies run: yarn --frozen-lockfile - ###################### - # Patch SnoreToast to fix App ID - see https://github.com/th-ch/youtube-music/issues/479#issuecomment-965473559 - - name: SnoreToast - parameters - id: snoretoast-params - if: startsWith(matrix.os, 'windows') - shell: bash - run: | - echo "::set-output name=version::v0.8.0" - echo "::set-output name=path::./vendor/snoretoast" - - - name: SnoreToast - cache - id: snoretoast-cache - uses: actions/cache@v2 - if: startsWith(matrix.os, 'windows') - with: - path: ${{ steps.snoretoast-params.outputs.path }} - key: snoretoast-${{ steps.snoretoast-params.outputs.version }} - - - name: SnoreToast - compile - if: | - startsWith(matrix.os, 'windows') && - steps.snoretoast-cache.outputs.cache-hit != 'true' - shell: bash - run: | - SNORETOAST_TAG="${{ steps.snoretoast-params.outputs.version }}" - echo "Compiling SnoreToast $SNORETOAST_TAG" - - git config --global user.email "th-ch@users.noreply.github.com" - git config --global user.name "YouTube Music" - git clone -c advice.detachedHead=false --branch $SNORETOAST_TAG --depth 1 https://github.com/KDE/snoretoast.git ${{ steps.snoretoast-params.outputs.path }} - cd ${{ steps.snoretoast-params.outputs.path }} - - # Apply https://github.com/KDE/snoretoast/pull/15/commits/c5faeceaf36f4b9fb27e5269990b716a25ecbe43 - # Patch generated with `git format-patch -1 c5faeceaf36f4b9fb27e5269990b716a25ecbe43` - git am < ../snoretoast-patch/0001-Fix-activation-not-writing-to-pipe.patch - - # Compile for win32 - cmake -A Win32 -B build32 - cmake --build build32 --config Release - - # Compile for x64 - cmake -A x64 -B build64 - cmake --build build64 --config Release - - - name: SnoreToast - overwrite with custom build - if: startsWith(matrix.os, 'windows') - shell: bash - run: | - # Override SnoreToast with the patched versions - cp ${{ steps.snoretoast-params.outputs.path }}/build32/bin/Release/snoretoast.exe ./node_modules/node-notifier/vendor/snoreToast/snoretoast-x86.exe - cp ${{ steps.snoretoast-params.outputs.path }}/build64/bin/Release/snoretoast.exe ./node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe - # End of SnoreToast patch - ###################### - - name: Test uses: GabrielBB/xvfb-action@v1 env: diff --git a/vendor/snoretoast-patch/0001-Fix-activation-not-writing-to-pipe.patch b/vendor/snoretoast-patch/0001-Fix-activation-not-writing-to-pipe.patch deleted file mode 100644 index 1015e4d8..00000000 --- a/vendor/snoretoast-patch/0001-Fix-activation-not-writing-to-pipe.patch +++ /dev/null @@ -1,30 +0,0 @@ -From c5faeceaf36f4b9fb27e5269990b716a25ecbe43 Mon Sep 17 00:00:00 2001 -From: Jake Barnes -Date: Mon, 3 May 2021 11:58:27 +1000 -Subject: [PATCH] Fix activation not writing to pipe - ---- - src/toasteventhandler.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/toasteventhandler.cpp b/src/toasteventhandler.cpp -index d45d92f..e239dde 100644 ---- a/src/toasteventhandler.cpp -+++ b/src/toasteventhandler.cpp -@@ -79,6 +79,13 @@ IFACEMETHODIMP ToastEventHandler::Invoke(_In_ IToastNotification * /*sender*/, - std::wcout << dataMap.at(L"button") << std::endl; - m_userAction = SnoreToastActions::Actions::ButtonClicked; - } -+ if (!m_toast.pipeName().empty()) { -+ if (m_userAction == SnoreToastActions::Actions::ButtonClicked) { -+ Utils::writePipe(m_toast.pipeName(), m_toast.formatAction(m_userAction, { { L"button", dataMap.at(L"button") } })); -+ } else { -+ Utils::writePipe(m_toast.pipeName(), m_toast.formatAction(m_userAction)); -+ } -+ } - } - SetEvent(m_event); - return S_OK; --- -2.35.1 - From bc23131e48027533906f11283515a81a3e6c4d5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Jan 2023 04:35:10 +0000 Subject: [PATCH 27/36] Bump json5 from 1.0.1 to 1.0.2 Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2. - [Release notes](https://github.com/json5/json5/releases) - [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md) - [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2) --- updated-dependencies: - dependency-name: json5 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 c5a07fde..b934648a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4294,9 +4294,9 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" - integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + version "1.0.2" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593" + integrity sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA== dependencies: minimist "^1.2.0" From 52b67af59c30e6148f00a485e25ebc8653ce7936 Mon Sep 17 00:00:00 2001 From: TC Date: Sun, 8 Jan 2023 19:17:00 +0100 Subject: [PATCH 28/36] Use same audio context/source everywhere --- package.json | 1 - plugins/audio-compressor/front.js | 13 +-- plugins/skip-silences/front.js | 145 +++++++++++++++++++++--------- preload.js | 26 ++++++ yarn.lock | 12 --- 5 files changed, 135 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index 9827b524..af2a9dca 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,6 @@ "electron-unhandled": "^4.0.1", "electron-updater": "^4.6.3", "filenamify": "^4.3.0", - "hark": "^1.2.3", "html-to-text": "^8.2.1", "md5": "^2.3.0", "mpris-service": "^2.1.2", diff --git a/plugins/audio-compressor/front.js b/plugins/audio-compressor/front.js index 129073e3..1281cec5 100644 --- a/plugins/audio-compressor/front.js +++ b/plugins/audio-compressor/front.js @@ -1,5 +1,5 @@ -const applyCompressor = () => { - const audioContext = new AudioContext(); +const applyCompressor = (e) => { + const audioContext = e.detail.audioContext; const compressor = audioContext.createDynamicsCompressor(); compressor.threshold.value = -50; @@ -8,10 +8,11 @@ const applyCompressor = () => { compressor.attack.value = 0; compressor.release.value = 0.25; - const source = audioContext.createMediaElementSource(document.querySelector("video")); - - source.connect(compressor); + e.detail.audioSource.connect(compressor); compressor.connect(audioContext.destination); }; -module.exports = () => document.addEventListener('apiLoaded', applyCompressor, { once: true, passive: true }); +module.exports = () => + document.addEventListener("audioCanPlay", applyCompressor, { + passive: true, + }); diff --git a/plugins/skip-silences/front.js b/plugins/skip-silences/front.js index 17a534c9..69a6e919 100644 --- a/plugins/skip-silences/front.js +++ b/plugins/skip-silences/front.js @@ -1,53 +1,112 @@ -const hark = require("hark/hark.bundle.js"); - module.exports = (options) => { let isSilent = false; let hasAudioStarted = false; - document.addEventListener("apiLoaded", () => { - const video = document.querySelector("video"); - const speechEvents = hark(video, { - threshold: -100, // dB (-100 = absolute silence, 0 = loudest) - interval: 2, // ms - }); - const skipSilence = () => { - if (options.onlySkipBeginning && hasAudioStarted) { - return; - } + const smoothing = 0.1; + const threshold = -100; // dB (-100 = absolute silence, 0 = loudest) + const interval = 2; // ms + const history = 10; + const speakingHistory = Array(history).fill(0); - if (isSilent && !video.paused) { - video.currentTime += 0.2; // in s - } - }; + document.addEventListener( + "audioCanPlay", + (e) => { + const video = document.querySelector("video"); + const audioContext = e.detail.audioContext; + const sourceNode = e.detail.audioSource; - speechEvents.on("speaking", function () { - isSilent = false; - hasAudioStarted = true; - }); + // Use an audio analyser similar to Hark + // https://github.com/otalk/hark/blob/master/hark.bundle.js + const analyser = audioContext.createAnalyser(); + analyser.fftSize = 512; + analyser.smoothingTimeConstant = smoothing; + const fftBins = new Float32Array(analyser.frequencyBinCount); - speechEvents.on("stopped_speaking", function () { - if ( - !( - video.paused || - video.seeking || - video.ended || - video.muted || - video.volume === 0 - ) - ) { - isSilent = true; + sourceNode.connect(analyser); + analyser.connect(audioContext.destination); + + const looper = () => { + setTimeout(() => { + const currentVolume = getMaxVolume(analyser, fftBins); + + let history = 0; + if (currentVolume > threshold && isSilent) { + // trigger quickly, short history + for ( + let i = speakingHistory.length - 3; + i < speakingHistory.length; + i++ + ) { + history += speakingHistory[i]; + } + if (history >= 2) { + // Not silent + isSilent = false; + hasAudioStarted = true; + } + } else if (currentVolume < threshold && !isSilent) { + for (let i = 0; i < speakingHistory.length; i++) { + history += speakingHistory[i]; + } + if (history == 0) { + // Silent + if ( + !( + video.paused || + video.seeking || + video.ended || + video.muted || + video.volume === 0 + ) + ) { + isSilent = true; + skipSilence(); + } + } + } + speakingHistory.shift(); + speakingHistory.push(0 + (currentVolume > threshold)); + + looper(); + }, interval); + }; + looper(); + + const skipSilence = () => { + if (options.onlySkipBeginning && hasAudioStarted) { + return; + } + + if (isSilent && !video.paused) { + video.currentTime += 0.2; // in s + } + }; + + video.addEventListener("play", function () { + hasAudioStarted = false; skipSilence(); - } - }); + }); - video.addEventListener("play", function () { - hasAudioStarted = false; - skipSilence(); - }); - - video.addEventListener("seeked", function () { - hasAudioStarted = false; - skipSilence(); - }); - }); + video.addEventListener("seeked", function () { + hasAudioStarted = false; + skipSilence(); + }); + }, + { + passive: true, + } + ); }; + +function getMaxVolume(analyser, fftBins) { + var maxVolume = -Infinity; + analyser.getFloatFrequencyData(fftBins); + + for (var i = 4, ii = fftBins.length; i < ii; i++) { + if (fftBins[i] > maxVolume && fftBins[i] < 0) { + maxVolume = fftBins[i]; + } + } + + return maxVolume; +} diff --git a/preload.js b/preload.js index 2b9122f1..ecfb8e17 100644 --- a/preload.js +++ b/preload.js @@ -90,6 +90,32 @@ function listenForApiLoad() { } function onApiLoaded() { + const video = document.querySelector("video"); + const audioContext = new AudioContext(); + const audioSource = audioContext.createMediaElementSource(video); + + video.addEventListener( + "loadstart", + () => { + // Emit "audioCanPlay" for each video + video.addEventListener( + "canplaythrough", + () => { + document.dispatchEvent( + new CustomEvent("audioCanPlay", { + detail: { + audioContext: audioContext, + audioSource: audioSource, + }, + }) + ); + }, + { once: true } + ); + }, + { passive: true } + ); + document.dispatchEvent(new CustomEvent('apiLoaded', { detail: api })); // Remove upgrade button diff --git a/yarn.lock b/yarn.lock index c5a07fde..b7505584 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3527,13 +3527,6 @@ hard-rejection@^2.1.0: resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" integrity sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA== -hark@^1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/hark/-/hark-1.2.3.tgz#959981400f561be5580ecd4321a9f55b16bacbd0" - integrity sha512-u68vz9SCa38ESiFJSDjqK8XbXqWzyot7Cj6Y2b6jk2NJ+II3MY2dIrLMg/kjtIAun4Y1DHF/20hfx4rq1G5GMg== - dependencies: - wildemitter "^1.2.0" - has-ansi@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" @@ -6639,11 +6632,6 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" -wildemitter@^1.2.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/wildemitter/-/wildemitter-1.2.1.tgz#9da3b5ca498e4378628d1783145493c70a10b774" - integrity sha512-UMmSUoIQSir+XbBpTxOTS53uJ8s/lVhADCkEbhfRjUGFDPme/XGOb0sBWLx5sTz7Wx/2+TlAw1eK9O5lw5PiEw== - word-wrap@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" From b77c62128eb6dc8ee3223f8f3fbad170dded9c88 Mon Sep 17 00:00:00 2001 From: TC Date: Mon, 9 Jan 2023 09:00:16 +0100 Subject: [PATCH 29/36] Implement visualizer plugin --- config/defaults.js | 66 +++++++++++++++++++ package.json | 4 ++ plugins/visualizer/back.js | 6 ++ plugins/visualizer/empty-player.css | 9 +++ plugins/visualizer/front.js | 61 +++++++++++++++++ plugins/visualizer/menu.js | 23 +++++++ plugins/visualizer/visualizers/butterchurn.js | 46 +++++++++++++ plugins/visualizer/visualizers/vudio.js | 33 ++++++++++ plugins/visualizer/visualizers/wave.js | 31 +++++++++ readme.md | 2 + yarn.lock | 64 +++++++++++++++++- 11 files changed, 344 insertions(+), 1 deletion(-) create mode 100644 plugins/visualizer/back.js create mode 100644 plugins/visualizer/empty-player.css create mode 100644 plugins/visualizer/front.js create mode 100644 plugins/visualizer/menu.js create mode 100644 plugins/visualizer/visualizers/butterchurn.js create mode 100644 plugins/visualizer/visualizers/vudio.js create mode 100644 plugins/visualizer/visualizers/wave.js diff --git a/config/defaults.js b/config/defaults.js index b62432c6..eaefcc24 100644 --- a/config/defaults.js +++ b/config/defaults.js @@ -94,6 +94,72 @@ const defaultConfig = { "skip-silences": { onlySkipBeginning: false, }, + visualizer: { + enabled: false, + type: "butterchurn", + // Config per visualizer + butterchurn: { + preset: "martin [shadow harlequins shape code] - fata morgana", + renderingFrequencyInMs: 500, + blendTimeInSeconds: 2.7, + }, + vudio: { + effect: "lighting", + accuracy: 128, + lighting: { + maxHeight: 160, + maxSize: 12, + lineWidth: 1, + color: "#49f3f7", + shadowBlur: 2, + shadowColor: "rgba(244,244,244,.5)", + fadeSide: true, + prettify: false, + horizontalAlign: "center", + verticalAlign: "middle", + dottify: true, + }, + }, + wave: { + animations: [ + { + type: "Cubes", + config: { + bottom: true, + count: 30, + cubeHeight: 5, + fillColor: { gradient: ["#FAD961", "#F76B1C"] }, + lineColor: "rgba(0,0,0,0)", + radius: 20, + }, + }, + { + type: "Cubes", + config: { + top: true, + count: 12, + cubeHeight: 5, + fillColor: { gradient: ["#FAD961", "#F76B1C"] }, + lineColor: "rgba(0,0,0,0)", + radius: 10, + }, + }, + { + type: "Circles", + config: { + lineColor: { + gradient: ["#FAD961", "#FAD961", "#F76B1C"], + rotate: 90, + }, + lineWidth: 4, + diameter: 20, + count: 10, + frequencyBand: "base", + }, + }, + ], + }, + }, }, }; diff --git a/package.json b/package.json index af2a9dca..9086d2e7 100644 --- a/package.json +++ b/package.json @@ -96,9 +96,12 @@ "@cliqz/adblocker-electron": "^1.25.1", "@ffmpeg/core": "^0.11.0", "@ffmpeg/ffmpeg": "^0.11.6", + "@foobar404/wave": "^2.0.4", "Simple-YouTube-Age-Restriction-Bypass": "https://gitpkg.now.sh/zerodytrash/Simple-YouTube-Age-Restriction-Bypass/dist?v2.5.4", "async-mutex": "^0.4.0", "browser-id3-writer": "^4.4.0", + "butterchurn": "^2.6.7", + "butterchurn-presets": "^2.4.7", "chokidar": "^3.5.3", "custom-electron-prompt": "^1.5.0", "custom-electron-titlebar": "^4.1.2", @@ -116,6 +119,7 @@ "mpris-service": "^2.1.2", "node-fetch": "^2.6.7", "node-notifier": "^10.0.1", + "vudio": "^2.1.1", "ytdl-core": "^4.11.1", "ytpl": "^2.3.0" }, diff --git a/plugins/visualizer/back.js b/plugins/visualizer/back.js new file mode 100644 index 00000000..b0f8c42b --- /dev/null +++ b/plugins/visualizer/back.js @@ -0,0 +1,6 @@ +const { injectCSS } = require("../utils"); +const path = require("path"); + +module.exports = (win, options) => { + injectCSS(win.webContents, path.join(__dirname, "empty-player.css")); +}; diff --git a/plugins/visualizer/empty-player.css b/plugins/visualizer/empty-player.css new file mode 100644 index 00000000..dc94788a --- /dev/null +++ b/plugins/visualizer/empty-player.css @@ -0,0 +1,9 @@ +#player { + margin: 0 !important; + background: black; +} + +#song-image, +#song-video { + display: none !important; +} diff --git a/plugins/visualizer/front.js b/plugins/visualizer/front.js new file mode 100644 index 00000000..47522422 --- /dev/null +++ b/plugins/visualizer/front.js @@ -0,0 +1,61 @@ +const defaultConfig = require("../../config/defaults"); + +module.exports = (options) => { + const optionsWithDefaults = { + ...defaultConfig.plugins.visualizer, + ...options, + }; + const VisualizerType = require(`./visualizers/${optionsWithDefaults.type}`); + + document.addEventListener( + "audioCanPlay", + (e) => { + const video = document.querySelector("video"); + const visualizerContainer = document.querySelector("#player"); + + let canvas = document.getElementById("visualizer"); + if (!canvas) { + canvas = document.createElement("canvas"); + canvas.id = "visualizer"; + canvas.style.position = "absolute"; + canvas.style.background = "black"; + visualizerContainer.append(canvas); + } + + const resizeCanvas = () => { + canvas.width = visualizerContainer.clientWidth; + canvas.height = visualizerContainer.clientHeight; + }; + resizeCanvas(); + + const gainNode = e.detail.audioContext.createGain(); + gainNode.gain.value = 1.25; + e.detail.audioSource.connect(gainNode); + + const visualizer = new VisualizerType( + e.detail.audioContext, + e.detail.audioSource, + visualizerContainer, + canvas, + gainNode, + video.captureStream(), + optionsWithDefaults[optionsWithDefaults.type] + ); + + const resizeVisualizer = (width, height) => { + resizeCanvas(); + visualizer.resize(width, height); + }; + resizeVisualizer(canvas.width, canvas.height); + const visualizerContainerObserver = new ResizeObserver((entries) => { + entries.forEach((entry) => { + resizeVisualizer(entry.contentRect.width, entry.contentRect.height); + }); + }); + visualizerContainerObserver.observe(visualizerContainer); + + visualizer.render(); + }, + { passive: true } + ); +}; diff --git a/plugins/visualizer/menu.js b/plugins/visualizer/menu.js new file mode 100644 index 00000000..181a71e7 --- /dev/null +++ b/plugins/visualizer/menu.js @@ -0,0 +1,23 @@ +const { readdirSync } = require("fs"); +const path = require("path"); + +const { setMenuOptions } = require("../../config/plugins"); + +const visualizerTypes = readdirSync(path.join(__dirname, "visualizers")).map( + (filename) => path.parse(filename).name +); + +module.exports = (win, options) => [ + { + label: "Type", + submenu: visualizerTypes.map((visualizerType) => ({ + label: visualizerType, + type: "radio", + checked: options.type === visualizerType, + click: () => { + options.type = visualizerType; + setMenuOptions("visualizer", options); + }, + })), + }, +]; diff --git a/plugins/visualizer/visualizers/butterchurn.js b/plugins/visualizer/visualizers/butterchurn.js new file mode 100644 index 00000000..1c30355d --- /dev/null +++ b/plugins/visualizer/visualizers/butterchurn.js @@ -0,0 +1,46 @@ +const butterchurn = require("butterchurn"); +const butterchurnPresets = require("butterchurn-presets"); + +const presets = butterchurnPresets.getPresets(); + +class ButterchurnVisualizer { + constructor( + audioContext, + audioSource, + visualizerContainer, + canvas, + audioNode, + stream, + options + ) { + this.visualizer = butterchurn.default.createVisualizer( + audioContext, + canvas, + { + width: canvas.width, + height: canvas.height, + } + ); + + const preset = presets[options.preset]; + this.visualizer.loadPreset(preset, options.blendTimeInSeconds); + + this.visualizer.connectAudio(audioNode); + + this.renderingFrequencyInMs = options.renderingFrequencyInMs; + } + + resize(width, height) { + this.visualizer.setRendererSize(width, height); + } + + render() { + const renderVisualizer = () => { + requestAnimationFrame(() => renderVisualizer()); + this.visualizer.render(); + }; + setTimeout(renderVisualizer(), this.renderingFrequencyInMs); + } +} + +module.exports = ButterchurnVisualizer; diff --git a/plugins/visualizer/visualizers/vudio.js b/plugins/visualizer/visualizers/vudio.js new file mode 100644 index 00000000..36cdf2a2 --- /dev/null +++ b/plugins/visualizer/visualizers/vudio.js @@ -0,0 +1,33 @@ +const Vudio = require("vudio/umd/vudio"); + +class VudioVisualizer { + constructor( + audioContext, + audioSource, + visualizerContainer, + canvas, + audioNode, + stream, + options + ) { + this.visualizer = new Vudio(stream, canvas, { + width: canvas.width, + height: canvas.height, + // Visualizer config + ...options, + }); + } + + resize(width, height) { + this.visualizer.setOption({ + width: width, + height: height, + }); + } + + render() { + this.visualizer.dance(); + } +} + +module.exports = VudioVisualizer; diff --git a/plugins/visualizer/visualizers/wave.js b/plugins/visualizer/visualizers/wave.js new file mode 100644 index 00000000..70db7f2a --- /dev/null +++ b/plugins/visualizer/visualizers/wave.js @@ -0,0 +1,31 @@ +const { Wave } = require("@foobar404/wave"); + +class WaveVisualizer { + constructor( + audioContext, + audioSource, + visualizerContainer, + canvas, + audioNode, + stream, + options + ) { + this.visualizer = new Wave( + { context: audioContext, source: audioSource }, + canvas + ); + options.animations.forEach((animation) => { + this.visualizer.addAnimation( + eval(`new this.visualizer.animations.${animation.type}( + ${JSON.stringify(animation.config)} + )`) + ); + }); + } + + resize(width, height) {} + + render() {} +} + +module.exports = WaveVisualizer; diff --git a/readme.md b/readme.md index ed490b31..03f2df33 100644 --- a/readme.md +++ b/readme.md @@ -108,6 +108,8 @@ winget install th-ch.YouTubeMusic - **Video Toggle**: Adds a [button](https://user-images.githubusercontent.com/28893833/173663950-63e6610e-a532-49b7-9afa-54cb57ddfc15.png) to switch between Video/Song mode. can also optionally remove the whole video tab +- **Visualizer**: Different music visualizers + --- - **Auto confirm when paused** (Always Enabled): disable the ["Continue Watching?"](https://user-images.githubusercontent.com/61631665/129977894-01c60740-7ec6-4bf0-9a2c-25da24491b0e.png) popup that pause music after a certain time diff --git a/yarn.lock b/yarn.lock index b7505584..7e583ea5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -202,6 +202,13 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.13.15.tgz#8e66775fb523599acb6a289e12929fa5ab0954d8" integrity sha512-b9COtcAlVEQljy/9fbcMHpG+UIW9ReF+gpaxDHTlZd0c6/UU9ng8zdySAW9sRTzpvcdCHn6bUcbuYUgGzLAWVQ== +"@babel/runtime@^7.0.0": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.7.tgz#fcb41a5a70550e04a7b708037c7c32f7f356d8fd" + integrity sha512-UF0tvkUtxwAgZ5W/KrkHf0Rn0fdnLDU9ScxBrEVNUprE/MzirjK4MJUX1/BVDv00Sv8cljtukVK1aky++X1SjQ== + dependencies: + regenerator-runtime "^0.13.11" + "@babel/runtime@^7.7.2": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.13.tgz#0a21452352b02542db0ffb928ac2d3ca7cb6d66d" @@ -374,6 +381,11 @@ regenerator-runtime "^0.13.7" resolve-url "^0.2.1" +"@foobar404/wave@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@foobar404/wave/-/wave-2.0.4.tgz#c9bc54c41b18642c6a4587851e28b8f858af98b0" + integrity sha512-FEyg37hDvQtrQVlFxbit7ov5e487BjsR32bZfJ4oAb5i+NnlbGaNyy6iYBZ8ocVHo8fgug+SL+mFdDTzqjvPww== + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -1364,6 +1376,14 @@ aws4@^1.8.0: resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g== + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -1557,6 +1577,23 @@ builtin-modules@^3.0.0: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== +butterchurn-presets@^2.4.7: + version "2.4.7" + resolved "https://registry.yarnpkg.com/butterchurn-presets/-/butterchurn-presets-2.4.7.tgz#41e4e37cd3af2aec124fa8062352816100956c29" + integrity sha512-4MdM8ripz/VfH1BCldrIKdAc/1ryJFBDvqlyow6Ivo1frwj0H3duzvSMFC7/wIjAjxb1QpwVHVqGqS9uAFKhpg== + dependencies: + babel-runtime "^6.26.0" + ecma-proposal-math-extensions "0.0.2" + lodash "^4.17.4" + +butterchurn@^2.6.7: + version "2.6.7" + resolved "https://registry.yarnpkg.com/butterchurn/-/butterchurn-2.6.7.tgz#1ff0c1365731a4fb7ada7bb16ae1c6f09a110c12" + integrity sha512-BJiRA8L0L2+84uoG2SSfkp0kclBuN+vQKf217pK7pMlwEO2ZEg3MtO2/o+l8Qpr8Nbejg8tmL1ZHD1jmhiaaqg== + dependencies: + "@babel/runtime" "^7.0.0" + ecma-proposal-math-extensions "0.0.2" + cacheable-request@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912" @@ -1892,6 +1929,11 @@ convert-source-map@^1.7.0: dependencies: safe-buffer "~5.1.1" +core-js@^2.4.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -2266,6 +2308,11 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecma-proposal-math-extensions@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/ecma-proposal-math-extensions/-/ecma-proposal-math-extensions-0.0.2.tgz#a6a3d64819db70cee0d2e1976b6315d00e4714a0" + integrity sha512-80BnDp2Fn7RxXlEr5HHZblniY4aQ97MOAicdWWpSo0vkQiISSE9wLR4SqxKsu4gCtXFBIPPzy8JMhay4NWRg/Q== + ejs@^3.1.6: version "3.1.7" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.7.tgz#c544d9c7f715783dd92f0bddcf73a59e6962d006" @@ -4525,7 +4572,7 @@ lodash.truncate@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" integrity sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM= -lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.3.0: +lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5605,6 +5652,16 @@ redent@^4.0.0: indent-string "^5.0.0" strip-indent "^4.0.0" +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + regenerator-runtime@^0.13.3, regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -6582,6 +6639,11 @@ verror@1.10.0, verror@^1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vudio@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/vudio/-/vudio-2.1.1.tgz#af256c4e1c8ae8bdbbba0e718f8106a30a44e96e" + integrity sha512-VkFQcFt/b/kpF5Eg5Sq+oXUo1Zp5aRFF4BSmIrOzau5o+5WMWwX9ae/EGJZstCyZFiCTU5iw1Y+u2BCGW6Y6Jw== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From 8728784c02d4c3d31df05e09239cdff6cec08856 Mon Sep 17 00:00:00 2001 From: MiepHD <63968466+MiepHD@users.noreply.github.com> Date: Mon, 9 Jan 2023 18:16:33 +0100 Subject: [PATCH 30/36] Fixed running before `#main-panel` exists --- plugins/video-toggle/button-switcher.css | 1 - plugins/video-toggle/front.js | 30 ++++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/video-toggle/button-switcher.css b/plugins/video-toggle/button-switcher.css index 048d1b6a..3bae2fc6 100644 --- a/plugins/video-toggle/button-switcher.css +++ b/plugins/video-toggle/button-switcher.css @@ -22,7 +22,6 @@ color: #fff; padding-right: 120px; position: absolute; - left: var(--align); } .video-switch-button:before { diff --git a/plugins/video-toggle/front.js b/plugins/video-toggle/front.js index 07f966c7..31c1b8f3 100644 --- a/plugins/video-toggle/front.js +++ b/plugins/video-toggle/front.js @@ -31,21 +31,6 @@ module.exports = (_options) => { document.addEventListener("apiLoaded", setup, { once: true, passive: true }); } } - const mainpanel = document.querySelector("#main-panel"); - switch (_options.align) { - case "right": { - mainpanel.style.setProperty("--align", "calc(100% - 240px)"); - return; - } - case "middle": { - mainpanel.style.setProperty("--align", "calc(50% - 120px)"); - return; - } - default: - case "left": { - mainpanel.style.setProperty("--align", "0px"); - } - } }; function setup(e) { @@ -73,6 +58,21 @@ function setup(e) { video.addEventListener('srcChanged', videoStarted); observeThumbnail(); + + switch (options.align) { + case "right": { + switchButtonDiv.style.left = "calc(100% - 240px)"; + return; + } + case "middle": { + switchButtonDiv.style.left = "calc(50% - 120px)"; + return; + } + default: + case "left": { + switchButtonDiv.style.left = "0px"; + } + } } function changeDisplay(showVideo) { From f9820df6c649a01e7cdbff7fe50ac0376d3724e0 Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:18:58 +0200 Subject: [PATCH 31/36] fix PiP button fix #959 --- plugins/picture-in-picture/front.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/picture-in-picture/front.js b/plugins/picture-in-picture/front.js index 685b15c1..92b3d17e 100644 --- a/plugins/picture-in-picture/front.js +++ b/plugins/picture-in-picture/front.js @@ -69,7 +69,9 @@ function observeMenu(options) { listenForToggle(); const minButton = $(".player-minimize-button"); // remove native listeners + const svg = $(".player-minimize-button #icon svg").cloneNode(true); minButton.replaceWith(minButton.cloneNode(true)); + $(".player-minimize-button #icon").appendChild(svg); $(".player-minimize-button").onclick = () => { global.togglePictureInPicture(); setTimeout(() => $('#player').click()); From b3f561cf2f599202a101fe2af4a5ce49fd27d20a Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:53:17 +0200 Subject: [PATCH 32/36] disable maximize button on PiP (doesn't work if `in-app-menu` is enabled) --- plugins/picture-in-picture/back.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/picture-in-picture/back.js b/plugins/picture-in-picture/back.js index fa679d79..d71acd49 100644 --- a/plugins/picture-in-picture/back.js +++ b/plugins/picture-in-picture/back.js @@ -47,6 +47,7 @@ const togglePiP = async () => { win.webContents.on("before-input-event", blockShortcutsInPiP); + win.setMaximizable(false); win.setFullScreenable(false); runAdaptors(); @@ -62,6 +63,7 @@ const togglePiP = async () => { } } else { win.webContents.removeListener("before-input-event", blockShortcutsInPiP); + win.setMaximizable(true); win.setFullScreenable(true); runAdaptors(); From 0e99f96f01803600c5b35de9f4c64169dd1625bd Mon Sep 17 00:00:00 2001 From: Araxeus <78568641+Araxeus@users.noreply.github.com> Date: Thu, 12 Jan 2023 19:51:38 +0200 Subject: [PATCH 33/36] fix PiP unminimize button hidden --- plugins/picture-in-picture/front.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/plugins/picture-in-picture/front.js b/plugins/picture-in-picture/front.js index 92b3d17e..788a908e 100644 --- a/plugins/picture-in-picture/front.js +++ b/plugins/picture-in-picture/front.js @@ -10,6 +10,21 @@ const pipButton = ElementFromFile( templatePath(__dirname, "picture-in-picture.html") ); +// will also clone +function replaceButton(query, button) { + const svg = button.querySelector("#icon svg").cloneNode(true); + button.replaceWith(button.cloneNode(true)); + button.remove(); + const newButton = $(query); + newButton.querySelector("#icon").appendChild(svg); + return newButton; +} + +function cloneButton(query) { + replaceButton(query, $(query)); + return $(query); +} + const observer = new MutationObserver(() => { if (!menu) { menu = getSongMenu(); @@ -30,9 +45,6 @@ global.togglePictureInPicture = () => { const listenForToggle = () => { const originalExitButton = $(".exit-fullscreen-button"); - const clonedExitButton = originalExitButton.cloneNode(true); - clonedExitButton.onclick = () => togglePictureInPicture(); - const appLayout = $("ytmusic-app-layout"); const expandMenu = $('#expanding-menu'); const middleControls = $('.middle-controls'); @@ -44,7 +56,7 @@ const listenForToggle = () => { ipcRenderer.on('pip-toggle', (_, isPip) => { if (isPip) { - $(".exit-fullscreen-button").replaceWith(clonedExitButton); + replaceButton(".exit-fullscreen-button", originalExitButton).onclick = () => togglePictureInPicture(); player.onDoubleClick_ = () => {}; expandMenu.onmouseleave = () => middleControls.click(); if (!playerPage.playerPageOpen_) { @@ -67,12 +79,8 @@ function observeMenu(options) { "apiLoaded", () => { listenForToggle(); - const minButton = $(".player-minimize-button"); // remove native listeners - const svg = $(".player-minimize-button #icon svg").cloneNode(true); - minButton.replaceWith(minButton.cloneNode(true)); - $(".player-minimize-button #icon").appendChild(svg); - $(".player-minimize-button").onclick = () => { + cloneButton(".player-minimize-button").onclick = () => { global.togglePictureInPicture(); setTimeout(() => $('#player').click()); }; From 3389679287ca5c578336ebcaee79c11f402117f9 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Sat, 14 Jan 2023 02:08:25 +0000 Subject: [PATCH 34/36] fix: upgrade custom-electron-titlebar from 4.1.3 to 4.1.5 Snyk has created this PR to upgrade custom-electron-titlebar from 4.1.3 to 4.1.5. 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=referral&page=upgrade-pr --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index af2a9dca..401fb927 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "browser-id3-writer": "^4.4.0", "chokidar": "^3.5.3", "custom-electron-prompt": "^1.5.0", - "custom-electron-titlebar": "^4.1.2", + "custom-electron-titlebar": "^4.1.5", "discord-rpc": "^4.0.1", "electron-better-web-request": "^1.0.1", "electron-debug": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index b7505584..d0a2fb4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1939,10 +1939,10 @@ custom-electron-prompt@^1.5.0: resolved "https://registry.yarnpkg.com/custom-electron-prompt/-/custom-electron-prompt-1.5.0.tgz#b514267f28e9f0d61011e03f76b1e59473af33d4" integrity sha512-DO+CIfO8c5lG+yzAkXD8PbFunPQ+WCJ4QeGN8bCvos7Fxt3xFDW0Qdnm1v9DKkAMj7iG0SujhdfNzsrtA4fl5g== -custom-electron-titlebar@^4.1.2: - version "4.1.3" - resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.3.tgz#6b5d0527858bae89314f3d0b4e6a0b9be4efad81" - integrity sha512-9tqiRxp7KG3qgS5Qh0ejSTwzqJ/pkB8RXQrvZHmilIzaWFmvjHiaSnHgCj+1iJcnhvzACYXFiFo2fxD64kFi4A== +custom-electron-titlebar@^4.1.5: + version "4.1.5" + resolved "https://registry.yarnpkg.com/custom-electron-titlebar/-/custom-electron-titlebar-4.1.5.tgz#5032759ee5594fd618a62cff0de46150fd8e2b24" + integrity sha512-KpVmO+Fz34zNw/jYbOD6YwxPr6h2hgZmNbjy0AvhlXiH4dxeZJXDlMcBX08NqsESymMQvIWwsGaA//YGW1bXjA== dashdash@^1.12.0: version "1.14.1" From 210a16a32b3be928d808065a9258021ba3fc4efc Mon Sep 17 00:00:00 2001 From: Zohan Subhash Date: Sat, 14 Jan 2023 06:15:51 +0530 Subject: [PATCH 35/36] Update back.js --- plugins/touchbar/back.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/touchbar/back.js b/plugins/touchbar/back.js index 617682f5..02b28cc1 100644 --- a/plugins/touchbar/back.js +++ b/plugins/touchbar/back.js @@ -63,7 +63,7 @@ module.exports = (win) => { // If the page is ready, register the callback win.once("ready-to-show", () => { - controls = [previous, playPause, next, like, dislike]; + controls = [previous, playPause, next, dislike, like]; // Register the callback registerCallback((songInfo) => { From 6e96b355bd822e0105edc7178d536601cbb4c43a Mon Sep 17 00:00:00 2001 From: TC Date: Sat, 14 Jan 2023 14:44:02 +0100 Subject: [PATCH 36/36] Add migration for visualizer plugin --- config/store.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/store.js b/config/store.js index 85097c4e..c528d6a4 100644 --- a/config/store.js +++ b/config/store.js @@ -9,6 +9,9 @@ const setDefaultPluginOptions = (store, plugin) => { } const migrations = { + ">=1.20.0": (store) => { + setDefaultPluginOptions(store, "visualizer"); + }, ">=1.17.0": (store) => { setDefaultPluginOptions(store, "picture-in-picture");