Merge pull request #11 from th-ch/autoconfirm-when-paused

Plugin: autoconfirm when paused
This commit is contained in:
th-ch
2020-03-14 23:43:22 +01:00
committed by GitHub
10 changed files with 5271 additions and 7316 deletions

2
.npmrc Normal file
View File

@ -0,0 +1,2 @@
engine-strict=true
scripts-prepend-node-path=true

View File

@ -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:

View File

@ -12,9 +12,9 @@ init:
install: install:
- ps: Install-Product node 8 x64 - ps: Install-Product node 8 x64
- npm install - yarn
build_script: build_script:
- npm run release:win - yarn run release:win
test: off test: off

7301
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{ {
"name": "youtube-music", "name": "youtube-music",
"productName": "YouTube Music", "productName": "YouTube Music",
"version": "1.1.6", "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",
@ -29,16 +29,21 @@
"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",
"postinstall": "yarn run generate:package YoutubeNonStop && yarn run icon && npm rebuild && node plugins/adblocker/generator.js && electron-rebuild",
"clean": "rimraf dist", "clean": "rimraf dist",
"build": "npm run clean && build --win --mac --linux", "build": "yarn run clean && build --win --mac --linux",
"build:mac": "npm run clean && build --mac", "build:mac": "yarn run clean && build --mac",
"build:win": "npm run clean && build --win", "build:win": "yarn run clean && build --win",
"release:linux": "npm run clean && build --linux -p always", "release:linux": "yarn run clean && build --linux -p always",
"release:mac": "npm run clean && build --mac -p always", "release:mac": "yarn run clean && build --mac -p always",
"release:win": "npm run clean && build --win -p always" "release:win": "yarn run clean && build --win -p always"
},
"engines": {
"npm": "Please use yarn and not npm"
}, },
"dependencies": { "dependencies": {
"YoutubeNonStop": "git://github.com/lawfx/YoutubeNonStop.git#v0.7.1",
"ad-block": "^4.1.3", "ad-block": "^4.1.3",
"electron-debug": "^2.0.0", "electron-debug": "^2.0.0",
"electron-is": "^3.0.0", "electron-is": "^3.0.0",

View 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");
};

View File

@ -23,14 +23,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

34
utils/generate-package-json.js Executable file
View 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);
});
}

5195
yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@ -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;
}