2023-04-02 01:44:32 +00:00
|
|
|
#!/bin/bash
|
|
|
|
pushd "${BASH_SOURCE%/*}" > /dev/null;
|
|
|
|
|
2023-04-04 01:04:42 +00:00
|
|
|
BROWSER_BIN="${BROWSER_BIN}";
|
2023-04-02 01:44:32 +00:00
|
|
|
EXTENSION_DIR="${EXTENSION_DIR}";
|
|
|
|
EXTENSION_POLICY_DIR="${EXTENSION_POLICY_DIR}";
|
|
|
|
|
|
|
|
archiveName="$(mktemp)";
|
|
|
|
extensionDir="$(mktemp -d)";
|
|
|
|
manifestFile="$extensionDir/manifest.json";
|
|
|
|
chmod a+rwx "$extensionDir";
|
|
|
|
# Download `youtube-music-dl`
|
2024-07-17 14:41:42 +00:00
|
|
|
wget https://github.com/dougppaz/youtube-music-dl/releases/download/v1.2.1/youtube-music-dl.zip -O "$archiveName" > /dev/null 2>&1;
|
2023-04-02 01:44:32 +00:00
|
|
|
|
|
|
|
# Prepare extension
|
|
|
|
mkdir -p "$extensionDir";
|
2023-04-02 22:18:50 +00:00
|
|
|
unzip "$archiveName" -d "$extensionDir";
|
2023-04-02 01:44:32 +00:00
|
|
|
rm "$archiveName";
|
|
|
|
|
|
|
|
# Tamper manifest file
|
2023-04-02 22:21:39 +00:00
|
|
|
manifest="$(cat "$manifestFile" | jq ".background.persistent = false")";
|
2023-04-02 01:44:32 +00:00
|
|
|
echo "$manifest" > "$manifestFile";
|
|
|
|
|
2023-04-04 01:04:42 +00:00
|
|
|
BROWSER_BIN="${BROWSER_BIN}" \
|
2023-04-02 01:44:32 +00:00
|
|
|
EXTENSION_NAME="youtube-music-dl" \
|
|
|
|
UNPACKED_EXTENSION="$extensionDir" \
|
|
|
|
EXTENSION_DIR="${EXTENSION_DIR}" \
|
|
|
|
EXTENSION_POLICY_DIR="${EXTENSION_POLICY_DIR}" \
|
|
|
|
. ./install-extension.sh;
|
|
|
|
|
|
|
|
rm -rf "$extensionDir";
|
|
|
|
|
|
|
|
popd > /dev/null;
|