mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +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
|
||||
|
||||
cache:
|
||||
yarn: false
|
||||
directories:
|
||||
- node_modules
|
||||
- $HOME/.cache/electron
|
||||
- $HOME/.cache/electron-builder
|
||||
|
||||
@ -30,13 +30,15 @@ script:
|
||||
-v ${PWD}:/project \
|
||||
-v ~/.cache/electron:/root/.cache/electron \
|
||||
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
|
||||
electronuserland/builder \
|
||||
/bin/bash -c "npm install && npm run release:linux"
|
||||
electronuserland/builder:10 \
|
||||
/bin/bash -c "yarn && npm run release:linux"
|
||||
else
|
||||
npm run release:mac
|
||||
fi
|
||||
before_cache:
|
||||
- rm -rf $HOME/.cache/electron-builder
|
||||
before_install:
|
||||
- rm -rf node_modules
|
||||
|
||||
branches:
|
||||
except:
|
||||
|
||||
@ -11,10 +11,10 @@ init:
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
install:
|
||||
- ps: Install-Product node 8 x64
|
||||
- npm install
|
||||
- ps: Install-Product node 10 x64
|
||||
- yarn
|
||||
|
||||
build_script:
|
||||
- npm run release:win
|
||||
- yarn run release:win
|
||||
|
||||
test: off
|
||||
|
||||
17
index.js
17
index.js
@ -42,8 +42,10 @@ function createMainWindow() {
|
||||
backgroundColor: "#000",
|
||||
show : false,
|
||||
webPreferences : {
|
||||
nodeIntegration: false,
|
||||
preload : path.join(__dirname, "preload.js")
|
||||
nodeIntegration : false,
|
||||
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(),
|
||||
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", () => {
|
||||
let position = win.getPosition();
|
||||
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",
|
||||
"version" : "1.1.5",
|
||||
"version": "1.2.0",
|
||||
"description": "YouTube Music Desktop App - including custom plugins",
|
||||
"license" : "MIT",
|
||||
"repository" : "th-ch/youtube-music",
|
||||
"author" : {
|
||||
"name" : "th-ch",
|
||||
"license": "MIT",
|
||||
"repository": "th-ch/youtube-music",
|
||||
"author": {
|
||||
"name": "th-ch",
|
||||
"email": "th-ch@users.noreply.github.com",
|
||||
"url" : "https://github.com/th-ch/youtube-music"
|
||||
"url": "https://github.com/th-ch/youtube-music"
|
||||
},
|
||||
"build": {
|
||||
"appId" : "com.github.th-ch.youtube-music",
|
||||
"appId": "com.github.th-ch.youtube-music",
|
||||
"productName": "YouTube Music",
|
||||
"mac" : {
|
||||
"mac": {
|
||||
"identity": null,
|
||||
"icon" : "assets/generated/icons/mac/icon.icns"
|
||||
"icon": "assets/generated/icons/mac/icon.icns"
|
||||
},
|
||||
"win": {
|
||||
"icon": "assets/generated/icons/win/icon.ico"
|
||||
},
|
||||
"linux": {
|
||||
"icon" : "assets/generated/icons/png",
|
||||
"icon": "assets/generated/icons/png",
|
||||
"category": "AudioVideo"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"test" : "xo",
|
||||
"start" : "electron .",
|
||||
"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",
|
||||
"clean" : "rimraf dist",
|
||||
"build" : "npm run clean && build --win --mac --linux",
|
||||
"build:mac" : "npm run clean && build --mac",
|
||||
"build:win" : "npm run clean && build --win",
|
||||
"release:linux": "npm run clean && build --linux -p always",
|
||||
"release:mac" : "npm run clean && build --mac -p always",
|
||||
"release:win" : "npm run clean && build --win -p always"
|
||||
"test": "xo",
|
||||
"start": "electron .",
|
||||
"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 generate:package YoutubeNonStop && yarn run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
|
||||
"clean": "rimraf dist",
|
||||
"build": "yarn run clean && build --win --mac --linux",
|
||||
"build:mac": "yarn run clean && build --mac",
|
||||
"build:win": "yarn run clean && build --win",
|
||||
"release:linux": "yarn run clean && build --linux -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": {
|
||||
"ad-block" : "^4.1.3",
|
||||
"electron-debug" : "^2.0.0",
|
||||
"electron-is" : "^3.0.0",
|
||||
"electron-localshortcut": "^3.1.0",
|
||||
"electron-store" : "^2.0.0",
|
||||
"electron-updater" : "^4.0.6"
|
||||
"YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.7.1",
|
||||
"ad-block": "^4.1.3",
|
||||
"electron-debug": "^2.2.0",
|
||||
"electron-is": "^3.0.0",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-store": "^3.1.0",
|
||||
"electron-updater": "^4.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"devtron" : "^1.4.0",
|
||||
"electron" : "^4.0.8",
|
||||
"electron-builder" : "^20.40.2",
|
||||
"devtron": "^1.4.0",
|
||||
"electron": "^4.0.8",
|
||||
"electron-builder": "^20.40.2",
|
||||
"electron-devtools-installer": "^2.2.4",
|
||||
"electron-icon-maker" : "0.0.4",
|
||||
"electron-rebuild" : "^1.8.4",
|
||||
"rimraf" : "^2.6.3",
|
||||
"xo" : "^0.24.0"
|
||||
"electron-icon-maker": "0.0.4",
|
||||
"electron-rebuild": "^1.8.4",
|
||||
"rimraf": "^2.6.3",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"xo": {
|
||||
"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
|
||||
|
||||
[](https://GitHub.com/th-ch/youtube-music/releases/)
|
||||
[](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
|
||||
[](https://github.com/sindresorhus/xo)
|
||||
[](https://ci.appveyor.com/project/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
|
||||
- **Shortcuts**: use your usual shortcuts (media keys, Ctrl/CMD + F…) to control YouTube Music
|
||||
- **Navigation**: next/back navigation arrows directly integrated in the interface, like in your favorite browser
|
||||
- **Auto confirm when paused**: when the "Continue Watching?" modal appears, automatically click "Yes"
|
||||
|
||||
## Dev
|
||||
|
||||
```sh
|
||||
git clone https://github.com/th-ch/youtube-music
|
||||
cd youtube-music
|
||||
npm install
|
||||
npm start
|
||||
yarn
|
||||
yarn start
|
||||
```
|
||||
|
||||
## Build your own plugins
|
||||
@ -80,7 +83,7 @@ module.exports = win => {
|
||||
// front.js
|
||||
module.exports = () => {
|
||||
// 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 {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
/* Blocking annoying elements */
|
||||
ytmusic-mealbar-promo-renderer {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user