Compare commits

...

15 Commits

Author SHA1 Message Date
TC
1b54b19f3f Add "build:linux" script 2020-12-02 22:22:05 +01:00
TC
be7e6e431f Bump version to 1.6.5 2020-12-02 22:14:43 +01:00
6e42b097f8 Merge pull request #77 from th-ch/disable-hardware-acceleration
Add option to disable hardware acceleration
2020-12-02 22:12:42 +01:00
TC
ef9cd8cd24 Add option to disable hardware acceleration 2020-12-02 22:07:15 +01:00
8f3e165917 Merge pull request #76 from th-ch/downloader-plugin-retry-and-upgrade-dep
Downloader plugin - retry and upgrade dependencies
2020-12-02 21:41:04 +01:00
TC
33a11efe9a Update ytdl-core to 4.1.1 2020-12-02 21:16:39 +01:00
TC
9a97436cd8 Allow up to 3 retries in downloader 2020-12-02 21:16:12 +01:00
f7935c0024 Merge pull request #70 from hbarsaiyan/master
Reflect Arch Linux package name change
2020-11-29 21:17:02 +01:00
2b33d4e857 Reflect Arch Linux package name change
Package name has been changed to youtube-music-bin.
2020-11-29 23:57:07 +05:30
ed16c35a57 Merge pull request #67 from th-ch/hide-menu
Option to hide menu
2020-11-28 18:45:53 +01:00
TC
ae5b85d8d7 Autoupdate modal: add download/disable updates buttons 2020-11-28 18:13:41 +01:00
47b4414eb3 Merge pull request #68 from hbarsaiyan/master
Add Arch Linux installation instructions
2020-11-28 11:09:07 +01:00
e329bb2201 Add Arch Linux installation instructions 2020-11-28 15:22:34 +05:30
TC
155ef9e5f5 Bump version 2020-11-27 21:39:33 +01:00
TC
4bac3ace18 Option to hide menu (win/linux) 2020-11-27 21:39:15 +01:00
7 changed files with 78 additions and 26 deletions

View File

@ -8,9 +8,12 @@ const { autoUpdater } = require("electron-updater");
const { setApplicationMenu } = require("./menu"); const { setApplicationMenu } = require("./menu");
const { const {
autoUpdate, autoUpdate,
disableHardwareAcceleration,
getEnabledPlugins, getEnabledPlugins,
hideMenu,
isAppVisible, isAppVisible,
isTrayEnabled, isTrayEnabled,
setOptions,
store, store,
startAtLogin, startAtLogin,
} = require("./store"); } = require("./store");
@ -25,6 +28,12 @@ app.commandLine.appendSwitch(
"--experimental-wasm-threads --experimental-wasm-bulk-memory" "--experimental-wasm-threads --experimental-wasm-bulk-memory"
); );
app.allowRendererProcessReuse = true; // https://github.com/electron/electron/issues/18397 app.allowRendererProcessReuse = true; // https://github.com/electron/electron/issues/18397
if (disableHardwareAcceleration()) {
if (is.dev()) {
console.log("Disabling hardware acceleration");
}
app.disableHardwareAcceleration();
}
// Adds debug features like hotkeys for triggering dev tools and reload // Adds debug features like hotkeys for triggering dev tools and reload
require("electron-debug")(); require("electron-debug")();
@ -85,6 +94,7 @@ function createMainWindow() {
}, },
frame: !is.macOS(), frame: !is.macOS(),
titleBarStyle: is.macOS() ? "hiddenInset" : "default", titleBarStyle: is.macOS() ? "hiddenInset" : "default",
autoHideMenuBar: hideMenu(),
}); });
if (windowMaximized) { if (windowMaximized) {
win.maximize(); win.maximize();
@ -196,15 +206,29 @@ app.on("ready", () => {
if (!is.dev() && autoUpdate()) { if (!is.dev() && autoUpdate()) {
autoUpdater.checkForUpdatesAndNotify(); autoUpdater.checkForUpdatesAndNotify();
autoUpdater.on("update-available", () => { autoUpdater.on("update-available", () => {
const downloadLink =
"https://github.com/th-ch/youtube-music/releases/latest";
const dialogOpts = { const dialogOpts = {
type: "info", type: "info",
buttons: ["OK"], buttons: ["OK", "Download", "Disable updates"],
title: "Application Update", title: "Application Update",
message: "A new version is available", message: "A new version is available",
detail: detail: `A new version is available and can be downloaded at ${downloadLink}`,
"A new version is available and can be downloaded at https://github.com/th-ch/youtube-music/releases/latest",
}; };
electron.dialog.showMessageBox(dialogOpts); electron.dialog.showMessageBox(dialogOpts).then((dialogOutput) => {
switch (dialogOutput.response) {
// Download
case 1:
electron.shell.openExternal(downloadLink);
break;
// Disable updates
case 2:
setOptions({ autoUpdates: false });
break;
default:
break;
}
});
}); });
} }

22
menu.js
View File

@ -7,10 +7,12 @@ const {
enablePlugin, enablePlugin,
disablePlugin, disablePlugin,
autoUpdate, autoUpdate,
hideMenu,
isAppVisible, isAppVisible,
isTrayEnabled, isTrayEnabled,
setOptions, setOptions,
startAtLogin, startAtLogin,
disableHardwareAcceleration,
} = require("./store"); } = require("./store");
const mainMenuTemplate = (win) => [ const mainMenuTemplate = (win) => [
@ -42,6 +44,26 @@ const mainMenuTemplate = (win) => [
setOptions({ autoUpdates: item.checked }); setOptions({ autoUpdates: item.checked });
}, },
}, },
{
label: "Disable hardware acceleration",
type: "checkbox",
checked: disableHardwareAcceleration(),
click: (item) => {
setOptions({ disableHardwareAcceleration: item.checked });
},
},
...(is.windows() || is.linux()
? [
{
label: "Hide menu",
type: "checkbox",
checked: hideMenu(),
click: (item) => {
setOptions({ hideMenu: item.checked });
},
},
]
: []),
...(is.windows() || is.macOS() ...(is.windows() || is.macOS()
? // Only works on Win/Mac ? // Only works on Win/Mac
// https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows // https://www.electronjs.org/docs/api/app#appsetloginitemsettingssettings-macos-windows

View File

@ -1,7 +1,7 @@
{ {
"name": "youtube-music", "name": "youtube-music",
"productName": "YouTube Music", "productName": "YouTube Music",
"version": "1.6.3", "version": "1.6.5",
"description": "YouTube Music Desktop App - including custom plugins", "description": "YouTube Music Desktop App - including custom plugins",
"license": "MIT", "license": "MIT",
"repository": "th-ch/youtube-music", "repository": "th-ch/youtube-music",
@ -33,6 +33,7 @@
"postinstall": "yarn run icon && yarn run plugins", "postinstall": "yarn run icon && yarn run plugins",
"clean": "rimraf dist", "clean": "rimraf dist",
"build": "yarn run clean && electron-builder --win --mac --linux", "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", "build:mac": "yarn run clean && electron-builder --mac",
"build:win": "yarn run clean && electron-builder --win", "build:win": "yarn run clean && electron-builder --win",
"plugins": "yarn run plugin:adblocker && yarn run plugin:autoconfirm", "plugins": "yarn run plugin:adblocker && yarn run plugin:autoconfirm",
@ -59,7 +60,7 @@
"electron-updater": "^4.3.5", "electron-updater": "^4.3.5",
"filenamify": "^4.2.0", "filenamify": "^4.2.0",
"node-fetch": "^2.6.1", "node-fetch": "^2.6.1",
"ytdl-core": "^4.0.3" "ytdl-core": "^4.1.1"
}, },
"devDependencies": { "devDependencies": {
"electron": "^10.1.3", "electron": "^10.1.3",

View File

@ -29,6 +29,7 @@ const downloadVideoToMP3 = (videoUrl, sendFeedback, sendError, reinit) => {
filter: "audioonly", filter: "audioonly",
quality: "highestaudio", quality: "highestaudio",
highWaterMark: 32 * 1024 * 1024, // 32 MB highWaterMark: 32 * 1024 * 1024, // 32 MB
requestOptions: { maxRetries: 3 },
}); });
} catch (err) { } catch (err) {
sendError(err); sendError(err);

View File

@ -18,6 +18,10 @@
You can check out the [latest release](https://github.com/th-ch/youtube-music/releases/latest) to quickly find the latest version. You can check out the [latest release](https://github.com/th-ch/youtube-music/releases/latest) to quickly find the latest version.
**Arch Linux**
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: ## Available plugins:
- **Ad Blocker**: block all ads and tracking out of the box - **Ad Blocker**: block all ads and tracking out of the box

View File

@ -13,7 +13,9 @@ const store = new Store({
tray: false, tray: false,
appVisible: true, appVisible: true,
autoUpdates: true, autoUpdates: true,
hideMenu: false,
startAtLogin: false, startAtLogin: false,
disableHardwareAcceleration: false,
}, },
}, },
}); });
@ -31,5 +33,8 @@ module.exports = {
isTrayEnabled: () => store.get("options.tray"), isTrayEnabled: () => store.get("options.tray"),
isAppVisible: () => store.get("options.appVisible"), isAppVisible: () => store.get("options.appVisible"),
autoUpdate: () => store.get("options.autoUpdates"), autoUpdate: () => store.get("options.autoUpdates"),
hideMenu: () => store.get("options.hideMenu"),
startAtLogin: () => store.get("options.startAtLogin"), startAtLogin: () => store.get("options.startAtLogin"),
disableHardwareAcceleration: () =>
store.get("options.disableHardwareAcceleration"),
}; };

View File

@ -5857,12 +5857,12 @@ lru-cache@^6.0.0:
dependencies: dependencies:
yallist "^4.0.0" yallist "^4.0.0"
m3u8stream@^0.8.0: m3u8stream@^0.8.3:
version "0.8.0" version "0.8.3"
resolved "https://registry.yarnpkg.com/m3u8stream/-/m3u8stream-0.8.0.tgz#025a63358ee32d7652bdc0a93f46078582ec5e96" resolved "https://registry.yarnpkg.com/m3u8stream/-/m3u8stream-0.8.3.tgz#c4624e92b4240eb356d040c4a5e155586cf58108"
integrity sha512-vvSjdkBPdDHzVr2M+aIXbnYys4zX6m3UzxMaxBJr1PpE0e/3sawkLD4EEmz/q9hv87bleotR70cOWR3UBMtskw== integrity sha512-0nAcdrF8YJKUkb6PzWdvGftTPyCVWgoiot1AkNVbPKTeIGsWs6DrOjifrJ0Zi8WQfQmD2SuVCjkYIOip12igng==
dependencies: dependencies:
miniget "^2.0.1" miniget "^4.0.0"
sax "^1.2.4" sax "^1.2.4"
make-dir@^3.0.0, make-dir@^3.0.2: make-dir@^3.0.0, make-dir@^3.0.2:
@ -6060,15 +6060,10 @@ min-indent@^1.0.0:
resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869"
integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==
miniget@^2.0.1: miniget@^4.0.0:
version "2.0.1" version "4.1.0"
resolved "https://registry.yarnpkg.com/miniget/-/miniget-2.0.1.tgz#e2188573317ad8239bab33f056aae64804fc8e47" resolved "https://registry.yarnpkg.com/miniget/-/miniget-4.1.0.tgz#018cc1180d2fe4d45ed735ac6bd2ab7224e8bceb"
integrity sha512-MX+QfVIPAutz6c+T7WKuFKtjcw0nOyRRh1ubhTDD+z/e/pKcSAsfAV63aQKUgb1MFRT1GyfJeW53N5fHkX0wIA== integrity sha512-kzhrNv5L7LlomwGmPGQsLQ2PnT1LeJJWfB0wNFGyv426gEM1gsfziBQmfkr6XOBA8EusZg9nowlNT5CbuKTjZg==
miniget@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/miniget/-/miniget-2.1.0.tgz#2dfb9ecb3a9a55d9dc682102f65fca2a06e3f5ca"
integrity sha512-fy9x3d/0oOIhkwAms6kgxTYkHwdELhMfgj+9a/aYZpJdTWIIWGta9aXHUtnzUn+LjBmRoTdPRQSi2hkmEvXk3A==
minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1:
version "1.0.1" version "1.0.1"
@ -8941,14 +8936,14 @@ yauzl@^2.10.0:
buffer-crc32 "~0.2.3" buffer-crc32 "~0.2.3"
fd-slicer "~1.1.0" fd-slicer "~1.1.0"
ytdl-core@^4.0.3: ytdl-core@^4.1.1:
version "4.0.3" version "4.1.1"
resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.0.3.tgz#9772dc6f7f0272534d50f50903022f8502ae44fa" resolved "https://registry.yarnpkg.com/ytdl-core/-/ytdl-core-4.1.1.tgz#191fabf472c44f969fe3eca15cb4d1c094e46282"
integrity sha512-+pM+EocvdHHTfH3xCr3c41cIm8bD7IE/wv/QKjaO7PwdLaaOMIj7xc/7yWwy9NwUDgIKA1YTotcn0qpQ0FVtMA== integrity sha512-T2VIS64sHKdLLqvuTV7S4WyoUCZLdR7HOP/9jX1CyXKYUjKLFP9UpVIFH0ZUvFSmK48eNFErWLOO5dGouwqztQ==
dependencies: dependencies:
html-entities "^1.3.1" html-entities "^1.3.1"
m3u8stream "^0.8.0" m3u8stream "^0.8.3"
miniget "^2.1.0" miniget "^4.0.0"
sax "^1.1.3" sax "^1.1.3"
zip-stream@^4.0.0: zip-stream@^4.0.0: