mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a3d5c038ea | |||
| 91f7a0d1a5 | |||
| d5a6e50017 | |||
| 6d8204f60a | |||
| f25bb59065 | |||
| 39c7d56791 | |||
| 1a0369b69d | |||
| e5b4e01a96 | |||
| 0a6587942b | |||
| 7050dfca5c | |||
| 4a7a94240a | |||
| 479013f9c9 | |||
| 164c3141ca | |||
| 234954a86c | |||
| 8c19757dfc | |||
| 790185893d | |||
| 7a816fa4f3 | |||
| d4b5c53dc3 | |||
| e1b83f07a8 | |||
| b855726973 | |||
| 9371a4827e | |||
| 81ce939451 | |||
| 6fd10ea4a0 | |||
| 746b5f13bb | |||
| 474bfd19a2 | |||
| 71222649a0 | |||
| 1a72129108 | |||
| 3108e16018 | |||
| fae19f4533 | |||
| 348f1b8189 | |||
| ffdc7f66b9 |
@ -13,8 +13,8 @@ matrix:
|
|||||||
language: generic
|
language: generic
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
|
yarn: false
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
|
||||||
- $HOME/.cache/electron
|
- $HOME/.cache/electron
|
||||||
- $HOME/.cache/electron-builder
|
- $HOME/.cache/electron-builder
|
||||||
|
|
||||||
@ -30,13 +30,15 @@ script:
|
|||||||
-v ${PWD}:/project \
|
-v ${PWD}:/project \
|
||||||
-v ~/.cache/electron:/root/.cache/electron \
|
-v ~/.cache/electron:/root/.cache/electron \
|
||||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
||||||
electronuserland/builder \
|
electronuserland/builder:10 \
|
||||||
/bin/bash -c "npm install && npm run release:linux"
|
/bin/bash -c "yarn && npm run release:linux"
|
||||||
else
|
else
|
||||||
npm run release:mac
|
npm run release:mac
|
||||||
fi
|
fi
|
||||||
before_cache:
|
before_cache:
|
||||||
- rm -rf $HOME/.cache/electron-builder
|
- rm -rf $HOME/.cache/electron-builder
|
||||||
|
before_install:
|
||||||
|
- rm -rf node_modules
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
except:
|
except:
|
||||||
|
|||||||
@ -11,10 +11,10 @@ init:
|
|||||||
- git config --global core.autocrlf input
|
- git config --global core.autocrlf input
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- ps: Install-Product node 8 x64
|
- ps: Install-Product node 10 x64
|
||||||
- npm install
|
- yarn
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- npm run release:win
|
- yarn run release:win
|
||||||
|
|
||||||
test: off
|
test: off
|
||||||
|
|||||||
17
index.js
17
index.js
@ -42,8 +42,10 @@ function createMainWindow() {
|
|||||||
backgroundColor: "#000",
|
backgroundColor: "#000",
|
||||||
show : false,
|
show : false,
|
||||||
webPreferences : {
|
webPreferences : {
|
||||||
nodeIntegration: false,
|
nodeIntegration : false,
|
||||||
preload : path.join(__dirname, "preload.js")
|
preload : path.join(__dirname, "preload.js"),
|
||||||
|
nativeWindowOpen: true, // window.open return Window object(like in regular browsers), not BrowserWindowProxy
|
||||||
|
affinity : "main-window" // main window, and addition windows should work in one process
|
||||||
},
|
},
|
||||||
frame : !is.macOS(),
|
frame : !is.macOS(),
|
||||||
titleBarStyle: is.macOS() ? "hiddenInset": "default"
|
titleBarStyle: is.macOS() ? "hiddenInset": "default"
|
||||||
@ -86,6 +88,17 @@ function createMainWindow() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
win.webContents.on(
|
||||||
|
"new-window",
|
||||||
|
(e, url, frameName, disposition, options) => {
|
||||||
|
// hook on new opened window
|
||||||
|
|
||||||
|
// at now new window in mainWindow renderer process.
|
||||||
|
// Also, this will automatically get an option `nodeIntegration=false`(not override to true, like in iframe's) - like in regular browsers
|
||||||
|
options.webPreferences.affinity = "main-window";
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
win.on("move", () => {
|
win.on("move", () => {
|
||||||
let position = win.getPosition();
|
let position = win.getPosition();
|
||||||
store.set("window-position", { x: position[0], y: position[1] });
|
store.set("window-position", { x: position[0], y: position[1] });
|
||||||
|
|||||||
7321
package-lock.json
generated
7321
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
75
package.json
75
package.json
@ -1,60 +1,65 @@
|
|||||||
{
|
{
|
||||||
"name" : "youtube-music",
|
"name": "youtube-music",
|
||||||
"productName": "YouTube Music",
|
"productName": "YouTube Music",
|
||||||
"version" : "1.1.5",
|
"version": "1.2.0",
|
||||||
"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",
|
||||||
"author" : {
|
"author": {
|
||||||
"name" : "th-ch",
|
"name": "th-ch",
|
||||||
"email": "th-ch@users.noreply.github.com",
|
"email": "th-ch@users.noreply.github.com",
|
||||||
"url" : "https://github.com/th-ch/youtube-music"
|
"url": "https://github.com/th-ch/youtube-music"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId" : "com.github.th-ch.youtube-music",
|
"appId": "com.github.th-ch.youtube-music",
|
||||||
"productName": "YouTube Music",
|
"productName": "YouTube Music",
|
||||||
"mac" : {
|
"mac": {
|
||||||
"identity": null,
|
"identity": null,
|
||||||
"icon" : "assets/generated/icons/mac/icon.icns"
|
"icon": "assets/generated/icons/mac/icon.icns"
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "assets/generated/icons/win/icon.ico"
|
"icon": "assets/generated/icons/win/icon.ico"
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"icon" : "assets/generated/icons/png",
|
"icon": "assets/generated/icons/png",
|
||||||
"category": "AudioVideo"
|
"category": "AudioVideo"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test" : "xo",
|
"test": "xo",
|
||||||
"start" : "electron .",
|
"start": "electron .",
|
||||||
"icon" : "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated",
|
"icon": "rimraf assets/generated && electron-icon-maker --input=assets/youtube-music.png --output=assets/generated",
|
||||||
"postinstall" : "npm run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
|
"generate:package": "node utils/generate-package-json.js",
|
||||||
"clean" : "rimraf dist",
|
"postinstall": "yarn run generate:package YoutubeNonStop && yarn run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
|
||||||
"build" : "npm run clean && build --win --mac --linux",
|
"clean": "rimraf dist",
|
||||||
"build:mac" : "npm run clean && build --mac",
|
"build": "yarn run clean && build --win --mac --linux",
|
||||||
"build:win" : "npm run clean && build --win",
|
"build:mac": "yarn run clean && build --mac",
|
||||||
"release:linux": "npm run clean && build --linux -p always",
|
"build:win": "yarn run clean && build --win",
|
||||||
"release:mac" : "npm run clean && build --mac -p always",
|
"release:linux": "yarn run clean && build --linux -p always",
|
||||||
"release:win" : "npm run clean && build --win -p always"
|
"release:mac": "yarn run clean && build --mac -p always",
|
||||||
|
"release:win": "yarn run clean && build --win -p always"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"npm": "Please use yarn and not npm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ad-block" : "^4.1.3",
|
"YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.7.1",
|
||||||
"electron-debug" : "^2.0.0",
|
"ad-block": "^4.1.3",
|
||||||
"electron-is" : "^3.0.0",
|
"electron-debug": "^2.2.0",
|
||||||
"electron-localshortcut": "^3.1.0",
|
"electron-is": "^3.0.0",
|
||||||
"electron-store" : "^2.0.0",
|
"electron-localshortcut": "^3.2.1",
|
||||||
"electron-updater" : "^4.0.6"
|
"electron-store": "^3.1.0",
|
||||||
|
"electron-updater": "^4.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"devtron" : "^1.4.0",
|
"devtron": "^1.4.0",
|
||||||
"electron" : "^4.0.8",
|
"electron": "^4.0.8",
|
||||||
"electron-builder" : "^20.40.2",
|
"electron-builder": "^20.40.2",
|
||||||
"electron-devtools-installer": "^2.2.4",
|
"electron-devtools-installer": "^2.2.4",
|
||||||
"electron-icon-maker" : "0.0.4",
|
"electron-icon-maker": "0.0.4",
|
||||||
"electron-rebuild" : "^1.8.4",
|
"electron-rebuild": "^1.8.4",
|
||||||
"rimraf" : "^2.6.3",
|
"rimraf": "^2.6.3",
|
||||||
"xo" : "^0.24.0"
|
"xo": "^0.24.0"
|
||||||
},
|
},
|
||||||
"xo": {
|
"xo": {
|
||||||
"envs": [
|
"envs": [
|
||||||
|
|||||||
12
plugins/auto-confirm-when-paused/front.js
Normal file
12
plugins/auto-confirm-when-paused/front.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
// Define global chrome object to be compliant with the extension code
|
||||||
|
global.chrome = {
|
||||||
|
runtime: {
|
||||||
|
getManifest: () => ({
|
||||||
|
version: 1
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = () => {
|
||||||
|
require("YoutubeNonStop/autoconfirm.js");
|
||||||
|
};
|
||||||
@ -1,9 +1,11 @@
|
|||||||
# YouTube Music
|
# YouTube Music
|
||||||
|
|
||||||
[](https://GitHub.com/th-ch/youtube-music/releases/)
|
[](https://GitHub.com/th-ch/youtube-music/releases/)
|
||||||
[](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
|
[](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
|
||||||
[](https://github.com/sindresorhus/xo)
|
[](https://github.com/sindresorhus/xo)
|
||||||
[](https://ci.appveyor.com/project/th-ch/youtube-music)
|
[](https://ci.appveyor.com/project/th-ch/youtube-music)
|
||||||
[](https://travis-ci.org/th-ch/youtube-music)
|
[](https://travis-ci.org/th-ch/youtube-music)
|
||||||
|
[](https://snyk.io/test/github/th-ch/youtube-music)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@ -22,14 +24,15 @@ You can check out the [latest release](https://github.com/th-ch/youtube-music/re
|
|||||||
- **No Google Login**: remove Google login buttons and links from the interface
|
- **No Google Login**: remove Google login buttons and links from the interface
|
||||||
- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music
|
- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music
|
||||||
- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser
|
- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser
|
||||||
|
- **Auto confirm when paused**: when the "Continue Watching?" modal appears, automatically click "Yes"
|
||||||
|
|
||||||
## Dev
|
## Dev
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/th-ch/youtube-music
|
git clone https://github.com/th-ch/youtube-music
|
||||||
cd youtube-music
|
cd youtube-music
|
||||||
npm install
|
yarn
|
||||||
npm start
|
yarn start
|
||||||
```
|
```
|
||||||
|
|
||||||
## Build your own plugins
|
## Build your own plugins
|
||||||
@ -80,7 +83,7 @@ module.exports = win => {
|
|||||||
// front.js
|
// front.js
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
// Remove the login button
|
// Remove the login button
|
||||||
document.querySelector('.sign-in-link.ytmusic-nav-bar').remove();
|
document.querySelector(".sign-in-link.ytmusic-nav-bar").remove();
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
34
utils/generate-package-json.js
Executable file
34
utils/generate-package-json.js
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const { existsSync, writeFile } = require("fs");
|
||||||
|
const { join } = require("path");
|
||||||
|
const { promisify } = require("util");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates a fake package.json for given packages that don't have any.
|
||||||
|
* Allows electron-builder to resolve them
|
||||||
|
*/
|
||||||
|
|
||||||
|
const generatePackageJson = async packageName => {
|
||||||
|
var filepath = join("node_modules", packageName, "package.json");
|
||||||
|
if (!existsSync(filepath)) {
|
||||||
|
console.log(
|
||||||
|
`No package.json found for ${packageName} module, generating one…`
|
||||||
|
);
|
||||||
|
pkg = {
|
||||||
|
name: packageName,
|
||||||
|
version: "0.0.0",
|
||||||
|
description: "-",
|
||||||
|
repository: { type: "git", url: "-" },
|
||||||
|
readme: "-"
|
||||||
|
};
|
||||||
|
const writeFileAsync = promisify(writeFile);
|
||||||
|
await writeFileAsync(filepath, JSON.stringify(pkg, null, 2));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (require.main === module) {
|
||||||
|
process.argv.slice(2).forEach(async packageName => {
|
||||||
|
await generatePackageJson(packageName);
|
||||||
|
});
|
||||||
|
}
|
||||||
@ -23,3 +23,8 @@ ytmusic-app-layout {
|
|||||||
ytmusic-search-box.ytmusic-nav-bar {
|
ytmusic-search-box.ytmusic-nav-bar {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Blocking annoying elements */
|
||||||
|
ytmusic-mealbar-promo-renderer {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user