mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 22c7f70c93 | |||
| 467171a17e | |||
| 3022facbea | |||
| a67bf5ea43 | |||
| 3a1a3d4241 | |||
| 9197f4a0e1 | |||
| d21220693b |
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "youtube-music",
|
||||
"productName": "YouTube Music",
|
||||
"version": "1.7.1",
|
||||
"version": "1.7.3",
|
||||
"description": "YouTube Music Desktop App - including custom plugins",
|
||||
"license": "MIT",
|
||||
"repository": "th-ch/youtube-music",
|
||||
|
||||
@ -3,5 +3,6 @@ module.exports = (win, options) =>
|
||||
loadAdBlockerEngine(
|
||||
win.webContents.session,
|
||||
options.cache,
|
||||
options.additionalBlockLists
|
||||
options.additionalBlockLists,
|
||||
options.disableDefaultLists
|
||||
);
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
const { existsSync, promises, unlinkSync } = require("fs"); // used for caching
|
||||
const { promises } = require("fs"); // used for caching
|
||||
const path = require("path");
|
||||
|
||||
const { ElectronBlocker } = require("@cliqz/adblocker-electron");
|
||||
@ -11,26 +11,24 @@ const SOURCES = [
|
||||
const loadAdBlockerEngine = (
|
||||
session = undefined,
|
||||
cache = true,
|
||||
additionalBlockLists = []
|
||||
additionalBlockLists = [],
|
||||
disableDefaultLists = false
|
||||
) => {
|
||||
const adBlockerCache = path.resolve(__dirname, "ad-blocker-engine.bin");
|
||||
if (!cache && existsSync(adBlockerCache)) {
|
||||
unlinkSync(adBlockerCache);
|
||||
}
|
||||
const cachingOptions = cache
|
||||
? {
|
||||
path: adBlockerCache,
|
||||
read: promises.readFile,
|
||||
write: promises.writeFile,
|
||||
}
|
||||
: undefined;
|
||||
// Only use cache if no additional blocklists are passed
|
||||
const cachingOptions =
|
||||
cache && additionalBlockLists.length === 0
|
||||
? {
|
||||
path: path.resolve(__dirname, "ad-blocker-engine.bin"),
|
||||
read: promises.readFile,
|
||||
write: promises.writeFile,
|
||||
}
|
||||
: undefined;
|
||||
const lists = [
|
||||
...(disableDefaultLists ? [] : SOURCES),
|
||||
...additionalBlockLists,
|
||||
];
|
||||
|
||||
ElectronBlocker.fromLists(
|
||||
fetch,
|
||||
[...SOURCES, ...additionalBlockLists],
|
||||
{},
|
||||
cachingOptions
|
||||
)
|
||||
ElectronBlocker.fromLists(fetch, lists, {}, cachingOptions)
|
||||
.then((blocker) => {
|
||||
if (session) {
|
||||
blocker.enableBlockingInSession(session);
|
||||
|
||||
19
readme.md
19
readme.md
@ -1,11 +1,16 @@
|
||||
# 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://GitHub.com/th-ch/youtube-music/releases/)
|
||||
[](https://snyk.io/test/github/th-ch/youtube-music)
|
||||

|
||||
<div align="center">
|
||||
|
||||
[](https://github.com/th-ch/youtube-music/releases/)
|
||||
[](https://github.com/th-ch/youtube-music/blob/master/LICENSE)
|
||||
[](https://github.com/sindresorhus/xo)
|
||||
[](https://GitHub.com/th-ch/youtube-music/releases/)
|
||||
[](https://snyk.io/test/github/th-ch/youtube-music)
|
||||
[](https://GitHub.com/th-ch/youtube-music/releases/)
|
||||
[](https://aur.archlinux.org/packages/youtube-music-bin)
|
||||
|
||||
</div>
|
||||
|
||||

|
||||
|
||||
@ -18,7 +23,7 @@
|
||||
|
||||
You can check out the [latest release](https://github.com/th-ch/youtube-music/releases/latest) to quickly find the latest version.
|
||||
|
||||
**Arch Linux**
|
||||
### 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).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user