Compare commits
312 Commits
d87049b00e
...
toto-patch
Author | SHA1 | Date | |
---|---|---|---|
346fae4f53 | |||
82df1c9412 | |||
688d87bb66 | |||
74a695d65c | |||
c267d62e62 | |||
386c58e40b | |||
4c7b6a2bd7 | |||
4940fee1cc | |||
c5ee1be726 | |||
7f7dfd1838 | |||
af4106b1f6 | |||
d9629d8817 | |||
e52e16df93 | |||
8d868cfeb5 | |||
4093afc78d | |||
d6023ef851 | |||
4259f74718 | |||
46a3a8722b | |||
3c6d970681 | |||
f11ed91101 | |||
b812d7f769 | |||
62fa973e4e | |||
be538f720d | |||
ea33b5cd95 | |||
80354312f6 | |||
e359be76a5 | |||
a9aa5070fc | |||
f40ce88f64 | |||
1285b8b659 | |||
ef31ea82be | |||
9f459ad8fe | |||
9a134d0118 | |||
88bebb510e | |||
43f47b8fbf | |||
a0a69b31b6 | |||
d0bb8252a6 | |||
2412b203ed | |||
0f0f2b2a47 | |||
fb153caa2b | |||
ea380d551c | |||
46b0987e86 | |||
fb6760ec63 | |||
28eb756ab0 | |||
046b5bcd42 | |||
119c56656c | |||
c8eca5736e | |||
6fb044e248 | |||
d88a51819a | |||
f96f299e97 | |||
48b5c5336a | |||
5d5d3be702 | |||
983fcc3d6b | |||
ebe9dd0e72 | |||
16b9e2cfbb | |||
b29617d025 | |||
96c8de2a0e | |||
929caae93f | |||
bb32617942 | |||
e0bddb9890 | |||
b319a77da2 | |||
f25e85fb52 | |||
f4638be665 | |||
414b7f4ab4 | |||
35a34a0803 | |||
a3602f3b28 | |||
26f4f29ea8 | |||
b392fd8cb3 | |||
af2731bc03 | |||
cde63519b6 | |||
8036adcfbe | |||
eb271bd389 | |||
7b7dc31eff | |||
fb947ffb57 | |||
1bc733b55a | |||
20a0e336b7 | |||
25c58cb3f5 | |||
5a508512a4 | |||
b25529d138 | |||
5a7735c239 | |||
bf06049b39 | |||
3d9d87a0cd | |||
b7001253d6 | |||
67d5be43b2 | |||
6cd9841d43 | |||
bb2fe2c071 | |||
c4e7f82288 | |||
75ef373a2f | |||
a67742218f | |||
abf19161d1 | |||
1b011dbf12 | |||
638b0ac112 | |||
f83080ff3a | |||
b7ede595e7 | |||
69cf57b887 | |||
ed9a329c52 | |||
f597da21dc | |||
3bc02d539d | |||
1d75372fa7 | |||
35fa1471c4 | |||
730deb5302 | |||
d85a99e873 | |||
f440b27dc9 | |||
1a10780e39 | |||
f0345169c5 | |||
6319e62015 | |||
19475e0885 | |||
ef36fff425 | |||
b9671b13c1 | |||
67a7dc73f6 | |||
e3e389945e | |||
467c01d373 | |||
3e07a97bc1 | |||
eaf54cbff3 | |||
a4c57b9843 | |||
9a02669c63 | |||
60ced590d3 | |||
2d72e43b10 | |||
b81bdf5fc0 | |||
00f8aee210 | |||
61c2ee798f | |||
6cdfcd5d57 | |||
8ee69bc47e | |||
754ea8f0fc | |||
8bac70b01d | |||
e35dc5d3e8 | |||
2fd314e116 | |||
82d2a8a0eb | |||
38b758f9fe | |||
797e2bf7c1 | |||
fb94cfbaa7 | |||
61c180842b | |||
09c3609e26 | |||
3eacf27648 | |||
9e5e330de3 | |||
18bdac085a | |||
754513f84f | |||
ece28454a6 | |||
fa3eded8a4 | |||
b25ac295f1 | |||
70719b2565 | |||
1142557c48 | |||
211034223d | |||
062af284c7 | |||
76f2bbe397 | |||
bdd99c4d51 | |||
8b580d6d68 | |||
b6f8a75423 | |||
f24db8987c | |||
c81bb51b4d | |||
57df1efb58 | |||
dc81a1fb89 | |||
f2f9be4a3b | |||
d945017846 | |||
9d3d9a8e81 | |||
355c7cc971 | |||
0ab51e8a64 | |||
3dc76791e7 | |||
c8dbc44dcc | |||
d8cb84f500 | |||
7ce9c5ce0a | |||
b573f7825a | |||
7f0701fd24 | |||
003e593c26 | |||
e2980e86df | |||
e658ccf77e | |||
45f28f2a6a | |||
d2eabf8e6b | |||
20acc6396c | |||
7e0871fd81 | |||
75cea0816b | |||
fffb1c9ebd | |||
4040616434 | |||
b9f916ab8f | |||
9df7494065 | |||
9573bdcf50 | |||
7e46e4567a | |||
7bc3cb83a3 | |||
dd816e4bb8 | |||
e69054aa41 | |||
e937406894 | |||
db666639cc | |||
146d64bbee | |||
4e4b41a29d | |||
f0b601d05f | |||
62f2b50e98 | |||
2a17a45848 | |||
59b579ffaa | |||
56b28966be | |||
73173839b6 | |||
0789cbdcd9 | |||
20a5907a4c | |||
562d9bae8d | |||
33253d1aaa | |||
5dcea1e2cc | |||
f15c31c1e0 | |||
afe9e12e1e | |||
b9f5673264 | |||
838d47be34 | |||
47b210d303 | |||
d203ab5057 | |||
94e6ce94f2 | |||
0e3511079e | |||
7cc7e5e27d | |||
15db722412 | |||
12499be20c | |||
cd01f7dda3 | |||
7bfd202a33 | |||
ab4faec5a3 | |||
4acada0cc6 | |||
8844715dcf | |||
ed61d93c94 | |||
02c473c473 | |||
8fa0625898 | |||
01a7611920 | |||
4b862a771e | |||
6327fba1dc | |||
cf5513d883 | |||
4cba029878 | |||
042c85e42e | |||
eada25f6f7 | |||
49e9b65609 | |||
c8c35d6d20 | |||
3e303de96f | |||
f3fa8becbe | |||
32ebed0d43 | |||
99b6a39722 | |||
02dec00a69 | |||
ac8cd59101 | |||
e0a4addb11 | |||
e77af37dcf | |||
aa41880a90 | |||
af2358621d | |||
5176b820b5 | |||
39f11412b8 | |||
2917affb34 | |||
a5fb88848b | |||
439c39361d | |||
44e5f1deef | |||
cf5093b830 | |||
b70fcff128 | |||
28ba6ac8d4 | |||
5d84b40b26 | |||
7a861c7e8b | |||
2e4258f015 | |||
ebc7b1202a | |||
fd7721aad1 | |||
f6a994544d | |||
0150391690 | |||
b50deea343 | |||
c542418747 | |||
ccd946c2c7 | |||
8f4bd088c2 | |||
bb627645a5 | |||
8cc5b39cd6 | |||
3116abd4bb | |||
8dbc5191a5 | |||
a3d941caac | |||
11582415bd | |||
7908c218fa | |||
e1693ee5d8 | |||
a21b66044c | |||
8fd6c4530a | |||
e46735ab4d | |||
972a730365 | |||
697b255efc | |||
6da3a06714 | |||
066800178a | |||
440cc9cb49 | |||
52c2ec03da | |||
aa1bf4f3e2 | |||
00c4e87f69 | |||
1c57928338 | |||
e81ec2841b | |||
03ef92ed73 | |||
09a6fc1f5c | |||
c952ffdcdc | |||
4fbcc99007 | |||
287e4ced3e | |||
0b75ab8c7c | |||
5096f50333 | |||
d45f2a32d7 | |||
74f21e2d03 | |||
47a1a783bc | |||
96de161307 | |||
f60f050150 | |||
2fc5f2d690 | |||
075a78252f | |||
be26ea5be3 | |||
ef9f185bdc | |||
000fb9f606 | |||
4bc07cd4a8 | |||
f9786d7a6d | |||
9c82570b8f | |||
d232951b96 | |||
8ccf9db1f7 | |||
e113ba745d | |||
84f8b58c83 | |||
9ecc7e11e1 | |||
7eb2a29b97 | |||
e50e9caa46 | |||
c32a185150 | |||
6c5071add5 | |||
5816a523fb | |||
681fdb0bd1 | |||
9465ad324c | |||
90e1921825 | |||
af5d535fe7 | |||
fa000e0b57 | |||
d664e71461 | |||
5152f1d945 | |||
abdc241f48 | |||
7b885db868 |
11
Conversion FLAC vers MP3/flac_to_mp3.sh
Normal file
@ -0,0 +1,11 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-26
|
||||
##
|
||||
## Pour une aide à l'installation, consulter le README
|
||||
##
|
||||
#!/bin/bash
|
||||
|
||||
while read FILE ; do
|
||||
[[ -e ${FILE%%.*}.mp3 ]] || ffmpeg -i "$FILE" -ab 320k -map_metadata 0 "${FILE%.*}.mp3"
|
||||
[[ $? -eq 0 ]] && rm $FILE
|
||||
done < <(find . -name "*.flac")
|
6
Conversion FLAC vers MP3/readme.md
Normal file
@ -0,0 +1,6 @@
|
||||
Conversion FLAC vers MP3
|
||||
========
|
||||
|
||||
Ce script permet la conversion de vos flacs en MP3 320kbps de manière automatique.
|
||||
|
||||
ATTENTION : Les fichiers flacs sont supprimées quand la conversion à réussie.
|
8
Plex Bot Music/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Plex Bot Music
|
||||
|
||||
**Plex Bot Music est un bot écrit en Python. Il vous permettra d'écouter votre musique sur Discord au travers d'un bot, tel que Rythme mais vous serez limité à votre Bibliothèque**
|
||||
|
||||
|
||||
## Lien vers le répértoire
|
||||
|
||||
https://gitea.zoz-serv.org/gigidsss/Plex-Bot-Music
|
76
Plex Discord Activity/README.md
Normal file
@ -0,0 +1,76 @@
|
||||
# Plex Discord Activity
|
||||
|
||||
**Plex Discord Activity est un logiciel en Python. Il a été récuperé déjà depuis le dépot d'un utilisateur GitHub mais a été simplifié de sorte a ce que la pré-configuration soit la plus simple possible**
|
||||
|
||||
Il y a eu peu de modifications par rapport à l'original, mais elles vous simplifient grandement la vie.
|
||||
|
||||
## Attention
|
||||
|
||||
Sachez que pour que le script fonctionne, il faut qu'il tourne sur le même PC que votre application Discord. Malheureusement faire tourner ce script sur un serveur en tâche de fond ne donnera aucun résultat...
|
||||
|
||||
## Installation
|
||||
|
||||
Pour cela, commencez déjà par installer Python3 sur votre ordinateur si cela n'est pas déjà fait...
|
||||
|
||||
Ensuite installez ces 2 bibliothèques Python via pip3:
|
||||
|
||||
```bash
|
||||
pip3 install plexapi
|
||||
pip3 install websocket-client==0.48.0
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
Éditez le document pma.py et éditez ce paragraphe seulement:
|
||||
```python
|
||||
### SEULEMENT CE QUE VOUS DEVEZ EDITER
|
||||
|
||||
MyDomain = "https://your.plex.dns:32400" #Soit via votre nom de domaine, soit via le domaine de Plex, c'est à dire, https://app.plex.tv
|
||||
Serveur = "MyPlex" #Le nom de votre Serveur Plex, visible dans Paramètres > Général > Nom d'usage
|
||||
NomUser = "username" #Le nom d'utilisateur Plex pour récupérer les métadonnées et les informations de lecture en temps réel
|
||||
MotDePasse = "password" #Votre mot de passe de votre compte Plex
|
||||
MonToken = "your_token" #Votre Token, accessible a la fin de l'url lorsque vous consultez le fichier XML de l'un de vos médias
|
||||
BlackList = ["Musique", "BackingTracks"] #séparée par des virgules avec espace, entourées par des "", entrent 2 balises [], ex: ["bib1", "bib2"]
|
||||
UserOnly = "username" #Si vous avez crée des utilisateurs gérés, pour éviter de partager l'état de lecture d'un autre utilisateur que vous-même, précisez le psuedo du bon utilisateur a priori le même que le 3ème paramètre que vous...
|
||||
InfosSupp = "true" #Ceci partage les métadonnées de votre épisode si c'est sur True, sinon mettez False pour n'afficher que l'état de lecture
|
||||
TempsRestant = "true" #True = Afficher le temps restant de lecture / False = Afficher le nombre de minutes que vous avez déjà consulté depuis le démarrage de l'épisode
|
||||
|
||||
### END DE CE QUE VOUS DEVEZ EDITER
|
||||
```
|
||||
|
||||
Voici un résumé des paramètres:
|
||||
|
||||
**Attention a ne pas supprimer des guillemets ou des crochets... Si vous ne voulez pas préciser de valeur, laissez les guillemets vides ou indiquez-y ``none`` !**
|
||||
|
||||
**Serveur**: C'est le nom de votre serveur Plex. Vous le trouverez dans ``Paramètres > Général > Nom d'usage``
|
||||
|
||||
**NomUser**: Votre nom d'utilisateur Plex associé à votre compte.
|
||||
|
||||
**MotDePasse**: Votre mot de passe de l'utilisateur Plex associé à votre compte.
|
||||
|
||||
**MonToken**: Token que vous pouvez obtenir en consultant le fichier XML d'un de vos média. Allez sur un épisode ou film précis, allez dans ``Voir informations`` puis ``Voir le XML``. Ensuite regardez à la fin de votre URL, vous devriez avoir: **Plex-Token=0x0x0xx0x00xx0x0**
|
||||
|
||||
**BlackList**: Vous pouvez décider de ne pas partager sur Discord les médias d'une bibliothèque définie, indiquez-y entre guillemets et eux-même entre crochets, le nom des Bibliothèques.
|
||||
Exemple:
|
||||
```python
|
||||
BlackList = ["Musique", "BackingTracks"]
|
||||
```
|
||||
**UserOnly**: Si vous avez crée des utilisateurs gérés, pour éviter de partager l'état de lecture d'un autre utilisateur que vous-même, précisez le psuedo du bon utilisateur qui à priori est le même que celui du paramètre ``username``...
|
||||
|
||||
**InfosSupp**: Vous permet de partager davantage d'infos sur le média, à savoir les métadonnées, etc. (Réponse: True / False)
|
||||
|
||||
**TempsRestant**: Vous permet de préciser si vous voulez indiquer le temps restant du média ou la position actuelle (Réponse: True (Il reste 05:00 minutes) / False (Vous êtes à 15:00 minutes sur 20:00 minutes))
|
||||
|
||||
## Utilisation
|
||||
|
||||
```
|
||||
python3 pma.py
|
||||
```
|
||||
*Patientez +/- 20 secondes pour que le script démarre... Le script lancera tout seul la page web Plex*
|
||||
|
||||
## Source
|
||||
https://github.com/Phineas05/discord-rich-presence-plex
|
||||
|
||||
|
||||
## License
|
||||
[MIT](https://choosealicense.com/licenses/mit/)
|
413
Plex Discord Activity/pda.py
Normal file
@ -0,0 +1,413 @@
|
||||
import asyncio
|
||||
import datetime
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import plexapi.myplex
|
||||
import struct
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import webbrowser
|
||||
|
||||
### SEULEMENT CE QUE VOUS DEVEZ EDITER
|
||||
|
||||
MyDomain = "https://your.plex.dns:32400" #Soit via votre nom de domaine, soit via le domaine de Plex, c'est à dire, https://app.plex.tv
|
||||
Serveur = "MyPlex" #Le nom de votre Serveur Plex, visible dans Paramètres > Général > Nom d'usage
|
||||
NomUser = "username" #Le nom d'utilisateur Plex pour récupérer les métadonnées et les informations de lecture en temps réel
|
||||
MotDePasse = "password" #Votre mot de passe de votre compte Plex
|
||||
MonToken = "your_token" #Votre Token, accessible a la fin de l'url lorsque vous consultez le fichier XML de l'un de vos médias
|
||||
BlackList = ["Musique", "BackingTracks"] #séparée par des virgules avec espace, entourées par des "", entrent 2 balises [], ex: ["bib1", "bib2"]
|
||||
UserOnly = "username" #Si vous avez crée des utilisateurs gérés, pour éviter de partager l'état de lecture d'un autre utilisateur que vous-même, précisez le psuedo du bon utilisateur a priori le même que le 3ème paramètre que vous...
|
||||
InfosSupp = "true" #Ceci partage les métadonnées de votre épisode si c'est sur True, sinon mettez False pour n'afficher que l'état de lecture
|
||||
TempsRestant = "true" #True = Afficher le temps restant de lecture / False = Afficher le nombre de minutes que vous avez déjà consulté depuis le démarrage de l'épisode
|
||||
|
||||
### END DE CE QUE VOUS DEVEZ EDITER
|
||||
|
||||
webbrowser.open(MyDomain)
|
||||
|
||||
class plexConfig:
|
||||
|
||||
extraLogging = (InfosSupp)
|
||||
timeRemaining = (TempsRestant)
|
||||
|
||||
def __init__(self, serverName = "", username = "", password = "", token = "", listenForUser = "", blacklistedLibraries = None, whitelistedLibraries = None, clientID = "413407336082833418"):
|
||||
self.serverName = serverName
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.token = token
|
||||
self.listenForUser = (username if listenForUser == "" else listenForUser).lower()
|
||||
self.blacklistedLibraries = blacklistedLibraries
|
||||
self.whitelistedLibraries = whitelistedLibraries
|
||||
self.clientID = clientID
|
||||
|
||||
plexConfigs = [
|
||||
plexConfig(serverName = (Serveur), username = (NomUser), password = (MotDePasse), token = (MonToken), blacklistedLibraries = (BlackList), listenForUser = (UserOnly))
|
||||
]
|
||||
|
||||
class discordRichPresence:
|
||||
|
||||
def __init__(self, clientID, child):
|
||||
self.IPCPipe = ((os.environ.get("XDG_RUNTIME_DIR", None) or os.environ.get("TMPDIR", None) or os.environ.get("TMP", None) or os.environ.get("TEMP", None) or "/tmp") + "/discord-ipc-0") if isLinux else "\\\\?\\pipe\\discord-ipc-0"
|
||||
self.clientID = clientID
|
||||
self.pipeReader = None
|
||||
self.pipeWriter = None
|
||||
self.process = None
|
||||
self.running = False
|
||||
self.child = child
|
||||
|
||||
async def read(self):
|
||||
try:
|
||||
data = await self.pipeReader.read(1024)
|
||||
self.child.log("[READ] " + str(json.loads(data[8:].decode("utf-8"))))
|
||||
except Exception as e:
|
||||
self.child.log("[READ] " + str(e))
|
||||
self.stop()
|
||||
|
||||
def write(self, op, payload):
|
||||
payload = json.dumps(payload)
|
||||
self.child.log("[WRITE] " + str(payload))
|
||||
data = self.pipeWriter.write(struct.pack("<ii", op, len(payload)) + payload.encode("utf-8"))
|
||||
|
||||
async def handshake(self):
|
||||
try:
|
||||
if (isLinux):
|
||||
self.pipeReader, self.pipeWriter = await asyncio.open_unix_connection(self.IPCPipe, loop = self.loop)
|
||||
else:
|
||||
self.pipeReader = asyncio.StreamReader(loop = self.loop)
|
||||
self.pipeWriter, _ = await self.loop.create_pipe_connection(lambda: asyncio.StreamReaderProtocol(self.pipeReader, loop = self.loop), self.IPCPipe)
|
||||
self.write(0, {"v": 1, "client_id": self.clientID})
|
||||
await self.read()
|
||||
self.running = True
|
||||
except Exception as e:
|
||||
self.child.log("[HANDSHAKE] " + str(e))
|
||||
|
||||
def start(self):
|
||||
self.child.log("Opening Discord IPC Pipe")
|
||||
emptyProcessFilePath = tempfile.gettempdir() + ("/" if isLinux else "\\") + "discordRichPresencePlex-emptyProcess.py"
|
||||
if (not os.path.exists(emptyProcessFilePath)):
|
||||
with open(emptyProcessFilePath, "w") as emptyProcessFile:
|
||||
emptyProcessFile.write("import time\n\ntry:\n\twhile (True):\n\t\ttime.sleep(3600)\nexcept:\n\tpass")
|
||||
self.process = subprocess.Popen(["python3" if isLinux else "pythonw", emptyProcessFilePath])
|
||||
self.loop = asyncio.new_event_loop() if isLinux else asyncio.ProactorEventLoop()
|
||||
self.loop.run_until_complete(self.handshake())
|
||||
|
||||
def stop(self):
|
||||
self.child.log("Closing Discord IPC Pipe")
|
||||
self.child.lastState, self.child.lastSessionKey, self.child.lastRatingKey = None, None, None
|
||||
self.process.kill()
|
||||
if (self.child.stopTimer):
|
||||
self.child.stopTimer.cancel()
|
||||
self.child.stopTimer = None
|
||||
if (self.child.stopTimer2):
|
||||
self.child.stopTimer2.cancel()
|
||||
self.child.stopTimer2 = None
|
||||
if (self.pipeWriter):
|
||||
try:
|
||||
self.pipeWriter.close()
|
||||
except:
|
||||
pass
|
||||
self.pipeWriter = None
|
||||
if (self.pipeReader):
|
||||
try:
|
||||
self.loop.run_until_complete(self.pipeReader.read(1024))
|
||||
except:
|
||||
pass
|
||||
self.pipeReader = None
|
||||
try:
|
||||
self.loop.close()
|
||||
except:
|
||||
pass
|
||||
self.running = False
|
||||
|
||||
def send(self, activity):
|
||||
payload = {
|
||||
"cmd": "SET_ACTIVITY",
|
||||
"args": {
|
||||
"activity": activity,
|
||||
"pid": self.process.pid
|
||||
},
|
||||
"nonce": "{0:.20f}".format(time.time())
|
||||
}
|
||||
self.write(1, payload)
|
||||
self.loop.run_until_complete(self.read())
|
||||
|
||||
class discordRichPresencePlex(discordRichPresence):
|
||||
|
||||
productName = "Plex Media Server"
|
||||
stopTimerInterval = 5
|
||||
stopTimer2Interval = 35
|
||||
checkConnectionTimerInterval = 60
|
||||
maximumIgnores = 3
|
||||
|
||||
def __init__(self, plexConfig):
|
||||
self.plexConfig = plexConfig
|
||||
self.instanceID = hashlib.md5(str(id(self)).encode("UTF-8")).hexdigest()[:5]
|
||||
super().__init__(plexConfig.clientID, self)
|
||||
self.plexAccount = None
|
||||
self.plexServer = None
|
||||
self.isServerOwner = False
|
||||
self.plexAlertListener = None
|
||||
self.lastState = None
|
||||
self.lastSessionKey = None
|
||||
self.lastRatingKey = None
|
||||
self.stopTimer = None
|
||||
self.stopTimer2 = None
|
||||
self.checkConnectionTimer = None
|
||||
self.ignoreCount = 0
|
||||
|
||||
def run(self):
|
||||
self.reset()
|
||||
connected = False
|
||||
while (not connected):
|
||||
try:
|
||||
if (self.plexConfig.token):
|
||||
self.plexAccount = plexapi.myplex.MyPlexAccount(self.plexConfig.username, token = self.plexConfig.token)
|
||||
else:
|
||||
self.plexAccount = plexapi.myplex.MyPlexAccount(self.plexConfig.username, self.plexConfig.password)
|
||||
self.log("Logged in as Plex User \"" + self.plexAccount.username + "\"")
|
||||
self.plexServer = None
|
||||
for resource in self.plexAccount.resources():
|
||||
if (resource.product == self.productName and resource.name == self.plexConfig.serverName):
|
||||
self.plexServer = resource.connect()
|
||||
try:
|
||||
self.plexServer.account()
|
||||
self.isServerOwner = True
|
||||
except:
|
||||
pass
|
||||
self.log("Connected to " + self.productName + " \"" + self.plexConfig.serverName + "\"")
|
||||
self.plexAlertListener = self.plexServer.startAlertListener(self.onPlexServerAlert)
|
||||
self.log("Listening for PlaySessionStateNotification alerts from user \"" + self.plexConfig.listenForUser + "\"")
|
||||
if (self.checkConnectionTimer):
|
||||
self.checkConnectionTimer.cancel()
|
||||
self.checkConnectionTimer = None
|
||||
self.checkConnectionTimer = threading.Timer(self.checkConnectionTimerInterval, self.checkConnection)
|
||||
self.checkConnectionTimer.start()
|
||||
connected = True
|
||||
break
|
||||
if (not self.plexServer):
|
||||
self.log(self.productName + " \"" + self.plexConfig.serverName + "\" not found")
|
||||
break
|
||||
except Exception as e:
|
||||
self.log("Failed to connect to Plex: " + str(e))
|
||||
self.log("Reconnecting in 10 seconds")
|
||||
time.sleep(10)
|
||||
|
||||
def reset(self):
|
||||
if (self.running):
|
||||
self.stop()
|
||||
self.plexAccount, self.plexServer = None, None
|
||||
if (self.plexAlertListener):
|
||||
try:
|
||||
self.plexAlertListener.stop()
|
||||
except:
|
||||
pass
|
||||
self.plexAlertListener = None
|
||||
if (self.stopTimer):
|
||||
self.stopTimer.cancel()
|
||||
self.stopTimer = None
|
||||
if (self.stopTimer2):
|
||||
self.stopTimer2.cancel()
|
||||
self.stopTimer2 = None
|
||||
if (self.checkConnectionTimer):
|
||||
self.checkConnectionTimer.cancel()
|
||||
self.checkConnectionTimer = None
|
||||
|
||||
def checkConnection(self):
|
||||
try:
|
||||
self.log("Request for clients list to check connection: " + str(self.plexServer.clients()), extra = True)
|
||||
self.checkConnectionTimer = threading.Timer(self.checkConnectionTimerInterval, self.checkConnection)
|
||||
self.checkConnectionTimer.start()
|
||||
except Exception as e:
|
||||
self.log("Connection to Plex lost: " + str(e))
|
||||
self.log("Reconnecting")
|
||||
self.run()
|
||||
|
||||
def log(self, text, colour = "", extra = False):
|
||||
timestamp = datetime.datetime.now().strftime("%I:%M:%S %p")
|
||||
prefix = "[" + timestamp + "] [" + self.plexConfig.serverName + "/" + self.instanceID + "] "
|
||||
lock.acquire()
|
||||
if (extra):
|
||||
if (self.plexConfig.extraLogging):
|
||||
print(prefix + colourText(str(text), colour))
|
||||
else:
|
||||
print(prefix + colourText(str(text), colour))
|
||||
lock.release()
|
||||
|
||||
def onPlexServerAlert(self, data):
|
||||
if (not self.plexServer):
|
||||
return
|
||||
try:
|
||||
if (data["type"] == "playing" and "PlaySessionStateNotification" in data):
|
||||
sessionData = data["PlaySessionStateNotification"][0]
|
||||
state = sessionData["state"]
|
||||
sessionKey = int(sessionData["sessionKey"])
|
||||
ratingKey = int(sessionData["ratingKey"])
|
||||
viewOffset = int(sessionData["viewOffset"])
|
||||
self.log("Received Update: " + colourText(sessionData, "yellow").replace("'", "\""), extra = True)
|
||||
metadata = self.plexServer.fetchItem(ratingKey)
|
||||
libraryName = metadata.section().title
|
||||
if (isinstance(self.plexConfig.blacklistedLibraries, list)):
|
||||
if (libraryName in self.plexConfig.blacklistedLibraries):
|
||||
self.log("Library \"" + libraryName + "\" is blacklisted, ignoring", "yellow", True)
|
||||
return
|
||||
if (isinstance(self.plexConfig.whitelistedLibraries, list)):
|
||||
if (libraryName not in self.plexConfig.whitelistedLibraries):
|
||||
self.log("Library \"" + libraryName + "\" is not whitelisted, ignoring", "yellow", True)
|
||||
return
|
||||
if (self.lastSessionKey == sessionKey and self.lastRatingKey == ratingKey):
|
||||
if (self.stopTimer2):
|
||||
self.stopTimer2.cancel()
|
||||
self.stopTimer2 = None
|
||||
if (self.lastState == state):
|
||||
if (self.ignoreCount == self.maximumIgnores):
|
||||
self.ignoreCount = 0
|
||||
else:
|
||||
self.log("Nothing changed, ignoring", "yellow", True)
|
||||
self.ignoreCount += 1
|
||||
self.stopTimer2 = threading.Timer(self.stopTimer2Interval, self.stopOnNoUpdate)
|
||||
self.stopTimer2.start()
|
||||
return
|
||||
elif (state == "stopped"):
|
||||
self.lastState, self.lastSessionKey, self.lastRatingKey = None, None, None
|
||||
self.stopTimer = threading.Timer(self.stopTimerInterval, self.stop)
|
||||
self.stopTimer.start()
|
||||
self.log("Started stopTimer", "yellow", True)
|
||||
return
|
||||
elif (state == "stopped"):
|
||||
self.log("\"stopped\" state update from unknown session key, ignoring", "yellow", True)
|
||||
return
|
||||
if (self.isServerOwner):
|
||||
self.log("Checking Sessions for Session Key " + colourText(sessionKey, "yellow"), extra = True)
|
||||
plexServerSessions = self.plexServer.sessions()
|
||||
if (len(plexServerSessions) < 1):
|
||||
self.log("Empty session list, ignoring", "red", True)
|
||||
return
|
||||
for session in plexServerSessions:
|
||||
self.log(str(session) + ", Session Key: " + colourText(session.sessionKey, "yellow") + ", Users: " + colourText(session.usernames, "yellow").replace("'", "\""), extra = True)
|
||||
sessionFound = False
|
||||
if (session.sessionKey == sessionKey):
|
||||
sessionFound = True
|
||||
self.log("Session found", "green", True)
|
||||
if (session.usernames[0].lower() == self.plexConfig.listenForUser):
|
||||
self.log("Username \"" + session.usernames[0].lower() + "\" matches \"" + self.plexConfig.listenForUser + "\", continuing", "green", True)
|
||||
break
|
||||
else:
|
||||
self.log("Username \"" + session.usernames[0].lower() + "\" doesn't match \"" + self.plexConfig.listenForUser + "\", ignoring", "red", True)
|
||||
return
|
||||
if (not sessionFound):
|
||||
self.log("No matching session found", "red", True)
|
||||
return
|
||||
if (self.stopTimer):
|
||||
self.stopTimer.cancel()
|
||||
self.stopTimer = None
|
||||
if (self.stopTimer2):
|
||||
self.stopTimer2.cancel()
|
||||
self.stopTimer2 = threading.Timer(self.stopTimer2Interval, self.stopOnNoUpdate)
|
||||
self.stopTimer2.start()
|
||||
self.lastState, self.lastSessionKey, self.lastRatingKey = state, sessionKey, ratingKey
|
||||
mediaType = metadata.type
|
||||
if (state != "playing"):
|
||||
extra = secondsToText(viewOffset / 1000, ":") + "/" + secondsToText(metadata.duration / 1000, ":")
|
||||
else:
|
||||
extra = secondsToText(metadata.duration / 1000)
|
||||
if (mediaType == "movie"):
|
||||
title = metadata.title + " (" + str(metadata.year) + ")"
|
||||
extra = extra + " · " + ", ".join([genre.tag for genre in metadata.genres[:3]])
|
||||
largeText = "Watching a Movie"
|
||||
elif (mediaType == "episode"):
|
||||
title = metadata.grandparentTitle
|
||||
extra = extra + " · S" + str(metadata.parentIndex) + " · E" + str(metadata.index) + " - " + metadata.title
|
||||
largeText = "Watching a TV Show"
|
||||
elif (mediaType == "track"):
|
||||
title = metadata.title
|
||||
artist = metadata.originalTitle
|
||||
if (not artist):
|
||||
artist = metadata.grandparentTitle
|
||||
extra = artist + " · " + metadata.parentTitle
|
||||
largeText = "Listening to Music"
|
||||
else:
|
||||
self.log("Unsupported media type \"" + mediaType + "\", ignoring", "red", True)
|
||||
return
|
||||
activity = {
|
||||
"details": title,
|
||||
"state": extra,
|
||||
"assets": {
|
||||
"large_text": largeText,
|
||||
"large_image": "logo",
|
||||
"small_text": state.capitalize(),
|
||||
"small_image": state
|
||||
},
|
||||
}
|
||||
if (state == "playing"):
|
||||
currentTimestamp = int(time.time())
|
||||
if (self.plexConfig.timeRemaining):
|
||||
activity["timestamps"] = {"end": round(currentTimestamp + ((metadata.duration - viewOffset) / 1000))}
|
||||
else:
|
||||
activity["timestamps"] = {"start": round(currentTimestamp - (viewOffset / 1000))}
|
||||
if (not self.running):
|
||||
self.start()
|
||||
if (self.running):
|
||||
self.send(activity)
|
||||
else:
|
||||
self.stop()
|
||||
except Exception as e:
|
||||
self.log("onPlexServerAlert Error: " + str(e))
|
||||
|
||||
def stopOnNoUpdate(self):
|
||||
self.log("No updates from session key " + str(self.lastSessionKey) + ", stopping", "red", True)
|
||||
self.stop()
|
||||
|
||||
isLinux = sys.platform in ["linux", "darwin"]
|
||||
lock = threading.Semaphore(value = 1)
|
||||
|
||||
os.system("clear" if isLinux else "cls")
|
||||
|
||||
if (len(plexConfigs) == 0):
|
||||
print("Error: plexConfigs list is empty")
|
||||
sys.exit()
|
||||
|
||||
colours = {
|
||||
"red": "91",
|
||||
"green": "92",
|
||||
"yellow": "93",
|
||||
"blue": "94",
|
||||
"magenta": "96",
|
||||
"cyan": "97"
|
||||
}
|
||||
|
||||
def colourText(text, colour = ""):
|
||||
prefix = ""
|
||||
suffix = ""
|
||||
colour = colour.lower()
|
||||
if (colour in colours):
|
||||
prefix = "\033[" + colours[colour] + "m"
|
||||
suffix = "\033[0m"
|
||||
return prefix + str(text) + suffix
|
||||
|
||||
def secondsToText(seconds, joiner = ""):
|
||||
seconds = round(seconds)
|
||||
text = {"h": seconds // 3600, "m": seconds // 60 % 60, "s": seconds % 60}
|
||||
if (joiner == ""):
|
||||
text = [str(v) + k for k, v in text.items() if v > 0]
|
||||
else:
|
||||
if (text["h"] == 0):
|
||||
del text["h"]
|
||||
text = [str(v).rjust(2, "0") for k, v in text.items()]
|
||||
return joiner.join(text)
|
||||
|
||||
discordRichPresencePlexInstances = []
|
||||
for config in plexConfigs:
|
||||
discordRichPresencePlexInstances.append(discordRichPresencePlex(config))
|
||||
try:
|
||||
for discordRichPresencePlexInstance in discordRichPresencePlexInstances:
|
||||
discordRichPresencePlexInstance.run()
|
||||
while (True):
|
||||
time.sleep(3600)
|
||||
except KeyboardInterrupt:
|
||||
for discordRichPresencePlexInstance in discordRichPresencePlexInstances:
|
||||
discordRichPresencePlexInstance.reset()
|
||||
except Exception as e:
|
||||
print("Error: " + str(e))
|
@ -19,6 +19,8 @@ Ce dépot nous sert a stocker les composes / aides / tutos / ... qui nous permet
|
||||
|
||||
Lisez le README "Aide pour le repo" ici : https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/README_GIT.md
|
||||
|
||||
Aussi dispo : [Tutoriel pour Git avec SourceTree](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/TUTO_Git_SourceTree.md)
|
||||
|
||||
## Comment nous rejoindre ?
|
||||
|
||||
Nous sommes sur Discord, a cette adresse : https://discord.gg/ERpYMqS
|
||||
Nous sommes sur Discord et Guilded, a ces adresses : https://discord.gg/3gtABCH | https://guilded.gg/PlexFR
|
@ -12,6 +12,7 @@ Clonez le dépot sur votre machine `git clone https://gitea.zoz-serv.org/Zoz/ple
|
||||
### Pour chaque modification, attention à bien suivre cette procédure si vous voulez éviter des conflits de versions
|
||||
|
||||
- Créez votre branche via la GUI Gitea (idéalement votre pseudo) ex : `Benj`
|
||||
(pour cela, demandez à Zoz de vous attribuer un rôle de contributeur)
|
||||
|
||||

|
||||
|
||||
|
@ -0,0 +1,885 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer deux MKV en gardant l'audio et le(s) sous-titre du premier ou un sous-titre ##
|
||||
## externe, et seulement la vidéo du second MKV ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
# ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ - MKV1 : file to keep with 2 audio, 1 internal SRT, DROP the video (720p) │
|
||||
# │ - MKV2 : file to keep with only the video 1080p ! │
|
||||
# │ - SRT1 : external SRT file with same name of the MKV2 file (SRT made by extracted PGS in the MKV2 file) │
|
||||
# │ - SRT2 : external SRT file with same name of the MKV2 file (SRT made by extracted PGS in the MKV2 file) │
|
||||
# └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
Clear-Host
|
||||
Invoke-Command -ScriptBlock {
|
||||
|
||||
# #############################################################################################
|
||||
# -> BEGIN VARIABLES DECLARATION -----------------------------------------------------------
|
||||
# #############################################################################################
|
||||
|
||||
# Set MKVMerge.exe and MediaInfo.exe (CLI version) Path
|
||||
$MKVMerge = "`"PATH_TO\mkvtoolnix\mkvmerge.exe`""
|
||||
$MediaInfo = "`"PATH_TO\MediaInfo_CLI\MediaInfo.exe`""
|
||||
# For the parameters to pass to MKVMerge executable, will be construct
|
||||
# Set this to $true in order to merge a MKV_2 present in $sourceDirectory_2
|
||||
$merge_another_video_MKV2 = $false # If set to $false, $sourceDirectory_2 will be ignored.
|
||||
|
||||
# Don't add a \ at the end of the path...
|
||||
$sourceDirectory_1 = "PATH_TO_SOURCE_1"
|
||||
$sourceDirectory_2 = "PATH_TO_SOURCE_1"
|
||||
|
||||
$destinationDirectory = "PATH_TO_DESTINATION"
|
||||
|
||||
# If you want a .json file created, set this $JSON_Export to $true, set the $sourceDirectory_1_json variable to set the path for the .json file.
|
||||
# If you don"t want a .json file, set set this $JSON_Export to $false, and let the others as they are.
|
||||
$JSON_Export = $false
|
||||
$sourceDirectory_1_json = "PATH_TO_JSON_FILE"
|
||||
|
||||
|
||||
|
||||
# Remove dots before the season or the resolution ?
|
||||
$remove_dots = $false
|
||||
# If there is the year in the title, set it to $true
|
||||
$set_year_with_brackets = $false
|
||||
|
||||
# Renaming the output file (and the video title)
|
||||
# Use https://regex101.com/r/cU5lC2/1 to get the RegEx
|
||||
$chain_to_search = ''
|
||||
$chain__to_replace = ''
|
||||
|
||||
# $chain_to_search = '(.*) - S(\d{2})E(\d{3})(.*)H264(.*)'
|
||||
# $chain_to_search = '(.*) - S(\d{2})E(\d{3})(.*)'
|
||||
# $chain__to_replace = '$1 - S$2E$3$4x265-10bits$5--Custom'
|
||||
|
||||
# Move MKV1 (and SRT) to Not-Merged folder ? Set to $false or $true
|
||||
$move_mkv1_after_merge = $true
|
||||
$move_mkv2_after_merge = $true
|
||||
|
||||
# Extension without the .
|
||||
$VideoExtension_1 = "mkv"
|
||||
$VideoExtension_2 = "mkv"
|
||||
|
||||
$no_attachements = $true
|
||||
|
||||
# ################ VIDEO to keep ##################
|
||||
# = 0 : for video from MKV1 (first file)
|
||||
# = 1 : for video from MKV2 (second file)
|
||||
$Video_Lang = "ja" # en for english / fr for french / ja for japanese
|
||||
# ================== AUDIO ================== Common for all videos, MAX 2 audio
|
||||
# _1 will be the first in track-name order, then _2
|
||||
|
||||
# How many audio tracks to keep = 0, 1 or 2
|
||||
$NB_Audio_MKV1 = 1
|
||||
# This is to search for the right ID in the MKV (with JSON)
|
||||
$AudioTrack_1_Lang = "ja" # Set here the first audio lang to keep
|
||||
$AudioTrack_2_Lang = "fr" # Set here the second audio lang to keep
|
||||
# $AudioTrack_Default_Lang = "ja" # Set here the default audio lang to set in merge
|
||||
|
||||
# This is for personalizing the tracks info !
|
||||
# Track 1 = Audio n°1
|
||||
$AudioTrackName_1_sansID = "Japonais - AAC 2.0"
|
||||
$AudioLang_1_sansID = "ja" # en for english / fr for french / ja for japanese
|
||||
$AudioTrack_1_default_sansID = "yes"
|
||||
# Define track order. Do not modify it unless you changed the track number in this section
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name and language of Audio Track n°2
|
||||
$AudioTrackName_2_sansID = "Français - Dolby Digital 2.0"
|
||||
$AudioLang_2_sansID = "fr" # en for english / fr for french / ja for japanese
|
||||
$AudioTrack_2_default_sansID = "no"
|
||||
# Define track order. Do not modify it unless you changed the track number in this section
|
||||
# ================================================================
|
||||
|
||||
|
||||
|
||||
# ===========================================
|
||||
# ================== Internal SUB ? =========
|
||||
# To keep or not internal subtitles
|
||||
# $keep_internal_Sub = $true
|
||||
$Internal_SUB_Number = 0 # Set this to 1 or 2 to keep 1 or 2 or 3 internal subtitles, or to 0 to keep no internal sub.
|
||||
$Internal_SUB_Lang_1 = "fr" # Set here the first internal subtitle lang to keep
|
||||
$Internal_SUB_Lang_2 = "fr" # Set here the second internal subtitle lang to keep
|
||||
$Internal_SUB_Lang_3 = "fr" # Set here the third internal subtitle lang to keep
|
||||
|
||||
# If there is 2 sub in the same language, like "FR Full" and "FR Forced", set those variables :
|
||||
$Internal_SUB_to_search_with_title = $false # Set this to $true if there is at least 2 internal sub in the same lang
|
||||
$Internal_SUB_1_title_to_search = "SDH" # Set this to a string to search in sub title to set it into the first internal sub
|
||||
$Internal_SUB_2_title_to_search = "" # Set this to a string to search in subtitle TITLE to set it into the second internal sub
|
||||
$Internal_SUB_2_title_to_search = "" # Set this to a string to search in subtitle TITLE to set it into the third internal sub
|
||||
$Internal_SUB_to_be_forced = "" # Set this to 1 or 2 in order to set it to forced subtitle
|
||||
|
||||
# Max 3 Internal SRT is configured in the script.
|
||||
# If set to 3, must be 2 SRT configured
|
||||
$SubTrackName_1_sansID = "English SDH - SRT"
|
||||
$SubTrackLang_1_sansID = "en" # en for english / fr for french / jp for japanese
|
||||
$SubTrack_1_default_sansID = "yes"
|
||||
$SubTrack_1_forced_track_sansID = "no"
|
||||
$SubTrack_1_SDH_sansID = "yes"
|
||||
$sub_charset_1_sansID = "UTF-8"
|
||||
|
||||
|
||||
$SubTrackName_2_sansID = "Français - SRT"
|
||||
$SubTrackLang_2_sansID = "fr" # en for english / fr for french / jp for japanese
|
||||
$SubTrack_2_default_sansID = "no"
|
||||
$SubTrack_2_forced_track_sansID = "no"
|
||||
$SubTrack_2_SDH_sansID = "no"
|
||||
$sub_charset_2_sansID = "UTF-8"
|
||||
|
||||
$SubTrackName_3_sansID = "Français - SRT"
|
||||
$SubTrackLang_3_sansID = "fr" # en for english / fr for french / jp for japanese
|
||||
$SubTrack_3_default_sansID = "no"
|
||||
$SubTrack_3_forced_track_sansID = "no"
|
||||
$SubTrack_3_SDH_sansID = "no"
|
||||
$sub_charset_3_sansID = "UTF-8"
|
||||
# ===========================================
|
||||
|
||||
# ===========================================
|
||||
# ================== External SUB ? =========
|
||||
# Must have the same name as MKV1
|
||||
|
||||
$External_SUB = $true
|
||||
$External_SUB_Number = 1 # Works only if $External_SUB = $true
|
||||
# Max 2 External SRT is configured in the script.
|
||||
# If set to 2, must be 2 SRT configured
|
||||
|
||||
# Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension_1 = 'Full.fre.srt'
|
||||
$SubExtension_2 = 'Forced.fre.srt'
|
||||
|
||||
#### FILE 2 - SRT_1 - Keeping all but the video (audio + chapters tags)
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_1 = "0:Français (Complet) - SRT"
|
||||
$ExtSubTrackLang_1 = "0:fr"
|
||||
$ExtSubTrack_1_default = "0:yes"
|
||||
$ExtSub_charset_1 = "0:UTF-8"
|
||||
$ExtSub_forced_track_1 = "0:no"
|
||||
$ExtSub_SDH_1 = "0:no"
|
||||
|
||||
#### FILE 3 - SRT_2 - Keeping all but the video (audio + chapters tags)
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_2 = "0:Français (Forcé) - SRT"
|
||||
$ExtSubTrackLang_2 = "0:fr"
|
||||
$ExtSubTrack_2_default = "0:no"
|
||||
$ExtSub_charset_2 = "0:UTF-8"
|
||||
$ExtSub_forced_track_2 = "0:yes"
|
||||
$ExtSub_SDH_2 = "0:no"
|
||||
|
||||
#----------------------------------------------------------------------------------------------
|
||||
# DO NOT TOUCH WHAT'S UNDER THIS -----------------------------------------------------------
|
||||
#----------------------------------------------------------------------------------------------
|
||||
|
||||
# #############################################################################################
|
||||
# -> BEGIN FUNCTION DEFINITIONS -----------------------------------------------------------
|
||||
# #############################################################################################
|
||||
|
||||
function Get-Track_ID {
|
||||
param (
|
||||
[Parameter(Mandatory)]$MediaInfo,
|
||||
[Parameter(Mandatory)]$MKV_1,
|
||||
[Parameter(Mandatory)][ValidateSet(1, 2)]$NB_Audio_MKV1,
|
||||
[Parameter(Mandatory)]$AudioTrack_1_Lang,
|
||||
[Parameter(Mandatory)]$AudioTrack_2_Lang,
|
||||
[Parameter(Mandatory)][ValidateSet(0, 1, 2, 3)]$Internal_SUB_Number,
|
||||
[Parameter(Mandatory)]$Internal_SUB_Lang_1,
|
||||
[Parameter(Mandatory)]$Internal_SUB_Lang_2,
|
||||
[Parameter(Mandatory)]$Internal_SUB_Lang_3,
|
||||
[Parameter(Mandatory)][ValidateSet($true, $false)]$Internal_SUB_to_search_with_title,
|
||||
[Parameter(Mandatory)]$Internal_SUB_1_title_to_search = "",
|
||||
[Parameter(Mandatory)]$Internal_SUB_2_title_to_search = "",
|
||||
[Parameter(Mandatory)]$Internal_SUB_3_title_to_search = "",
|
||||
[Parameter(Mandatory = $false)][ValidateSet($true, $false)]$JSON_Export = $false,
|
||||
[Parameter(Mandatory = $false)]$JSON_file = ""
|
||||
)
|
||||
|
||||
# Values witch will be found with MediaInfo JSON
|
||||
$VideoTrack_ID = ""
|
||||
$AudioTrack_1_ID = ""
|
||||
$AudioTrack_2_ID = ""
|
||||
$Internal_Sub_1_ID = ""
|
||||
$Internal_Sub_2_ID = ""
|
||||
$Internal_Sub_3_ID = ""
|
||||
|
||||
$JSON_video_position = "" # To use with $JSON_object.media.Track[ ]
|
||||
$JSON_audio_1_position = "" # To use with $JSON_object.media.Track[ ]
|
||||
$JSON_audio_2_position = "" # To use with $JSON_object.media.Track[ ]
|
||||
$JSON_sub_1_position = ""
|
||||
$JSON_sub_2_position = ""
|
||||
$JSON_sub_3_position = ""
|
||||
|
||||
if (( $JSON_Export -eq $true) -And ( $JSON_file -ne "")) {
|
||||
$MediaInfo_arguments = "--output=JSON --LogFile=`"$JSON_file`""
|
||||
}
|
||||
else {
|
||||
if ( $JSON_Export -eq $false ) {
|
||||
Write-Host "`tNo JSON file will be created..." -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
}
|
||||
elseif ( $JSON_file -eq "") {
|
||||
Write-Host "`tNo JSON file is pass in Get-Track_ID function parameters !!`n`tThere will not be any JSON file created..." -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
}
|
||||
$MediaInfo_arguments = "--output=JSON"
|
||||
}
|
||||
$command_info = "& $MediaInfo $MediaInfo_arguments `"$MKV_1`""
|
||||
# Launch command begin... and we're grabbing the output into json_output
|
||||
$json_output = Invoke-Expression $command_info
|
||||
# Write-Host "`$json_output = `n$json_output" -ForegroundColor "green"
|
||||
# $JSON_object = Get-Content -Raw -Path "$JSON_file" | ConvertFrom-Json
|
||||
$JSON_object = $json_output | ConvertFrom-Json
|
||||
|
||||
|
||||
$i = 0 # Counter for video track detected
|
||||
$j = 0 # Counter for audio track detected
|
||||
$k = 0 # Counter for audio tracks kept
|
||||
$l = 0 # Counter for track position
|
||||
$m = 0 # Counter for sub track detected
|
||||
$n = 0 # Counter for sub tracks kept
|
||||
$JSON_VideoCount = $JSON_object.media.Track[0].VideoCount
|
||||
$JSON_AudioCount = $JSON_object.media.Track[0].AudioCount
|
||||
$JSON_SubCount = $JSON_object.media.Track[0].TextCount
|
||||
|
||||
foreach ( $track in $JSON_object.media.Track ) {
|
||||
# Note :
|
||||
# The reel track ID is 1 minus the ID get in JSON...
|
||||
|
||||
# Check if there is a bug in the script
|
||||
if ( $j -gt $JSON_AudioCount ) {
|
||||
Write-Host "`tThere is a problem in Audio Track detection from JSON !! Need to debug this !!" -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
Exit
|
||||
}
|
||||
elseif ( $i -gt $JSON_VideoCount ) {
|
||||
Write-Host "`tThere is a problem in Video Track detection from JSON !! Need to debug this !!" -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
Exit
|
||||
}
|
||||
elseif ( ( $m -gt $JSON_SubCount ) -And ( $JSON_SubCount -ne $null ) ) {
|
||||
Write-Host "`tThere is a problem in Subtitles Track detection from JSON !! Need to debug this !!" -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
Exit
|
||||
}
|
||||
|
||||
if ( $track."@type" -match "Video" ) {
|
||||
$VideoTrack_ID = $track.id - 1
|
||||
$i++
|
||||
$JSON_video_position = $l
|
||||
}
|
||||
elseif ( $track."@type" -match "Audio" ) {
|
||||
$j++
|
||||
|
||||
if (( $track."Language" -match "$AudioTrack_1_Lang" ) -And ( $AudioTrack_1_ID -eq "" ) -And ( $k -ne $NB_Audio_MKV1)) {
|
||||
$AudioTrack_1_ID = $track.id - 1
|
||||
$k++
|
||||
$JSON_audio_1_position = $l
|
||||
}
|
||||
elseif (( $track."Language" -match "$AudioTrack_2_Lang" ) -And ( $AudioTrack_2_ID -eq "" ) -And ( $k -ne $NB_Audio_MKV1)) {
|
||||
$AudioTrack_2_ID = $track.id - 1
|
||||
$k++
|
||||
$JSON_audio_2_position = $l
|
||||
}
|
||||
else {
|
||||
if (( $AudioTrack_1_ID -eq "" ) -And ( $AudioTrack_2_ID -eq "" )) {
|
||||
Write-Host "`tThere is no audio tracks that match your specifications." -ForegroundColor "Yellow"
|
||||
}
|
||||
else {
|
||||
Write-Host "`tThere is no audio tracks that match your specifications." -ForegroundColor "Yellow"
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ( $track."@type" -match "Text" ) {
|
||||
$m++
|
||||
if ($Internal_SUB_Number -ne 0 ) {
|
||||
if ( ( $Internal_SUB_Lang_1 -ne "" ) -And ( $track."Language" -match "$Internal_SUB_Lang_1" ) -And ( $Internal_Sub_1_ID -eq "" ) -And ( $n -ne $Internal_SUB_Number ) -And (( $Internal_SUB_to_search_with_title -eq $false ) -OR (( $Internal_SUB_to_search_with_title -eq $true ) -And ( $track.Title -match "$Internal_SUB_1_title_to_search" )) ) ) {
|
||||
$Internal_Sub_1_ID = $track.id - 1
|
||||
$n++
|
||||
$JSON_sub_1_position = $l
|
||||
}
|
||||
elseif ( ( $Internal_SUB_Lang_2 -ne "" ) -And ( $track."Language" -match "$Internal_SUB_Lang_2" ) -And ( $Internal_Sub_2_ID -eq "" ) -And ( $n -ne $Internal_SUB_Number) -And (( $Internal_SUB_to_search_with_title -eq $false ) -OR (( $Internal_SUB_to_search_with_title -eq $true ) -And ( $track.Title -match "$Internal_SUB_2_title_to_search" )) ) ) {
|
||||
$Internal_Sub_2_ID = $track.id - 1
|
||||
$n++
|
||||
$JSON_sub_2_position = $l
|
||||
}
|
||||
elseif ( ( $Internal_SUB_Lang_3 -ne "" ) -And ( $track."Language" -match "$Internal_SUB_Lang_3" ) -And ( $Internal_Sub_3_ID -eq "" ) -And ( $n -ne $Internal_SUB_Number) -And (( $Internal_SUB_to_search_with_title -eq $false ) -OR (( $Internal_SUB_to_search_with_title -eq $true ) -And ( $track.Title -match "$Internal_SUB_3_title_to_search" )) ) ) {
|
||||
$Internal_Sub_3_ID = $track.id - 1
|
||||
$n++
|
||||
$JSON_sub_3_position = $l
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Some Internal Sub are present, but we don't care, we don't keep it/them...
|
||||
Write-Host "`tThere is some internal subtitle tracks, but you choose to not keep it/them..." -ForegroundColor "Cyan"
|
||||
}
|
||||
}
|
||||
|
||||
$l++ # Increment number of track processed
|
||||
}
|
||||
if ($Internal_SUB_Number -ne 0 ) {
|
||||
# Checking if there are the right number of IDs retrieved
|
||||
if ( ( $Internal_SUB_Number -ne 0 ) -And ( $JSON_SubCount -eq 0 ) ) {
|
||||
Write-Host "`tYou choose to keep at least one internal subtitle, but there isn't any in the MKV..." -ForegroundColor "Red"
|
||||
}
|
||||
|
||||
|
||||
if (( $Internal_Sub_1_ID -eq "" ) -And ( $Internal_Sub_2_ID -eq "" ) -And ( $Internal_Sub_3_ID -eq "" )) {
|
||||
Write-Host "`tThere is no internal subtitle tracks that match your specifications." -ForegroundColor "Yellow"
|
||||
}
|
||||
else {
|
||||
$counter = 0
|
||||
if ( $Internal_Sub_1_ID -ne "" ) {
|
||||
$counter++
|
||||
}
|
||||
if ( $Internal_Sub_2_ID -ne "" ) {
|
||||
$counter++
|
||||
}
|
||||
if ( $Internal_Sub_3_ID -ne "" ) {
|
||||
$counter++
|
||||
}
|
||||
if ( $counter -lt $Internal_SUB_Number ) {
|
||||
# Not all desired subtitles are retrieved
|
||||
Write-Host "`tNot all desired subtitles are retrieved..." -ForegroundColor "Red"
|
||||
if (( $Internal_SUB_Number -ge 1 ) -And ( $Internal_Sub_1_ID -eq "" )) {
|
||||
Write-Host "`tThere is no internal subtitle tracks that match your specification language : $Internal_SUB_Lang_1." -ForegroundColor "Yellow"
|
||||
}
|
||||
if (( $Internal_SUB_Number -ge 2 ) -And ( $Internal_Sub_2_ID -eq "" )) {
|
||||
Write-Host "`tThere is no internal subtitle tracks that match your specification language : $Internal_SUB_Lang_2." -ForegroundColor "Yellow"
|
||||
}
|
||||
if (( $Internal_SUB_Number -eq 3 ) -And ( $Internal_Sub_3_ID -eq "" )) {
|
||||
Write-Host "`tThere is no internal subtitle tracks that match your specification language : $Internal_SUB_Lang_3." -ForegroundColor "Yellow"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Write-Host "`tThere is no internal subtitle tracks that match your specifications." -ForegroundColor "Yellow"
|
||||
}
|
||||
}
|
||||
|
||||
# if ( ( $Internal_SUB_Number -eq 1 ) -And ( $Internal_Sub_1_ID -eq "" ) ) {
|
||||
# Write-Host "`tYou choose to keep one internal subtitle, but there isn't any in the MKV..." -ForegroundColor "Red"
|
||||
# }
|
||||
# elseif ( ( $Internal_SUB_Number -eq 2 ) -And ( ($Internal_Sub_1_ID -eq "") -Or ($Internal_Sub_2_ID -eq "") ) ) {
|
||||
# if ( $Internal_Sub_1_ID -eq "" ) {
|
||||
# Write-Host "`tYou choose to keep two internal subtitle, but there isn't any in the MKV..." -ForegroundColor "Yellow"
|
||||
# }
|
||||
# }
|
||||
# elseif ( ( $Internal_SUB_Number -eq 2 ) -And ( ($Internal_Sub_1_ID -eq "") -And ($Internal_Sub_2_ID -eq "") ) ) {
|
||||
# Write-Host "`tYou choose to keep two internal subtitle, but there isn't any in the MKV..." -ForegroundColor "Yellow"
|
||||
# }
|
||||
# elseif ( ( $Internal_SUB_Number -eq 2 ) -And ( ($Internal_Sub_1_ID -ne "") -And ($Internal_Sub_2_ID -ne "") -And ($Internal_Sub_3_ID -eq "") ) ) {
|
||||
# Write-Host "`tOnly Two Internal Subtitles ID have been retrieved ! Great !" -ForegroundColor "Yellow"
|
||||
# }
|
||||
# elseif ( ( $Internal_SUB_Number -eq 3 ) -And ( ($Internal_Sub_1_ID -ne "") -And ($Internal_Sub_2_ID -ne "") -And ($Internal_Sub_3_ID -ne "") ) ) {
|
||||
# Write-Host "`tOnly Three Internal Subtitles ID have been retrieved ! Great !" -ForegroundColor "Yellow"
|
||||
# }
|
||||
|
||||
Write-Host "`t`$VideoTrack_ID = $VideoTrack_ID" -ForegroundColor "Yellow"
|
||||
if ($NB_Audio_MKV1 -ge 1) {
|
||||
Write-Host "`t`$AudioTrack_1_ID = $AudioTrack_1_ID`tLang set in the script = $AudioTrack_1_Lang" -ForegroundColor "Yellow"
|
||||
if ($NB_Audio_MKV1 -eq 2) {
|
||||
Write-Host "`t`$AudioTrack_2_ID = $AudioTrack_2_ID`tLang set in the script = $AudioTrack_2_Lang" -ForegroundColor "Yellow"
|
||||
}
|
||||
}
|
||||
|
||||
if ( $Internal_SUB_Number -ne 0 ) {
|
||||
Write-Host "`t`$Internal_Sub_1_ID = $Internal_Sub_1_ID`tLang set in the script = $Internal_SUB_Lang_1" ( &{ If ($Internal_SUB_to_search_with_title -eq $true) { "`tSearched Title was : $Internal_SUB_1_title_to_search" } Else { "" } }) -ForegroundColor "Yellow"
|
||||
if ($Internal_SUB_Number -ge 2) {
|
||||
Write-Host "`t`$Internal_Sub_2_ID = $Internal_Sub_2_ID`tLang set in the script = $Internal_SUB_Lang_2" ( &{ If ($Internal_SUB_to_search_with_title -eq $true) { "`tSearched Title was : $Internal_SUB_2_title_to_search" } Else { "" } }) -ForegroundColor "Yellow"
|
||||
if ($Internal_SUB_Number -eq 3) {
|
||||
Write-Host "`t`$Internal_Sub_3_ID = $Internal_Sub_3_ID`tLang set in the script = $Internal_SUB_Lang_3" ( &{ If ($Internal_SUB_to_search_with_title -eq $true) { "`tSearched Title was : $Internal_SUB_3_title_to_search" } Else { "" } }) -ForegroundColor "Yellow"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $VideoTrack_ID, $AudioTrack_1_ID, $AudioTrack_2_ID, $Internal_Sub_1_ID, $Internal_Sub_2_ID, $Internal_Sub_3_ID
|
||||
}
|
||||
|
||||
function Test-Directory {
|
||||
param (
|
||||
[Parameter(Mandatory)]$path_to_verify
|
||||
)
|
||||
If (!(test-path $path_to_verify)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $path_to_verify
|
||||
Write-Host "The path $path_to_verify (or one of the last subfolder) didn't exist. It has been created." -ForegroundColor "DarkBlue"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# #############################################################################################
|
||||
# -> BEGIN MAIN SCRIPT -------------------------------------------------------------------
|
||||
# #############################################################################################
|
||||
|
||||
# Resetting some variables that should be equal to ""
|
||||
if ( $NB_Audio_MKV1 -eq 0 ) {
|
||||
$AudioTrack_1_Lang = ""
|
||||
$AudioTrack_2_Lang = ""
|
||||
}
|
||||
elseif ( $NB_Audio_MKV1 -eq 1 ) {
|
||||
$AudioTrack_2_Lang = ""
|
||||
}
|
||||
|
||||
if ( $Internal_SUB_Number -eq 0 ) {
|
||||
$Internal_SUB_Lang_1 = ""
|
||||
$Internal_SUB_Lang_2 = ""
|
||||
$Internal_SUB_Lang_3 = ""
|
||||
}
|
||||
elseif ( $Internal_SUB_Number -eq 1 ) {
|
||||
$Internal_SUB_Lang_2 = ""
|
||||
$Internal_SUB_Lang_3 = ""
|
||||
}
|
||||
elseif ( $Internal_SUB_Number -eq 2 ) {
|
||||
$Internal_SUB_Lang_3 = ""
|
||||
}
|
||||
# -------------------------------------------------
|
||||
|
||||
# Define track order - DO NOT TOUCH
|
||||
$track_order_EXT_sub = ""
|
||||
if ( $merge_another_video_MKV2 -eq $false) {
|
||||
if ( $External_SUB -eq $true ) {
|
||||
if ( $External_SUB_Number -ge 1 ) {
|
||||
$track_order_EXT_sub += "1:0"
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
$track_order_EXT_sub += ",2:0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( $External_SUB -eq $true ) {
|
||||
if ( $External_SUB_Number -ge 1 ) {
|
||||
$track_order_EXT_sub += "2:0"
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
$track_order_EXT_sub += ",3:0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ===========================================
|
||||
|
||||
# Checking if the $destinationDirectory exists, if not, create the folder(s)
|
||||
Test-Directory $destinationDirectory
|
||||
|
||||
# Counting the number of MKV_1
|
||||
$MKV_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$VideoExtension_1" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1 = $MKV_1_List.count
|
||||
Write-Host "$Count_1 Videos ($VideoExtension_1) to be processed in $sourceDirectory_1."
|
||||
# Testing if the Done_Remerged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_1 = $sourceDirectory_1 + "\Done_Remerged"
|
||||
Test-Directory $Path_Folder_NotMerged_1
|
||||
|
||||
if ($merge_another_video_MKV2 -eq $true) {
|
||||
# Counting the number of MKV_1
|
||||
$MKV_2_List = Get-ChildItem $sourceDirectory_2 -Filter "*.$VideoExtension_2" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2 = $MKV_2_List.count
|
||||
Write-Host "$Count_2 MKV's to be processed in $sourceDirectory_2."
|
||||
# Testing if the Done_Remerged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_2 = $sourceDirectory_2 + "\Done_Remerged"
|
||||
Test-Directory $Path_Folder_NotMerged_2
|
||||
|
||||
|
||||
# #########################
|
||||
# Check if there is the same .mkv files in both source directory
|
||||
if ($Count_1 -eq $Count_2) {
|
||||
Write-Host "There is the same number of MKV in the two sources folders. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV in the two sources folders isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
# #########################
|
||||
}
|
||||
|
||||
# #########################
|
||||
# Check if there is the same number of .srt files as .mkv files
|
||||
if ( $External_SUB -eq $true ) {
|
||||
if ( $External_SUB_Number -ge 1 ) {
|
||||
# If $NB_External_SUB >= 1 (include =1 and =2)
|
||||
$SRT_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_1" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1_SRT = $SRT_1_List.count
|
||||
Write-Host "$Count_1_SRT SRT's ($SubExtension_1) to be processed in $sourceDirectory_1."
|
||||
if ($Count_1 -eq $Count_1_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°1 files ($SubExtension_1) in this folder. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV and SRT n°1 files isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
# Only if $External_SUB_Number = 2
|
||||
$SRT_2_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_2" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2_SRT = $SRT_2_List.count
|
||||
Write-Host "$Count_2_SRT SRT's ($SubExtension_2) to be processed in $sourceDirectory_1."
|
||||
|
||||
if ($Count_1 -eq $Count_2_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°2 files ($SubExtension_2) in this folder. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV and SRT n°2 files ($SubExtension_2) isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
}
|
||||
# #########################
|
||||
|
||||
$compteur = 1 # Counter to show the progress of file processed
|
||||
|
||||
Foreach ($MKV_1 in $MKV_1_List) {
|
||||
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "Traitement du fichier n° $compteur / $Count_1..." -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
# Clear variables
|
||||
$MKVMerge_param_start = ""
|
||||
$MKVMerge_param_mkv1 = ""
|
||||
$MKVMerge_param_srt1 = ""
|
||||
$MKVMerge_param_srt2 = ""
|
||||
$MKVMerge_param_all = ""
|
||||
$MKVMerge_sub_param = ""
|
||||
$SRT_1_Name = ""
|
||||
$SRT_2_Name = ""
|
||||
$SRT_1 = ""
|
||||
$SRT_2 = ""
|
||||
$SubTrackName_1 = ""
|
||||
$SubTrackLang_1 = ""
|
||||
$SubTrack_1_default = ""
|
||||
$sub_charset_1 = ""
|
||||
$SubTrackName_2 = ""
|
||||
$SubTrackLang_2 = ""
|
||||
$SubTrack_2_default = ""
|
||||
$sub_charset_2 = ""
|
||||
$track_order = ""
|
||||
$VideoTrack_ID, $AudioTrack_1_ID, $AudioTrack_2_ID = "", "", ""
|
||||
$Internal_Sub_1_ID, $Internal_Sub_2_ID, $Internal_Sub_3_ID = "", "", ""
|
||||
$MKVMerge_audio_param = ""
|
||||
|
||||
$FormatName_1 = (Get-Item $MKV_1).Basename
|
||||
$MKV_1_name = $FormatName_1.ToString()
|
||||
|
||||
# #################################################################
|
||||
# Title for the video track and for the destination file $Output
|
||||
$VideoTrackName = $MKV_1_name
|
||||
if ( $set_year_with_brackets -eq $true ) {
|
||||
if ( $type_media -eq "movie" ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '(\d{4}(?=\..*))', '($1)'
|
||||
}
|
||||
elseif ( $type_media -eq "serie" ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '(\d{4}(?=.*S\d{2}E\d{2}))', '($1)'
|
||||
}
|
||||
}
|
||||
if ( $remove_dots -eq $true ) {
|
||||
if ( $type_media -eq "movie" ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '\.(?=.*\d{4})', ' '
|
||||
}
|
||||
elseif ( $type_media -eq "serie" ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '\.(?=.*S\d{2}E\d{2})', ' '
|
||||
}
|
||||
}
|
||||
$VideoTrackName = $VideoTrackName -replace $chain_to_search, $chain__to_replace
|
||||
$VideoTrackName = "$VideoTrackName"
|
||||
Write-Host "`tThe Video Track Name will be : `r`n`t`t $VideoTrackName" -ForegroundColor "green"
|
||||
if ( $compteur -le 3 ) {
|
||||
# Will prompt for a key to be pressed for the 3 first names
|
||||
Write-Host "`tFor the 3 first file, this will show up, and pause for 10s" -ForegroundColor "yellow";
|
||||
Start-Sleep -Seconds 10
|
||||
}
|
||||
$Output = "$destinationDirectory" + "\" + "$VideoTrackName" + ".mkv"
|
||||
$JSON_file = "$sourceDirectory_1_json\$MKV_1_name.json"
|
||||
# #################################################################
|
||||
|
||||
# Now we'll get the track ID for the MKV in action !
|
||||
$VideoTrack_ID, $AudioTrack_1_ID, $AudioTrack_2_ID, $Internal_Sub_1_ID, $Internal_Sub_2_ID, $Internal_Sub_3_ID = Get-Track_ID $MediaInfo $MKV_1 $NB_Audio_MKV1 $AudioTrack_1_Lang $AudioTrack_2_Lang $Internal_SUB_Number $Internal_SUB_Lang_1 $Internal_SUB_Lang_2 $Internal_SUB_Lang_3 $Internal_SUB_to_search_with_title $Internal_SUB_1_title_to_search $Internal_SUB_2_title_to_search $Internal_SUB_3_title_to_search $JSON_Export $JSON_file
|
||||
|
||||
# Exception for some files !!! -----------------------------------------------------------------
|
||||
if ( $MKV_1_name.Substring(0, 26) -eq "One Piece (1999) - S20E001" ) {
|
||||
$AudioTrack_1_ID = 2 # Manual set for 1st audio track in final MKV
|
||||
$AudioTrack_2_ID = 1 # Manual set for 2nd audio track in final MKV
|
||||
Write-Host "`tThis file doesn't have correct track language. We set it to :`n`t`t`$AudioTrack_1_ID = $AudioTrack_1_ID`t for audio lang 1 = $AudioTrack_1_Lang`n`t`t`$AudioTrack_2_ID = $AudioTrack_2_ID." -ForegroundColor "White" -BackgroundColor "DarkRed"
|
||||
}
|
||||
# if ( $MKV_1_name.Substring(0, 26) -eq "One Piece (1999) - S18E001" ) {
|
||||
# $AudioTrackName_1_sansID = "Japonais - AAC 2.0"
|
||||
# $AudioTrackName_2_sansID = "Français - AAC 2.0"
|
||||
# Write-Host "`tThis file doesn't have correct track language. We set it to : `$AudioTrack_1_ID = $AudioTrack_1_ID`tand`t`$AudioTrack_2_ID = $AudioTrack_2_ID."
|
||||
# }
|
||||
# if ( $MKV_1_name.Substring(0, 26) -eq "One Piece (1999) - S18E008" ) {
|
||||
# $AudioTrack_1_ID = 2
|
||||
# $AudioTrack_2_ID = 1
|
||||
# Write-Host "`tThis file doesn't have correct track language. We set it to : `$AudioTrack_1_ID = $AudioTrack_1_ID`tand`t`$AudioTrack_2_ID = $AudioTrack_2_ID."
|
||||
# }
|
||||
# if ( $MKV_1_name.Substring(0, 26) -eq "One Piece (1999) - S18E020" ) {
|
||||
# $AudioTrack_1_ID = 2
|
||||
# $AudioTrack_2_ID = 1
|
||||
# Write-Host "`tThis file doesn't have correct track language. We set it to : `$AudioTrack_1_ID = $AudioTrack_1_ID`tand`t`$AudioTrack_2_ID = $AudioTrack_2_ID."
|
||||
# }
|
||||
|
||||
|
||||
# End of Exceptions ----------------------------------------------------------------------------
|
||||
|
||||
if ( $merge_another_video_MKV2 -eq $false ) {
|
||||
# Only 1 MKV is to re-merge
|
||||
# We keep video and audio from MKV_1
|
||||
if (( $NB_Audio_MKV1 -gt 0 ) -and ($NB_Audio_MKV1 -le 2)) {
|
||||
# $NB_Audio_MKV1 = 1 or 2
|
||||
$MKVMerge_audio_param = "--language $AudioTrack_1_ID" + ":$AudioLang_1_sansID --track-name `"$AudioTrack_1_ID" + ":$AudioTrackName_1_sansID`" --default-track $AudioTrack_1_ID" + ":$AudioTrack_1_default_sansID"
|
||||
$track_order = "$VideoTrack_ID" + ":0,0:$AudioTrack_1_ID"
|
||||
if ( $NB_Audio_MKV1 -eq 2 ) {
|
||||
$MKVMerge_audio_param += " --language $AudioTrack_2_ID" + ":$AudioLang_2_sansID --track-name `"$AudioTrack_2_ID" + ":$AudioTrackName_2_sansID`" --default-track $AudioTrack_2_ID" + ":$AudioTrack_2_default_sansID"
|
||||
$track_order += ",0:$AudioTrack_2_ID"
|
||||
}
|
||||
}
|
||||
elseif ($NB_Audio_MKV1 -ne 0) {
|
||||
write-host "Problem with `$NB_Audio_MKV1=$NB_Audio_MKV1.`n`$NB_Audio_MKV1 must be set to : 0, 1 or 2" -ForegroundColor "Red"
|
||||
exit
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
# 2 MKV are to be merged, keeping audio from MKV_1 and only video from MKV_2
|
||||
|
||||
# We change the video track ID because it's on the MKV_2 !!
|
||||
$VideoTrack_ID = "0" # May not be usefull... TO-DO !!!!
|
||||
|
||||
# ########################################################
|
||||
# Extracting the episode number of the OnePiece Serie (must be commented if not used...)
|
||||
# Generating pattern string to search for the right MKV2 file in case of filename differents...
|
||||
|
||||
# $MKV1_search_pattern = '(.*) - (\d{3}) -(.*)'
|
||||
# # $chain__to_replace = ''
|
||||
# $MKV1_chain_to_replace_for_MKV2 = '$1 - $2'
|
||||
# $MKV_2_search_pattern = $MKV_1_name -replace $MKV1_search_pattern, $MKV1_chain_to_replace_for_MKV2
|
||||
|
||||
$MKV_2_search_pattern = $MKV_1_name
|
||||
# Get MKV2 filename
|
||||
$MKV_2_file = get-ChildItem $sourceDirectory_2 | where { $_.name -like "*$MKV_2_search_pattern*" } | select name
|
||||
$FormatName_2 = $MKV_2_file.Name.ToString()
|
||||
$MKV_2_name = $FormatName_2.Substring(0, $FormatName_2.Length - ($VideoExtension_2.Length + 1))
|
||||
$MKV_2 = $sourceDirectory_2 + "\" + $MKV_2_name + ".$VideoExtension_2"
|
||||
|
||||
# Now that MKV_2 is defined, we can create the MKVmerge parameters, witch will be common to all merge.
|
||||
$MKVMerge_param_mkv2 = "--no-audio --no-subtitles --no-track-tags --no-global-tags --language 0:$Video_Lang --track-name `"0:$VideoTrackName`" --default-track 0:yes `"$MKV_2`""
|
||||
|
||||
|
||||
|
||||
if (( $NB_Audio_MKV1 -gt 0 ) -and ($NB_Audio_MKV1 -le 2)) {
|
||||
# $NB_Audio_MKV1 = 1 or 2
|
||||
$MKVMerge_audio_param = "--language $AudioTrack_1_ID" + ":$AudioLang_1_sansID --track-name `"$AudioTrack_1_ID" + ":$AudioTrackName_1_sansID`" --default-track $AudioTrack_1_ID" + ":$AudioTrack_1_default_sansID"
|
||||
$track_order = "1:0,0:$AudioTrack_1_ID"
|
||||
if ( $NB_Audio_MKV1 -eq 2 ) {
|
||||
$MKVMerge_audio_param += " --language $AudioTrack_2_ID" + ":$AudioLang_2_sansID --track-name `"$AudioTrack_2_ID" + ":$AudioTrackName_2_sansID`" --default-track $AudioTrack_2_ID" + ":$AudioTrack_2_default_sansID"
|
||||
$track_order += ",0:$AudioTrack_2_ID"
|
||||
}
|
||||
}
|
||||
elseif ($NB_Audio_MKV1 -ne 0) {
|
||||
write-host "Problem with `$NB_Audio_MKV1=$NB_Audio_MKV1.`n`$NB_Audio_MKV1 must be set to : 0, 1 or 2" -ForegroundColor "Red"
|
||||
exit
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( $Internal_SUB_Number -ne 0 ) {
|
||||
|
||||
# Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "$Internal_Sub_1_ID" + ":$SubTrackName_1_sansID"
|
||||
$SubTrackLang_1 = "$Internal_Sub_1_ID" + ":$SubTrackLang_1_sansID"
|
||||
$SubTrack_1_default = "$Internal_Sub_1_ID" + ":$SubTrack_1_default_sansID"
|
||||
$SubTrack_1_forced_track = "$Internal_Sub_1_ID" + ":$SubTrack_1_forced_track_sansID"
|
||||
$SubTrack_1_SDH = "$Internal_Sub_1_ID" + ":$SubTrack_1_SDH_sansID"
|
||||
$sub_charset_1 = "$Internal_Sub_1_ID" + ":$sub_charset_1_sansID"
|
||||
# Define track order
|
||||
$track_order += ",0:$Internal_Sub_1_ID"
|
||||
$subtitle_tracks = "$Internal_Sub_1_ID"
|
||||
$MKVMerge_sub_param = "--sub-charset $sub_charset_1 --language $SubTrackLang_1 --track-name `"$SubTrackName_1`" --default-track $SubTrack_1_default --forced-track $SubTrack_1_forced_track --hearing-impaired-flag $SubTrack_1_SDH"
|
||||
|
||||
if ( $Internal_SUB_Number -ge 2 ) {
|
||||
# Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_2 = "$Internal_Sub_2_ID" + ":$SubTrackName_2_sansID"
|
||||
$SubTrackLang_2 = "$Internal_Sub_2_ID" + ":$SubTrackLang_2_sansID"
|
||||
$SubTrack_2_default = "$Internal_Sub_2_ID" + ":$SubTrack_2_default_sansID"
|
||||
$SubTrack_2_forced_track = "$Internal_Sub_2_ID" + ":$SubTrack_2_forced_track_sansID"
|
||||
$SubTrack_2_SDH = "$Internal_Sub_2_ID" + ":$SubTrack_2_SDH_sansID"
|
||||
$sub_charset_2 = "$Internal_Sub_2_ID" + ":$sub_charset_2_sansID"
|
||||
# Define track order
|
||||
$track_order += ",0:$Internal_Sub_2_ID"
|
||||
$subtitle_tracks += ",$Internal_Sub_2_ID"
|
||||
$MKVMerge_sub_param += " --sub-charset $sub_charset_2 --language $SubTrackLang_2 --track-name `"$SubTrackName_2`" --default-track $SubTrack_2_default --forced-track $SubTrack_2_forced_track --hearing-impaired-flag $SubTrack_2_SDH"
|
||||
}
|
||||
if ( $Internal_SUB_Number -eq 3 ) {
|
||||
# Sub n°3 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_3 = "$Internal_Sub_3_ID" + ":$SubTrackName_3_sansID"
|
||||
$SubTrackLang_3 = "$Internal_Sub_3_ID" + ":$SubTrackLang_3_sansID"
|
||||
$SubTrack_3_default = "$Internal_Sub_3_ID" + ":$SubTrack_3_default_sansID"
|
||||
$SubTrack_3_forced_track = "$Internal_Sub_3_ID" + ":$SubTrack_3_forced_track_sansID"
|
||||
$SubTrack_3_SDH = "$Internal_Sub_3_ID" + ":$SubTrack_3_SDH_sansID"
|
||||
$sub_charset_3 = "$Internal_Sub_3_ID" + ":$sub_charset_3_sansID"
|
||||
# Define track order
|
||||
$track_order += ",0:$Internal_Sub_3_ID"
|
||||
$subtitle_tracks += ",$Internal_Sub_3_ID"
|
||||
$MKVMerge_sub_param += " --sub-charset $sub_charset_3 --language $SubTrackLang_3 --track-name `"$SubTrackName_3`" --default-track $SubTrack_3_default --forced-track $SubTrack_3_forced_track --hearing-impaired-flag $SubTrack_3_SDH"
|
||||
}
|
||||
$subtitle_tracks = "`"$subtitle_tracks`""
|
||||
}
|
||||
|
||||
if ( ( $External_SUB_Number -ne 0 ) -and ( $External_SUB -eq $true ) ) {
|
||||
|
||||
# First external SRT to include
|
||||
$SRT_1_Name = $MKV_1_name + ".$SubExtension_1"
|
||||
$SRT_1 = $sourceDirectory_1 + "\" + $SRT_1_name
|
||||
|
||||
# Subtitles are elsewhere...
|
||||
# $SRT_1_Name = "3_English.srt"
|
||||
# $SRT_1 = $sourceDirectory_1 + "\" + $SRT_1_name
|
||||
# $SRT_1 = $sourceDirectory_1 + "\Subs\" + $MKV_1_name + "\" + $SRT_1_name
|
||||
|
||||
If (-Not (Test-Path $SRT_1) ) {
|
||||
Write-Host "File NON-EXISTANT - $SRT_1" -ForegroundColor "Red"
|
||||
Write-Host "Check the filename or the script. ABORT..." -ForegroundColor "Red"
|
||||
Exit
|
||||
}
|
||||
$track_order += ",$track_order_EXT_sub"
|
||||
|
||||
$MKVMerge_param_srt1 = "--sub-charset $Extsub_charset_1 --language $ExtSubTrackLang_1 --track-name `"$ExtSubTrackName_1`" --default-track $ExtSubTrack_1_default --forced-track $ExtSub_forced_track_1 --hearing-impaired-flag $ExtSub_SDH_1 `"$SRT_1`""
|
||||
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
# Second external SRT to include
|
||||
$SRT_2_Name = $MKV_1_name + ".$SubExtension_2"
|
||||
$SRT_2 = $sourceDirectory_1 + "\" + $SRT_2_name
|
||||
|
||||
# Subtitles are elsewhere...
|
||||
# $SRT_2_Name = "3_English.srt"
|
||||
# $SRT_2 = $sourceDirectory_1 + "\" + $SRT_2_name
|
||||
# $SRT_2 = $sourceDirectory_1 + "\Subs\" + $MKV_1_name + "\" + $SRT_2_name
|
||||
|
||||
$MKVMerge_param_srt2 = "--sub-charset $Extsub_charset_2 --language $ExtSubTrackLang_2 --track-name `"$ExtSubTrackName_2`" --default-track $ExtSubTrack_2_default --forced-track $ExtSub_forced_track_2 --hearing-impaired-flag $ExtSub_SDH_2 `"$SRT_2`""
|
||||
}
|
||||
}
|
||||
|
||||
$MKVMerge_param_start = "--output `"$Output`" --title `"$VideoTrackName`" --track-order `"$track_order`""
|
||||
|
||||
if ( $Internal_SUB_Number -eq 0 ) {
|
||||
$MKVMerge_param_start += " --no-subtitles"
|
||||
}
|
||||
else {
|
||||
# Part for internal subtitles
|
||||
$MKVMerge_param_start += " --subtitle-tracks $subtitle_tracks"
|
||||
}
|
||||
|
||||
|
||||
if ($merge_another_video_MKV2 -eq $false) {
|
||||
# Video is from MKV_1
|
||||
$MKVMerge_param_start += " --track-name `"$VideoTrack_ID" + ":$VideoTrackName`" --default-track $VideoTrack_ID" + ":yes --language $VideoTrack_ID" + ":$Video_Lang"
|
||||
}
|
||||
else {
|
||||
# If Video is from MKV_2, we don't want the video from MKV_1 added...
|
||||
$MKVMerge_param_start += " --no-video"
|
||||
}
|
||||
|
||||
|
||||
if ( $no_attachements -eq $true ) {
|
||||
$MKVMerge_param_start += " --no-attachments"
|
||||
}
|
||||
|
||||
if ( $Internal_SUB_Number -ne 0 ) {
|
||||
# Part for internal subtitles
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param $MKVMerge_sub_param `"$MKV_1`""
|
||||
}
|
||||
else {
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param `"$MKV_1`""
|
||||
}
|
||||
|
||||
$MKVMerge_param_all = "$MKVMerge_param_start $MKVMerge_param_mkv1"
|
||||
|
||||
if ( $merge_another_video_MKV2 -eq $true ) {
|
||||
$MKVMerge_param_all += " $MKVMerge_param_mkv2"
|
||||
}
|
||||
|
||||
if ( ( $External_SUB_Number -ne 0 ) -and ( $External_SUB -eq $true ) ) {
|
||||
$MKVMerge_param_all += " $MKVMerge_param_srt1"
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
$MKVMerge_param_all += " $MKVMerge_param_srt2"
|
||||
}
|
||||
}
|
||||
|
||||
# Write-Host "`$MKVMerge_param_start = $MKVMerge_param_start" -ForegroundColor "White"
|
||||
# Write-Host "`$MKVMerge_param_mkv1 = $MKVMerge_param_mkv1" -ForegroundColor "White"
|
||||
# Write-Host "`$MKVMerge_param_all = $MKVMerge_param_all" -ForegroundColor "White"
|
||||
Write-Host "`tRecap. of all language tracks :" -ForegroundColor "Cyan"
|
||||
Write-Host "`t`t- Video lang will be : $Video_Lang" -ForegroundColor "Cyan"
|
||||
Write-Host "`t`t- Audio 1 lang will be : $AudioLang_1_sansID`t`tand name = $AudioTrackName_1_sansID" -ForegroundColor "Cyan"
|
||||
if ($NB_Audio_MKV1 -eq 2) {
|
||||
Write-Host "`t`t- Audio 2 lang will be : $AudioLang_2_sansID`t`tand name = $AudioTrackName_2_sansID" -ForegroundColor "Cyan"
|
||||
}
|
||||
if ($Internal_SUB_Number -ge 1) {
|
||||
Write-Host "`t`t- Internal Sub 1 lang will be : $SubTrackLang_1_sansID`tand name = $SubTrackName_1_sansID" ( &{ If ( ($SubTrack_1_SDH_sansID -eq "yes") -eq $true) { "`tFlagged with SDH (--hearing-impaired-flag)" } }) -ForegroundColor "Cyan"
|
||||
if ($Internal_SUB_Number -ge 2) {
|
||||
Write-Host "`t`t- Internal Sub 2 lang will be : $SubTrackLang_2_sansID`tand name = $SubTrackName_2_sansID" ( &{ If ( ($SubTrack_2_SDH_sansID -eq "yes") -eq $true) { "`tFlagged with SDH (--hearing-impaired-flag)" } }) -ForegroundColor "Cyan"
|
||||
if ($Internal_SUB_Number -eq 3) {
|
||||
Write-Host "`t`t- Internal Sub 3 lang will be : $SubTrackLang_3_sansID`tand name = $SubTrackName_3_sansID" ( &{ If ( ($SubTrack_3_SDH_sansID -eq "yes") -eq $true) { "`tFlagged with SDH (--hearing-impaired-flag)" } }) -ForegroundColor "Cyan"
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($External_SUB -eq $true) {
|
||||
Write-Host "`t`t- External Sub 1 lang will be : $($ExtSubTrackLang_1 -replace '0:', '')`tand name = $($ExtSubTrackName_1 -replace '0:', '')" ( &{ If ( ($ExtSub_SDH_1 -match "yes") -eq $true) { "`tFlagged with SDH (--hearing-impaired-flag)" } }) -ForegroundColor "Cyan"
|
||||
if ($External_SUB_Number -eq 2) {
|
||||
Write-Host "`t`t- External Sub 2 lang will be : $($ExtSubTrackLang_2 -replace '0:', '')`tand name = $($ExtSubTrackName_1 -replace '0:', '')" ( &{ If ( ($ExtSub_SDH_2 -match "yes") -eq $true) { "`tFlagged with SDH (--hearing-impaired-flag)" } }) -ForegroundColor "Cyan"
|
||||
}
|
||||
}
|
||||
|
||||
# Last step to command construction
|
||||
$command = "& $MKVMerge $MKVMerge_param_all"
|
||||
# Launch begin...
|
||||
Invoke-Expression $command
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Fin du traitement du fichier n° $compteur / $Count_1.`n" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
If (-Not (Test-Path $Output) ) {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
else {
|
||||
if ( $move_mkv1_after_merge -eq $true ) {
|
||||
Move-Item -Path $MKV_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $External_SUB -eq $true ) {
|
||||
Move-Item -Path $SRT_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
Move-Item -Path $SRT_2 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ( $move_mkv2_after_merge -eq $true ) -And ( $merge_another_video_MKV2 -eq $true) ) {
|
||||
Move-Item -Path $MKV_2 -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
}
|
||||
}
|
||||
|
||||
$compteur++
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,479 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer deux MKV en gardant l'audio et le(s) sous-titre du premier ou un sous-titre ##
|
||||
## externe, et seulement la vidéo du second MKV ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
Clear-Host
|
||||
Invoke-Command -ScriptBlock {
|
||||
|
||||
# Set MKVMerge.exe Path
|
||||
$MKVMerge = "`"PATH_TO\mkvtoolnix\mkvmerge.exe`""
|
||||
# For the parameters to pass to MKVMerge executable, will be construct
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory_1 = "PATH_TO_SOURCE_1"
|
||||
$sourceDirectory_2 = "PATH_TO_SOURCE_2"
|
||||
$destinationDirectory = "PATH_TO_DESTINATION"
|
||||
|
||||
# Rename output file with this settings :
|
||||
# Use https://regex101.com/r/cU5lC2/1 to get the RegEx
|
||||
$chain_to_search = ''
|
||||
# $chain_to_search = '(\w+)\.S(\d{2})E(\d{2}).(.*)H264(.*)'
|
||||
# $chain_to_search = '(\w+)\.S(\d{2})E(\d{2})(.*)1080p.(.*)H.264(.*)'
|
||||
$chain__to_replace = ''
|
||||
# $chain__to_replace = '$1 - S$2E$3 - $4x265-10bits$5--Reencoded'
|
||||
# $chain__to_replace = '$1 (2021) - S$2E$3 - 1080p.$5x265-10bits$6--Reencoded'
|
||||
|
||||
# The filenames must be like : blabla.S00E00.blabla.H.264.blabla
|
||||
# They will be renamed to : blabla - S00E00 - blabla.x265-10bits.blabla--Reencoded
|
||||
# If you don't want the rename to be made, juste set to '' the variables.
|
||||
|
||||
# If there is no internal subtitles to keep :
|
||||
# Set to $false for no internal subtitle
|
||||
# Set to $true for one or more internal subtitles
|
||||
$Internal_SUB = $true
|
||||
|
||||
# Is there an external subtitle ? Set the number of .SRT (0 - 2)
|
||||
# It's exclusive, no internal SUB will be proceed..
|
||||
$NB_External_SUB = 0
|
||||
|
||||
# Extension without the .
|
||||
$MkvExtension = "mkv"
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension_1 = 'eng.srt'
|
||||
$SubExtension_2 = 'fre.srt'
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
# Move MKV1 (and SRT) to Not-Merged folder ? Set to $false or $true
|
||||
$move_mkv1_after_merge = $true
|
||||
# Move MKV2 (and SRT) to Not-Merged folder ? Set to $false or $true
|
||||
$move_mkv1_after_merge = $true
|
||||
|
||||
# Initialization for those 3 variables, do not change them !
|
||||
$MKVMerge_sub_param = ""
|
||||
$MKVMerge_audio_param = ""
|
||||
$subtitle_tracks = ""
|
||||
# ##################
|
||||
|
||||
#### FILE 1 - Keeping all but the video
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:English - DDP 5.1"
|
||||
$AudioLang_1 = "1:eng"
|
||||
$AudioTrack_1_default = "1:yes"
|
||||
# Define track order. Do not modify it unless you changed the track number in this section
|
||||
$track_order = "1:0,0:1"
|
||||
# $MKVMerge_audio_param = '--language', "$AudioLang_1", '--track-name', "$AudioTrackName_1", '--default-track', "$AudioTrack_1_default"
|
||||
$MKVMerge_audio_param = "--language $AudioLang_1 --track-name `"$AudioTrackName_1`" --default-track $AudioTrack_1_default"
|
||||
|
||||
# # Track 2 = Audio n°2
|
||||
# # Name and language of Audio Track n°2
|
||||
# $AudioTrackName_1 = "2:English - DDP 5.1"
|
||||
# $AudioLang_1 = "2:en"
|
||||
# $AudioTrack_1_default = "2:yes"
|
||||
# # Define track order. Do not modify it unless you changed the track number in this section
|
||||
# $track_order = "1:0,0:1,0:2"
|
||||
# $MKVMerge_audio_param += "--language $AudioLang_2 --track-name `"$AudioTrackName_2`" --default-track $AudioTrack_2_default"
|
||||
|
||||
##########################################
|
||||
#### FILE 2 - MKV - Keeping only the video
|
||||
#### $file_2_options = "--no-audio --no-track-tags --no-global-tags"
|
||||
|
||||
if ( $NB_External_SUB -ne 0 ) {
|
||||
# ================== EXTERNAL SUBTITLE ==================
|
||||
# Must have the same name as MKV1
|
||||
####
|
||||
#### FILE 3 - SRT - Keeping all but the video (audio + chapters tags)
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_1 = "0:English - SRT"
|
||||
$ExtSubTrackLang_1 = "0:eng"
|
||||
$ExtSubTrack_1_default = "0:yes"
|
||||
$ExtSub_charset_1 = "0:UTF-8"
|
||||
# Define track order
|
||||
$track_order += ",2:0"
|
||||
####
|
||||
#### FILE 4 - SRT - Keeping all but the video (audio + chapters tags)
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_2 = "0:Français - SRT"
|
||||
$ExtSubTrackLang_2 = "0:fr"
|
||||
$ExtSubTrack_2_default = "0:no"
|
||||
$ExtSub_charset_2 = "0:UTF-8"
|
||||
# Define track order
|
||||
if ( $NB_External_SUB -eq 2 ) {
|
||||
$track_order += ",3:0"
|
||||
}
|
||||
}
|
||||
else {
|
||||
# ================== INTERNAL SUBTITLES ==================
|
||||
if ( $Internal_SUB -eq $true ) {
|
||||
# Track 2 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
# $SubTrackName_1 = "2:English - SRT"
|
||||
# $SubTrackLang_1 = "2:en"
|
||||
# $SubTrack_1_default = "2:yes"
|
||||
# $sub_charset_1 = "2:UTF-8"
|
||||
# # Define track order
|
||||
# $track_order += ",0:2"
|
||||
# $subtitle_tracks = "2"
|
||||
# # $MKVMerge_sub_param = '--sub-charset', "$sub_charset_1", '--language', "$SubTrackLang_1", '--track-name', "$SubTrackName_1", '--default-track', "$SubTrack_1_default"
|
||||
# $MKVMerge_sub_param = "--sub-charset $sub_charset_1 --language $SubTrackLang_1 --track-name `"$SubTrackName_1`" --default-track $SubTrack_1_default"
|
||||
|
||||
# Track 3 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_2 = "3:English SDH - SRT"
|
||||
$SubTrackLang_2 = "3:eng"
|
||||
$SubTrack_2_default = "3:yes"
|
||||
$sub_charset_2 = "3:UTF-8"
|
||||
# Define track order
|
||||
$track_order += ",0:3"
|
||||
$subtitle_tracks = "3"
|
||||
$MKVMerge_sub_param += "--sub-charset $sub_charset_2 --language $SubTrackLang_2 --track-name `"$SubTrackName_2`" --default-track $SubTrack_2_default"
|
||||
####
|
||||
}
|
||||
else {
|
||||
# No internal subtitles are to be kept...
|
||||
$MKVMerge_sub_param = ""
|
||||
}
|
||||
}
|
||||
## End of part where there is something to change !
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_2 = $sourceDirectory_2 + "\Not-Merged"
|
||||
If (!(test-path $Path_Folder_NotMerged_2)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged_2 -Verbose
|
||||
}
|
||||
else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_1 = $sourceDirectory_1 + "\Not-Merged"
|
||||
If (!(test-path $Path_Folder_NotMerged_1)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged_1 -Verbose
|
||||
}
|
||||
else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
#Process
|
||||
$MKV_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1 = $MKV_1_List.count
|
||||
Write-Host "$Count_1 MKV's to be processed in $sourceDirectory_1."
|
||||
|
||||
$MKV_2_List = Get-ChildItem $sourceDirectory_2 -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2 = $MKV_2_List.count
|
||||
Write-Host "$Count_2 MKV's to be processed in $sourceDirectory_2."
|
||||
|
||||
# #########################
|
||||
# Check if there is the same number of .srt files as .mkv files
|
||||
if ( $NB_External_SUB -ne 0 ) {
|
||||
if ( $NB_External_SUB -ge 1 ) {
|
||||
# If $NB_External_SUB >= 1 (include =1 and =2)
|
||||
$SRT_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_1" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1_SRT = $SRT_1_List.count
|
||||
Write-Host "$Count_1 MKV's to be processed and $Count_1_SRT SRT's to be processed in $sourceDirectory_1."
|
||||
if ($Count_1 -eq $Count_1_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°1 files in this folder. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV and SRT n°1 files isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
if ( $NB_External_SUB -eq 2 ) {
|
||||
# Only if $NB_External_SUB = 2
|
||||
$SRT_2_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_2" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2_SRT = $SRT_2_List.count
|
||||
if ($Count_1 -eq $Count_2_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°2 files in this folder. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV and SRT n°2 files isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
}
|
||||
# #########################
|
||||
|
||||
# #########################
|
||||
# Check if there is the same .mkv files in both source directory
|
||||
if ($Count_1 -eq $Count_2) {
|
||||
Write-Host "There is the same number of MKV in the two sources folders. Let's continue."
|
||||
}
|
||||
else {
|
||||
Write-Host "The number of MKV in the two sources folders isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
# if (!($Count_1 -eq ($filename_ep_final - $filename_ep_start + 1))) {
|
||||
# Write-Host "The number of episodes set in the script isn't the same as the number of files in the folders... EXITING NOW !" -foreground "red"
|
||||
# Exit
|
||||
# }
|
||||
# #########################
|
||||
$compteur = 1
|
||||
|
||||
# for ($i = $filename_ep_start; $i -lt $filename_ep_final+1; $i++) {
|
||||
Foreach ($MKV_1 in $MKV_1_List) {
|
||||
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "Traitement du fichier n° $compteur / $Count_1..." -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
# Genreating Files Name & Video Title
|
||||
# format = filename_1_part_1 + S + filename_season + E + i_counter + filename_1_part_2 + .mkv
|
||||
# format = filename_2_part_1 + S + filename_season + E + i_counter + filename_2_part_2 + .mkv
|
||||
$FormatName_1 = (Get-Item $MKV_1).Basename
|
||||
$MKV_1_name = $FormatName_1.ToString()
|
||||
|
||||
$MKV_2_file = get-ChildItem $sourceDirectory_2 -recurse | where { $_.name -like "*$MKV_1_name*" } | select name
|
||||
|
||||
# Faire test si count = 1 -> ok Sinon soucis !
|
||||
|
||||
$FormatName_2 = $MKV_2_file.Name.ToString()
|
||||
$MKV_2_name = $FormatName_2.Substring(0, $FormatName_2.Length - ($MkvExtension.Length + 1))
|
||||
$MKV_2 = $sourceDirectory_2 + "\" + $MKV_2_name + ".$MkvExtension"
|
||||
|
||||
# Title for the video track and for the destination file
|
||||
$VideoTrackName = $MKV_1_name
|
||||
if ( $set_year_with_brackets -eq $true ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '(\d{4}(?=.*S\d{2}E\d{2}))', '($1)'
|
||||
}
|
||||
if ( $remove_dots -eq $true ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '\.(?=.*S\d{2}E\d{2})', ' '
|
||||
}
|
||||
$VideoTrackName = $VideoTrackName -replace $chain_to_search, $chain__to_replace
|
||||
$VideoTrackName = "$VideoTrackName"
|
||||
Write-Host "`tThe Video Track Name will be : `r`n`t`t $VideoTrackName" -ForegroundColor "green"
|
||||
if ( $compteur -le 3 ) {
|
||||
# Will prompt for a key to be pressed for the 3 first names
|
||||
Write-Host "`tFor the 3 first file, this will show up, and pause for 10s" -ForegroundColor "yellow";
|
||||
Start-Sleep -Seconds 10
|
||||
}
|
||||
|
||||
#########################################################
|
||||
# Exceptions for some files with other than 2 SRT inside
|
||||
# You must copy paste the default entries set in the begining of this script in the Default section
|
||||
switch ($MKV_1_name) {
|
||||
"MY_FILE_WITH_EXCEPTION" {
|
||||
# # ================== AUDIO ==================
|
||||
# # Track 1 = Audio n°1
|
||||
# # Name and language of Audio Track n°1
|
||||
# $AudioTrackName_1 = "1:English - DDP 5.1"
|
||||
# $AudioLang_1 = "1:en"
|
||||
# $AudioTrack_1_default = "1:yes"
|
||||
|
||||
# # Only One subtitle track : n°2
|
||||
# $SubTrackName_1 = "3:English SDH - SRT"
|
||||
# $SubTrackLang_1 = "3:en"
|
||||
# $SubTrack_1_default = "3:yes"
|
||||
# $sub_charset_1 = "3:UTF-8"
|
||||
# # Define track order
|
||||
# $track_order = "1:0,0:1,0:3"
|
||||
# # Define subtitles track to keep
|
||||
# $subtitle_tracks = "3"
|
||||
|
||||
$VideoTrackName = "Defiance - S03E01-E02 - 720p.HDTV.x265-10bits-DIMENSION--Reencoded"
|
||||
break
|
||||
}
|
||||
"MY_FILE_WITH_EXCEPTION_2" {
|
||||
# # Track 1 = Audio n°1
|
||||
# # Name and language of Audio Track n°1
|
||||
# $AudioTrackName_1 = "1:English - AAC 2.0"
|
||||
# $AudioLang_1 = "1:en"
|
||||
# $AudioTrack_1_default = "1:yes"
|
||||
|
||||
# # Only One subtitle track : n°2
|
||||
# $SubTrackName_1 = "2:English - SRT"
|
||||
# $SubTrackLang_1 = "2:en"
|
||||
# $SubTrack_1_default = "2:yes"
|
||||
# $sub_charset_1 = "2:UTF-8"
|
||||
# # Define track order
|
||||
# $track_order = "1:0,0:1,0:2"
|
||||
# # Define subtitles track to keep
|
||||
# $subtitle_tracks = "2"
|
||||
|
||||
$VideoTrackName = "Defiance - S02S02E12-E13 - PROPER.720p.HDTV.x265-10bits-KILLERS--Reencoded"
|
||||
|
||||
break
|
||||
}
|
||||
#Default state
|
||||
Default {
|
||||
# If not an exception, we don't want to modify the variables
|
||||
# $SubTrackName_1 = "3:English SDH - SRT"
|
||||
# $SubTrackLang_1 = "3:eng"
|
||||
# $SubTrack_1_default = "3:yes"
|
||||
# $sub_charset_1 = "3:UTF-8"
|
||||
# # Define track order
|
||||
# $track_order = "1:0,0:1,0:3"
|
||||
# # Define subtitles track to keep
|
||||
# $subtitle_tracks = "3"
|
||||
break
|
||||
}
|
||||
}
|
||||
#########################################################
|
||||
|
||||
# Set Output File Name
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
}
|
||||
elseif ($merged_SUFFIX_name -eq "False") {
|
||||
# $Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
$Output = "$destinationDirectory" + "\" + "$VideoTrackName" + ".mkv"
|
||||
}
|
||||
else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -ForegroundColor "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -ForegroundColor "white"
|
||||
Exit
|
||||
}
|
||||
# write-host "Output file will be :" -ForegroundColor "white"
|
||||
# write-host "$Output" -ForegroundColor "white"
|
||||
# write-host "--" -ForegroundColor "white"
|
||||
|
||||
if ( $NB_External_SUB -ne 0 ) {
|
||||
|
||||
# First external SRT to include
|
||||
$SRT_1_Name = $MKV_1_name + ".$SubExtension_1"
|
||||
$SRT_1 = $sourceDirectory_1 + "\" + $SRT_1_name
|
||||
|
||||
$MKVMerge_param_start = "--output `"$Output`" --title `"$VideoTrackName`" --track-order `"$track_order`" --no-video --no-subtitles"
|
||||
if ( $no_attachements -eq $true ) {
|
||||
$MKVMerge_param_start += " --no-attachments"
|
||||
}
|
||||
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param `"$MKV_1`""
|
||||
$MKVMerge_param_mkv2 = "--no-audio --no-track-tags --no-global-tags --language 0:en --track-name `"0:$VideoTrackName`" --default-track 0:yes --no-subtitles --no-audio `"$MKV_2`""
|
||||
|
||||
$MKVMerge_param_srt1 = "--sub-charset $Extsub_charset_1 --language $ExtSubTrackLang_1 --track-name `"$ExtSubTrackName_1`" --default-track $ExtSubTrack_1_default `"$SRT_1`""
|
||||
|
||||
$MKVMerge_param_srt_all = "$MKVMerge_param_srt1"
|
||||
|
||||
if ( $NB_External_SUB -eq 2 ) {
|
||||
# Second external SRT to include
|
||||
$SRT_2_Name = $MKV_1_name + ".$SubExtension_2"
|
||||
$SRT_2 = $sourceDirectory_1 + "\" + $SRT_2_name
|
||||
|
||||
$MKVMerge_param_srt2 = "--sub-charset $Extsub_charset_2 --language $ExtSubTrackLang_2 --track-name `"$ExtSubTrackName_2`" --default-track $ExtSubTrack_2_default `"$SRT_2`""
|
||||
$MKVMerge_param_srt_all += " $MKVMerge_param_srt2"
|
||||
}
|
||||
|
||||
$MKVMerge_param_all = "$MKVMerge_param_start $MKVMerge_param_mkv1 $MKVMerge_param_mkv2 $MKVMerge_param_srt_all"
|
||||
|
||||
}
|
||||
else {
|
||||
# INTERNAL SUB to keep
|
||||
$MKVMerge_param_start = "--output `"$Output`" --title `"$VideoTrackName`" --track-order `"$track_order`" --subtitle-tracks $subtitle_tracks --no-video"
|
||||
if ( $Internal_SUB -eq $true ) {
|
||||
# There is some internal subtitles to keep
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param $MKVMerge_sub_param `"$MKV_1`""
|
||||
}
|
||||
else {
|
||||
# There is no internal subtitles to keep
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param `"$MKV_1`""
|
||||
}
|
||||
$MKVMerge_param_mkv2 = "--no-audio --no-track-tags --no-global-tags --language 0:en --track-name `"0:$VideoTrackName`" --default-track 0:yes --no-subtitles --no-audio `"$MKV_2`""
|
||||
|
||||
$MKVMerge_param_all = "$MKVMerge_param_start $MKVMerge_param_mkv1 $MKVMerge_param_mkv2"
|
||||
|
||||
# ##################
|
||||
# Debug
|
||||
# Write-Host "$MKVMerge_param_start" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "$MKVMerge_audio_param" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "$MKVMerge_sub_param" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "$MKVMerge_param_mkv2" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "$MKVMerge_param_all" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# Write-Host "Commande qui sera lancée :" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
|
||||
# Write-Host "& $MKVMerge" "$MKVMerge_param_all" -ForegroundColor "black" -BackgroundColor "DarkGray"
|
||||
# ##################
|
||||
}
|
||||
|
||||
# Last step to command construction
|
||||
$command = "& $MKVMerge $MKVMerge_param_all"
|
||||
# Launch begin...
|
||||
Invoke-Expression $command
|
||||
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "Fin du traitement du fichier n° $compteur / $Count_1." -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
if ( $move_mkv1_after_merge -eq $true ) {
|
||||
Move-Item -Path $MKV_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $NB_External_SUB -ne 0 ) {
|
||||
Move-Item -Path $SRT_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $NB_External_SUB -eq 2 ) {
|
||||
Move-Item -Path $SRT_2 -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( $move_mkv2_after_merge -eq $true ) {
|
||||
Move-Item -Path $MKV_2 -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
}
|
||||
}
|
||||
Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
$compteur++
|
||||
}
|
||||
|
||||
|
||||
|
||||
# ##############################
|
||||
# Command History
|
||||
#
|
||||
# internal Subtitles :
|
||||
# two subtiles to keep :
|
||||
#& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" --subtitle-tracks "$subtitle_tracks" -o "$Output" --no-video --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default" "$MKV_1" --no-audio --no-track-tags --no-global-tags --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --no-subtitles --no-audio "$MKV_2"
|
||||
|
||||
# Only one subtitles to keep
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" --subtitle-tracks "$subtitle_tracks" -o "$Output" --no-video --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" "$MKV_1" --no-audio --no-track-tags --no-global-tags --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --no-subtitles --no-audio "$MKV_2"
|
||||
#
|
||||
#
|
||||
# External Subtitles
|
||||
# # 1 SRT
|
||||
# & $MKVMerge --output "$Output" --title "$VideoTrackName" --track-order "$track_order" --no-video --no-subtitles --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" "$MKV_1" --no-audio --no-track-tags --no-global-tags --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" "$MKV_2" --sub-charset "$Extsub_charset_1" --language "$ExtSubTrackLang_1" --track-name "$ExtSubTrackName_1" --default-track "$ExtSubTrack_1_default" "$SRT_1"
|
||||
#
|
||||
# # 2 SRTs
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --no-video --no-subtitles --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" "$MKV_1" --no-audio --no-track-tags --no-global-tags --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" "$MKV_2" --sub-charset "$ExtSub_charset_1" --language "$ExtSubTrackLang_1" --track-name "$ExtSubTrackName_1" --default-track "$ExtSubTrack_1_default" "$SRT_1" --sub-charset "$ExtSub_charset_2" --language "$ExtSubTrackLang_2" --track-name "$ExtSubTrackName_2" --default-track "$ExtSubTrack_2_default" "$SRT_2"
|
||||
|
||||
}
|
332
Scripts-Divers/Batch Remove Sub but all selected.ps1
Normal file
@ -0,0 +1,332 @@
|
||||
# ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
|
||||
# │ Powershell Script │
|
||||
# │ │
|
||||
# │ Objective : to keep up to 2 internal subtiles form a MKV and adding 1 or 2 external SRT. │
|
||||
# │ │
|
||||
# │ Configure : │
|
||||
# │ - the Audio_ variables │
|
||||
# │ - the ExtSubTrack_ variables │
|
||||
# │ - All variables before the function Get-SubID │
|
||||
# │ - The Track ID in the function Get-SubID + the filename for those track ID │
|
||||
# └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
|
||||
|
||||
|
||||
Clear-Host
|
||||
|
||||
# Set MKVMerge.exe Path
|
||||
$MKVMerge = "`"H:\z_MKV\mkvtoolnix\mkvmerge.exe`""
|
||||
# For the parameters to pass to MKVMerge executable, will be construct
|
||||
|
||||
$sourceDirectory_1 = "PATH_TO_SOURCE_1"
|
||||
$destinationDirectory = "PATH_TO_DESTINATION"
|
||||
|
||||
# Remove dots before the season or the resolution ?
|
||||
$remove_dots = $true
|
||||
# If there is the year in the title, set it to $true
|
||||
$set_year_with_brackets = $false
|
||||
# $chain_to_search = ''
|
||||
# $chain__to_replace = ''
|
||||
$chain_to_search = '(.*) S(\d{2})E(\d{2}).(.*)'
|
||||
$chain__to_replace = '$1 - S$2E$3 - $4--Custom'
|
||||
|
||||
# Move MKV1 (and SRT) to Not-Merged folder ? Set to $false or $true
|
||||
$move_mkv1_after_merge = $true
|
||||
|
||||
# ================== AUDIO ================== Common for all videos
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Japonais - AAC 2.0"
|
||||
$AudioLang_1 = "1:ja" # en for english / fr for french / ja for japanese
|
||||
$AudioTrack_1_default = "1:yes"
|
||||
# Define track order. Do not modify it unless you changed the track number in this section
|
||||
$track_order = "0:0,0:1"
|
||||
|
||||
# ================================================================
|
||||
|
||||
# To keep or not internal subtitles
|
||||
$keep_internal_Sub = $false
|
||||
# NOTE : Internal SUB always came first in the track order !
|
||||
|
||||
# ===========================================
|
||||
# ================== Internal SUB ? =========
|
||||
$Internal_SUB_Number = 2 # Works only if $External_SUB = $true
|
||||
# Max 2 Internal SRT is configured in the script.
|
||||
# If set to 2, must be 2 SRT configured
|
||||
$SubTrackName_1 = "Français - SRT"
|
||||
$SubTrackLang_1 = "fr" # en for english / fr for french / jp for japanese
|
||||
$SubTrack_1_default = "yes"
|
||||
$sub_charset_1 = "UTF-8"
|
||||
|
||||
$SubTrackName_2 = "English SDH - SRT"
|
||||
$SubTrackLang_2 = "en" # en for english / fr for french / jp for japanese
|
||||
$SubTrack_2_default = "no"
|
||||
$sub_charset_2 = "UTF-8"
|
||||
|
||||
# ===========================================
|
||||
|
||||
|
||||
# ===========================================
|
||||
# ================== External SUB ? =========
|
||||
# Must have the same name as MKV1
|
||||
$External_SUB = $true
|
||||
$External_SUB_Number = 1 # Works only if $External_SUB = $true
|
||||
# Max 2 External SRT is configured in the script.
|
||||
# If set to 2, must be 2 SRT configured
|
||||
# Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension_1 = 'fre.srt'
|
||||
$SubExtension_2 = 'fre.srt'
|
||||
|
||||
#### FILE 2 - SRT_1 - Keeping all but the video (audio + chapters tags)
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_1 = "0:Français - SRT"
|
||||
$ExtSubTrackLang_1 = "0:fr"
|
||||
$ExtSubTrack_1_default = "0:yes"
|
||||
$ExtSub_charset_1 = "0:UTF-8"
|
||||
|
||||
#### FILE 3 - SRT_2 - Keeping all but the video (audio + chapters tags)
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$ExtSubTrackName_2 = "0:Français - SRT"
|
||||
$ExtSubTrackLang_2 = "0:fr"
|
||||
$ExtSubTrack_2_default = "0:no"
|
||||
$ExtSub_charset_2 = "0:UTF-8"
|
||||
|
||||
# Define track order - DO NOT TOUCH
|
||||
$track_order_EXT_sub = ""
|
||||
if ( $External_SUB -eq $true ) {
|
||||
if ( $External_SUB_Number -eq 1 ) {
|
||||
$track_order_EXT_sub += ",1:0"
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
$track_order_EXT_sub += ",2:0"
|
||||
}
|
||||
}
|
||||
}
|
||||
# ===========================================
|
||||
|
||||
function Get-SubID { # FOR INTERNAL SUB !
|
||||
param ( # sub_1_id for 1st sub to keep
|
||||
$file_name # sub_2_id for 2nd sub to keep
|
||||
)
|
||||
|
||||
switch ($file_name)
|
||||
{
|
||||
"FILE1"
|
||||
{
|
||||
$sub_1_id = "4"
|
||||
$sub_2_id = "5"
|
||||
break
|
||||
}
|
||||
"FILE2"
|
||||
{
|
||||
$sub_1_id = "5"
|
||||
$sub_2_id = "6"
|
||||
break
|
||||
}
|
||||
#Default state
|
||||
Default
|
||||
{
|
||||
Write-Host "This file is not set in the script : $file_name" -ForegroundColor "red"
|
||||
Write-Host "End of script..." -ForegroundColor "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
return $sub_1_id, $sub_2_id
|
||||
}
|
||||
|
||||
#Process
|
||||
$MKV_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1 = $MKV_1_List.count
|
||||
Write-Host "$Count_1 MKV's to be processed in $sourceDirectory_1."
|
||||
|
||||
# Testing if the Done_Remerged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_1 = $sourceDirectory_1 + "\Done_Remerged"
|
||||
If(!(test-path $Path_Folder_NotMerged_1)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged_1 -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
# #########################
|
||||
# Check if there is the same number of .srt files as .mkv files
|
||||
if ( $External_SUB -eq $true ) {
|
||||
if ( $External_SUB_Number -ge 1 ) { # If $NB_External_SUB >= 1 (include =1 and =2)
|
||||
$SRT_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_1" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1_SRT = $SRT_1_List.count
|
||||
Write-Host "$Count_1_SRT SRT's ($SubExtension_1) to be processed in $sourceDirectory_1."
|
||||
if ($Count_1 -eq $Count_1_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°1 files ($SubExtension_1) in this folder. Let's continue."
|
||||
} else {
|
||||
Write-Host "The number of MKV and SRT n°1 files isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
if ( $External_SUB_Number -eq 2 ) { # Only if $External_SUB_Number = 2
|
||||
$SRT_2_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension_2" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2_SRT = $SRT_2_List.count
|
||||
Write-Host "$Count_2_SRT SRT's ($SubExtension_2) to be processed in $sourceDirectory_1."
|
||||
|
||||
if ($Count_1 -eq $Count_2_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT n°2 files ($SubExtension_2) in this folder. Let's continue."
|
||||
} else {
|
||||
Write-Host "The number of MKV and SRT n°2 files ($SubExtension_2) isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
}
|
||||
# #########################
|
||||
|
||||
$compteur = 1
|
||||
|
||||
Foreach ($MKV_1 in $MKV_1_List) {
|
||||
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "Traitement du fichier n° $compteur / $Count_1..." -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
# Clear variables
|
||||
$MKVMerge_param_start = ""
|
||||
$MKVMerge_param_mkv1 = ""
|
||||
$MKVMerge_param_srt1 = ""
|
||||
$MKVMerge_param_srt2 = ""
|
||||
$MKVMerge_param_all = ""
|
||||
$MKVMerge_sub_param = ""
|
||||
$SRT_1_Name = ""
|
||||
$SRT_2_Name = ""
|
||||
$SRT_1 = ""
|
||||
$SRT_2 = ""
|
||||
|
||||
$FormatName_1 = (Get-Item $MKV_1).Basename
|
||||
$MKV_1_name = $FormatName_1.ToString()
|
||||
|
||||
# Title for the video track and for the destination file
|
||||
$VideoTrackName = $MKV_1_name
|
||||
if ( $set_year_with_brackets -eq $true ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '(\d{4}(?=.*S\d{2}E\d{2}))', '($1)'
|
||||
}
|
||||
if ( $remove_dots -eq $true ) {
|
||||
$VideoTrackName = $VideoTrackName -replace '\.(?=.*S\d{2}E\d{2})', ' '
|
||||
}
|
||||
$VideoTrackName = $VideoTrackName -replace $chain_to_search, $chain__to_replace
|
||||
$VideoTrackName = "$VideoTrackName"
|
||||
Write-Host "`tThe Video Track Name will be : `r`n`t`t $VideoTrackName" -ForegroundColor "green"
|
||||
|
||||
$Output = "$destinationDirectory" + "\" + "$VideoTrackName" + ".mkv"
|
||||
|
||||
|
||||
# DO NOT TOUCH - Common for all files
|
||||
$MKVMerge_audio_param = "--language $AudioLang_1 --track-name `"$AudioTrackName_1`" --default-track $AudioTrack_1_default"
|
||||
|
||||
if (( $keep_internal_Sub -eq $true ) -and ( $Internal_SUB_Number -ne 0 )) {
|
||||
|
||||
$sub_1_id, $sub_2_id = Get-SubID $MKV_1_name
|
||||
|
||||
# Track 2 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = $sub_1_id + ":$SubTrackName_1"
|
||||
$SubTrackLang_1 = $sub_1_id + ":$SubTrackLang_1"
|
||||
$SubTrack_1_default = $sub_1_id + ":$SubTrack_1_default"
|
||||
$sub_charset_1 = $sub_1_id + ":$sub_charset_1"
|
||||
# Define track order
|
||||
$track_order += ",0:" + $sub_1_id
|
||||
$subtitle_tracks = "$sub_1_id"
|
||||
$MKVMerge_sub_param = "--sub-charset $sub_charset_1 --language $SubTrackLang_1 --track-name `"$SubTrackName_1`" --default-track $SubTrack_1_default"
|
||||
|
||||
if ( $Internal_SUB_Number -eq 2 ) {
|
||||
# Track 3 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_2 = $sub_2_id + ":$SubTrackName_2"
|
||||
$SubTrackLang_2 = $sub_2_id + ":$SubTrackLang_2"
|
||||
$SubTrack_2_default = $sub_2_id + ":$SubTrack_2_default"
|
||||
$sub_charset_2 = $sub_2_id + ":$sub_charset_2"
|
||||
# Define track order
|
||||
$track_order += ",0:" + $sub_2_id
|
||||
$subtitle_tracks += ",$sub_2_id"
|
||||
$MKVMerge_sub_param += " --sub-charset $sub_charset_2 --language $SubTrackLang_2 --track-name `"$SubTrackName_2`" --default-track $SubTrack_2_default"
|
||||
}
|
||||
}
|
||||
elseif (( $keep_internal_Sub -eq $true ) -and ( $Internal_SUB_Number -eq 0 )) {
|
||||
write-host "Problem with `$keep_internal_Sub=$keep_internal_Sub and `$Internal_SUB_Number=$Internal_SUB_Number.`nIf `$keep_internal_Sub=true, `$Internal_SUB_Number should have a value different from 0 !" -ForegroundColor "Red"
|
||||
exit
|
||||
}
|
||||
|
||||
if ( ( $External_SUB_Number -ne 0 ) -and ( $External_SUB -eq $true ) ) {
|
||||
|
||||
# First external SRT to include
|
||||
$SRT_1_Name = $MKV_1_name + ".$SubExtension_1"
|
||||
$SRT_1 = $sourceDirectory_1 + "\" + $SRT_1_name
|
||||
|
||||
$track_order += $track_order_EXT_sub
|
||||
|
||||
$MKVMerge_param_srt1 = "--sub-charset $Extsub_charset_1 --language $ExtSubTrackLang_1 --track-name `"$ExtSubTrackName_1`" --default-track $ExtSubTrack_1_default `"$SRT_1`""
|
||||
$MKVMerge_param_srt_all = "$MKVMerge_param_srt1"
|
||||
if ( $External_SUB_Number -eq 2 ) {
|
||||
# Second external SRT to include
|
||||
$SRT_2_Name = $MKV_1_name + ".$SubExtension_2"
|
||||
$SRT_2 = $sourceDirectory_1 + "\" + $SRT_2_name
|
||||
|
||||
$MKVMerge_param_srt2 = "--sub-charset $Extsub_charset_2 --language $ExtSubTrackLang_2 --track-name `"$ExtSubTrackName_2`" --default-track $ExtSubTrack_2_default `"$SRT_2`""
|
||||
$MKVMerge_param_srt_all += " $MKVMerge_param_srt2"
|
||||
}
|
||||
|
||||
if ( $keep_internal_Sub -eq $false ) {
|
||||
$MKVMerge_param_start = "--output `"$Output`" --title `"$VideoTrackName`" --track-order `"$track_order`" --no-subtitles --track-name `"0:$VideoTrackName`" --default-track 0:yes"
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param `"$MKV_1`""
|
||||
$MKVMerge_param_all = "$MKVMerge_param_start $MKVMerge_param_mkv1 $MKVMerge_param_srt_all"
|
||||
}
|
||||
else {
|
||||
$MKVMerge_param_start = "--output `"$Output`" --title `"$VideoTrackName`" --track-order `"$track_order`" --subtitle-tracks $subtitle_tracks --track-name `"0:$VideoTrackName`" --default-track 0:yes"
|
||||
$MKVMerge_param_mkv1 = "$MKVMerge_audio_param $MKVMerge_sub_param `"$MKV_1`""
|
||||
$MKVMerge_param_all = "$MKVMerge_param_start $MKVMerge_param_mkv1 $MKVMerge_param_srt_all"
|
||||
}
|
||||
}
|
||||
elseif (( $External_SUB_Number -eq 0 ) -and ( $External_SUB -eq $true )) {
|
||||
write-host "Problem with `$External_SUB_Number=$External_SUB_Number and `$External_SUB=$External_SUB.`nIf `$External_SUB=true, `$External_SUB_Number should have a value different from 0 !" -ForegroundColor "Red"
|
||||
exit
|
||||
}
|
||||
|
||||
# To modify a SubTrackName after previous operation... :
|
||||
# if ( $MKV_1_name -eq "BLABLA" ) {
|
||||
# $SubTrackName_2 = $sub_2_id + ":Français Québécois - SRT"
|
||||
# }
|
||||
|
||||
# Write-Host "`$MKVMerge_param_start = $MKVMerge_param_start" -ForegroundColor "White"
|
||||
# Write-Host "`$MKVMerge_param_mkv1 = $MKVMerge_param_mkv1" -ForegroundColor "White"
|
||||
# Write-Host "`$MKVMerge_param_all = $MKVMerge_param_all" -ForegroundColor "White"
|
||||
|
||||
# Last step to command construction
|
||||
$command = "& $MKVMerge $MKVMerge_param_all"
|
||||
# Launch begin...
|
||||
Invoke-Expression $command
|
||||
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "Fin du traitement du fichier n° $compteur / $Count_1." -ForegroundColor "black" -BackgroundColor "white"
|
||||
Write-Host "" -ForegroundColor "black" -BackgroundColor "white"
|
||||
|
||||
If (-Not (Test-Path $Output) ) {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
else {
|
||||
if ( $move_mkv1_after_merge -eq $true ) {
|
||||
Move-Item -Path $MKV_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $NB_External_SUB -ne 0 ) {
|
||||
Move-Item -Path $SRT_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
if ( $NB_External_SUB -eq 2 ) {
|
||||
Move-Item -Path $SRT_2 -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$compteur++
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer un MKV en ne gardant que 2 pistes de sous-titres SRT et les 2 pistes audio ##
|
||||
## en spécifiant un nom pour chaque piste et en permettant de paramétrer celles par défaut ##
|
||||
## ainsi que l'odre des pistes ##
|
||||
## Le MKV de base contient 2 ou 3 pistes SRT. On en garde que 2. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE\2ST"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Track 0 = video
|
||||
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Français - AC3 5.1"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:no"
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name of Audio Track n°2
|
||||
$AudioTrackName_2 = "2:English - AC3 5.1"
|
||||
$AudioLang_2 = "2:en"
|
||||
$AudioTrack_2_default = "2:yes"
|
||||
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 3 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "3:FR Complet - SRT"
|
||||
$SubTrackLang_1 = "3:fr"
|
||||
$SubTrack_1_default = "3:no"
|
||||
$sub_charset_1 = "3:UTF-8"
|
||||
|
||||
# Track 4 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°2 + Sync Value
|
||||
$SubTrackName_2 = "5:ENG SDH - SRT"
|
||||
$SubTrackLang_2 = "5:en"
|
||||
$SubTrack_2_default = "5:yes"
|
||||
$sub_charset_2 = "5:UTF-8"
|
||||
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "0:0,0:2,0:1,0:5,0:3"
|
||||
# Define subtitles track to keep
|
||||
$subtitle_tracks = "3,5"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process - Grab the list of all MKV file in the folder
|
||||
$MKV_List = Get-ChildItem $sourceDirectory -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $MKV_List.count
|
||||
Write-Host "$Count MKV's to be processed in $sourceDirectory."
|
||||
|
||||
Foreach ($MKV_file in $MKV_List) {
|
||||
#Get File Name
|
||||
$FormatName = $MKV_file.ToString()
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-(4))
|
||||
$MKV = $FormatName
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = ((Get-Item $MKV).Basename).ToString()
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute : Merge SRT with MKV
|
||||
#& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
# Delete PGS subtitles in MKV keeping all the rest
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes"
|
||||
# --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default"
|
||||
# --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default"
|
||||
# --sub-charset "3:UTF-8" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default"
|
||||
# --sub-charset "4:UTF-8" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default"
|
||||
# --sub-charset "5:UTF-8" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default"
|
||||
# "$MKV"
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default" "$MKV"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
#Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer un MKV en ne gardant que 3 pistes de sous-titres SRT et les 2 pistes audio ##
|
||||
## en spécifiant un nom pour chaque piste et en permettant de paramétrer celles par défaut ##
|
||||
## ainsi que l'odre des pistes ##
|
||||
## Le MKV de base contient 3 pistes SRT. On en garde que 3. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE\3ST"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Track 0 = video
|
||||
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Français - AC3 5.1"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:no"
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name of Audio Track n°2
|
||||
$AudioTrackName_2 = "2:English - AC3 5.1"
|
||||
$AudioLang_2 = "2:en"
|
||||
$AudioTrack_2_default = "2:yes"
|
||||
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 3 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "3:FR Forcé - SRT"
|
||||
$SubTrackLang_1 = "3:fr"
|
||||
$SubTrack_1_default = "3:no"
|
||||
$sub_charset_1 = "3:UTF-8"
|
||||
|
||||
# Track 4 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°2 + Sync Value
|
||||
$SubTrackName_2 = "4:FR Complet - SRT"
|
||||
$SubTrackLang_2 = "4:fr"
|
||||
$SubTrack_2_default = "4:no"
|
||||
$sub_charset_2 = "4:UTF-8"
|
||||
|
||||
# Track 5 = Sub n°3 to keep
|
||||
# Name and language of Subtitle Track n°3 + Sync Value
|
||||
$SubTrackName_3 = "5:ENG Full - SRT"
|
||||
$SubTrackLang_3 = "5:en"
|
||||
$SubTrack_3_default = "5:yes"
|
||||
$sub_charset_3 = "5:UTF-8"
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "0:0,0:2,0:1,0:5,0:4,0:3"
|
||||
# Define subtitles track to keep
|
||||
$subtitle_tracks = "3,4,5"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process - Grab the list of all MKV file in the folder
|
||||
$MKV_List = Get-ChildItem $sourceDirectory -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $MKV_List.count
|
||||
Write-Host "$Count MKV's to be processed in $sourceDirectory."
|
||||
|
||||
Foreach ($MKV_file in $MKV_List) {
|
||||
#Get File Name
|
||||
$FormatName = $MKV_file.ToString()
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-(4))
|
||||
$MKV = $FormatName
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = ((Get-Item $MKV).Basename).ToString()
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute : Merge SRT with MKV
|
||||
#& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
# Delete PGS subtitles in MKV keeping all the rest
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes"
|
||||
# --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default"
|
||||
# --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default"
|
||||
# --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default"
|
||||
# --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default"
|
||||
# --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default"
|
||||
# "$MKV"
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default" --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default" "$MKV"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
#Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
@ -0,0 +1,158 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer un MKV en ne gardant que 3 pistes de sous-titres SRT et les 2 pistes audio ##
|
||||
## en spécifiant un nom pour chaque piste et en permettant de paramétrer celles par défaut ##
|
||||
## ainsi que l'odre des pistes ##
|
||||
## Le MKV de base contient 4 pistes SRT. On en garde que 3. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE\4ST"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Track 0 = video
|
||||
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Français - AC3 5.1"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:no"
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name of Audio Track n°2
|
||||
$AudioTrackName_2 = "2:English - AC3 5.1"
|
||||
$AudioLang_2 = "2:en"
|
||||
$AudioTrack_2_default = "2:yes"
|
||||
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 3 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "3:FR Forcé - SRT"
|
||||
$SubTrackLang_1 = "3:fr"
|
||||
$SubTrack_1_default = "3:no"
|
||||
$sub_charset_1 = "3:UTF-8"
|
||||
#$SubSYNCvalue_1 = "0000"
|
||||
|
||||
# Track 4 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°2 + Sync Value
|
||||
$SubTrackName_2 = "4:FR Complet - SRT"
|
||||
$SubTrackLang_2 = "4:fr"
|
||||
$SubTrack_2_default = "4:no"
|
||||
$sub_charset_2 = "4:UTF-8"
|
||||
#$SubSYNCvalue_2 = "0000"
|
||||
|
||||
# Track 6 = Sub n°3 to keep
|
||||
# Name and language of Subtitle Track n°3 + Sync Value
|
||||
$SubTrackName_3 = "6:ENG SDH - SRT"
|
||||
$SubTrackLang_3 = "6:en"
|
||||
$SubTrack_3_default = "6:yes"
|
||||
$sub_charset_3 = "6:UTF-8"
|
||||
#$SubSYNCvalue_3 = "0000"
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "0:0,0:2,0:1,0:6,0:3,0:4"
|
||||
# Define subtitles track to keep
|
||||
$subtitle_tracks = "3,4,6"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process - Grab the list of all MKV file in the folder
|
||||
$MKV_List = Get-ChildItem $sourceDirectory -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $MKV_List.count
|
||||
Write-Host "$Count MKV's to be processed in $sourceDirectory."
|
||||
|
||||
Foreach ($MKV_file in $MKV_List) {
|
||||
#Get File Name
|
||||
$FormatName = $MKV_file.ToString()
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-(4))
|
||||
$MKV = $FormatName
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = ((Get-Item $MKV).Basename).ToString()
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute : Merge SRT with MKV
|
||||
#& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
# Delete PGS subtitles in MKV keeping all the rest
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes"
|
||||
# --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default"
|
||||
# --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default"
|
||||
# --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default"
|
||||
# --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default"
|
||||
# --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default"
|
||||
# "$MKV"
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:und" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default" --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default" "$MKV"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
#Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
@ -0,0 +1,157 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer un MKV en ne gardant que 3 pistes de sous-titres SRT et les 2 pistes audio ##
|
||||
## en spécifiant un nom pour chaque piste et en permettant de paramétrer celles par défaut ##
|
||||
## ainsi que l'odre des pistes ##
|
||||
## Le MKV de base contient 5 pistes SRT. On en garde que 3. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE\5ST"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Track 0 = video
|
||||
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Français - AC3 5.1"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:no"
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name of Audio Track n°2
|
||||
$AudioTrackName_2 = "2:English - AC3 5.1"
|
||||
$AudioLang_2 = "2:en"
|
||||
$AudioTrack_2_default = "2:yes"
|
||||
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 3 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "3:FR Forcé - SRT"
|
||||
$SubTrackLang_1 = "3:fr"
|
||||
$SubTrack_1_default = "3:no"
|
||||
$sub_charset_1 = "3:UTF-8"
|
||||
|
||||
# Track 4 = Sub n°2 to keep
|
||||
# Name and language of Subtitle Track n°2 + Sync Value
|
||||
$SubTrackName_2 = "4:FR Complet - SRT"
|
||||
$SubTrackLang_2 = "4:fr"
|
||||
$SubTrack_2_default = "4:no"
|
||||
$sub_charset_2 = "4:UTF-8"
|
||||
|
||||
# Track 7 = Sub n°3 to keep
|
||||
# Name and language of Subtitle Track n°3 + Sync Value
|
||||
$SubTrackName_3 = "7:ENG SDH - SRT"
|
||||
$SubTrackLang_3 = "7:en"
|
||||
$SubTrack_3_default = "7:yes"
|
||||
$sub_charset_3 = "7:UTF-8"
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "0:0,0:2,0:1,0:7,0:3,0:4"
|
||||
# Define subtitles track to keep
|
||||
$subtitle_tracks = "3,4,7"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process - Grab the list of all MKV file in the folder
|
||||
$MKV_List = Get-ChildItem $sourceDirectory -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $MKV_List.count
|
||||
Write-Host "$Count MKV's to be processed in $sourceDirectory."
|
||||
|
||||
Foreach ($MKV_file in $MKV_List) {
|
||||
#Get File Name
|
||||
$FormatName = $MKV_file.ToString()
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-(4))
|
||||
$MKV = $FormatName
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = ((Get-Item $MKV).Basename).ToString()
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute : Merge SRT with MKV
|
||||
#& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
# Delete PGS subtitles in MKV keeping all the rest
|
||||
# & $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes"
|
||||
# --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default"
|
||||
# --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default"
|
||||
# --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default"
|
||||
# --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default"
|
||||
# --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default"
|
||||
# "$MKV"
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --subtitle-tracks "$subtitle_tracks" --language "0:und" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" --language "$AudioLang_2" --track-name "$AudioTrackName_2" --default-track "$AudioTrack_2_default" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" --sub-charset "$sub_charset_2" --language "$SubTrackLang_2" --track-name "$SubTrackName_2" --default-track "$SubTrack_2_default" --sub-charset "$sub_charset_3" --language "$SubTrackLang_3" --track-name "$SubTrackName_3" --default-track "$SubTrack_3_default" "$MKV"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
#Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
120
Scripts-Divers/OLD/Batch Merge Subtitles with MKVMerge - OLD.ps1
Normal file
@ -0,0 +1,120 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "English AC3 5.1"
|
||||
$AudioLang_1 = "en"
|
||||
|
||||
# Name of Audio Track n°2
|
||||
$AudioTrackName_2 = "Français AC3 2.0"
|
||||
$AudioLang_2 = "fr"
|
||||
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "English SRT"
|
||||
$SubTrackLang_1 = "en"
|
||||
# Leave this at "0000" if no synchronisation modifier is to used, otherwise it's in ms
|
||||
# +xxxx to delay the display of subtitles of xxxx ms
|
||||
# -xxxx to advance the display of subtitles of xxxx ms
|
||||
$SubSYNCvalue_1 = "0000"
|
||||
|
||||
# Name and language of Subtitle Track n°2
|
||||
#$SubTrackName_2 = "Français SRT"
|
||||
#$SubTrackLang_2 = "fr"
|
||||
# Leave this at "0:0000" if no synchronisation modifier is to used, otherwise it's in ms :
|
||||
# 0:+xxxx to delay the display of subtitles of xxxx ms
|
||||
# 0:-xxxx to advance the display of subtitles of xxxx ms
|
||||
#$SubSYNCvalue_2 = "0:1000"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process
|
||||
$Subs = Get-ChildItem $sourceDirectory -Filter "*.$SubExtension" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $Subs.count
|
||||
Write-Host "$Count MKV's to be processed."
|
||||
|
||||
Foreach ($Sub in $Subs) {
|
||||
#Get File Name
|
||||
$FormatName = $Sub.ToString()
|
||||
#$Name = $FormatName.TrimEnd(".$SubExtension")
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-($SubExtension.Length+1))
|
||||
$MKV = $Name + '.mkv'
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = (Get-Item $MKV).Basename
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
136
Scripts-Divers/OLD/Batch Merge Subtitles with MKVMerge.ps1
Normal file
@ -0,0 +1,136 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer un MKV avec un SRT externe présent dans le même dossiers. ##
|
||||
## Il faut que ce SRT ait le même nom que le MKV, avec comme extension .eng.srt ou .fr.srt ##
|
||||
## en fonction de la langue du ST. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory = "D:\DOSSIER_SOURCE"
|
||||
$destinationDirectory = "F:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
#$SecondSubExtension = "sub"
|
||||
|
||||
# Track 0 = video
|
||||
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:Français - AC3 5.1"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:no"
|
||||
|
||||
# Track 2 = Audio n°2
|
||||
# Name of Audio Track n°2
|
||||
# $AudioTrackName_2 = "2:English - AC3 5.1"
|
||||
# $AudioLang_2 = "2:en"
|
||||
# $AudioTrack_2_default = "2:yes"
|
||||
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 : beacause it's a SRT file
|
||||
# Name and language of Subtitle Track n°1 + Sync Value
|
||||
$SubTrackName_1 = "0:ENG SDH - SRT"
|
||||
$SubTrackLang_1 = "0:en"
|
||||
$SubTrack_1_default = "3:yes"
|
||||
$sub_charset_1 = "3:UTF-8"
|
||||
#$SubSYNCvalue_1 = "0000"
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "0:0,0:2,0:1,0:6,0:3,0:4"
|
||||
# Define subtitles track to keep
|
||||
$subtitle_tracks = "3,4,6"
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged = $sourceDirectory + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
|
||||
#Process
|
||||
$Subs = Get-ChildItem $sourceDirectory -Filter "*.$SubExtension" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count = $Subs.count
|
||||
Write-Host "$Count MKV's to be processed."
|
||||
|
||||
Foreach ($Sub in $Subs) {
|
||||
#Get File Name
|
||||
$FormatName = $Sub.ToString()
|
||||
#$Name = $FormatName.TrimEnd(".$SubExtension")
|
||||
$Name = $FormatName.Substring(0,$FormatName.Length-($SubExtension.Length+1))
|
||||
$MKV = $Name + '.mkv'
|
||||
#$OtherSub = $Name + '.' + $SecondSubExtension
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = (Get-Item $MKV).Basename
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
#Execute
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "0:0,0:1,0:2,1:0" -o "$Output" --no-subtitles --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" --language "1:$AudioLang_1" --track-name "1:$AudioTrackName_1" --default-track "1:yes" --language "2:$AudioLang_2" --track-name "2:$AudioTrackName_2" --default-track "2:no" "$MKV" --language "0:$SubTrackLang_1" --track-name "0:$SubTrackName_1" --default-track "0:yes" --sync "0:$SubSYNCvalue_1" "$Sub"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV -Destination $Path_Folder_NotMerged -Verbose
|
||||
Move-Item -Path $Sub -Destination $Path_Folder_NotMerged -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
@ -0,0 +1,212 @@
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Batch Merge Subtitles with MKVMerge ##
|
||||
## By Miles ##
|
||||
## Idea from Iain McCain : https://superuser.com/a/1249870 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Utilisation et conditions : ##
|
||||
## - Il faut que les .srt et les .mkv soient dans le même dossier. ##
|
||||
## - Il faut que les sous-titres externes .SRT aient le même nom de fichier que les .MKV. ##
|
||||
## - Il faut paramétrer l'extension des fichiers de sous-titres pour que ces derniers ##
|
||||
## reflètent la langue : eng, fre,... ##
|
||||
## - Il faudra par ailleurs modifier le code langage dans AudioLang_X et SubTrackLang_1 ##
|
||||
## Il est possible de : ##
|
||||
## - spécifier des dossiers sources et destinations identiques ou différents ##
|
||||
## - spécifier un titre de piste (pour toutes) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Objectifs : ##
|
||||
## Remuxer deux MKV en gardant l'audio et les chapitres du premier, et seulement la vidéo ##
|
||||
## du second, en muxant en plus un SRT ayant le même nom que le 1er mkv et étant dans le même ##
|
||||
## dossier que ce 1er mkv ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
|
||||
#Set MKVMerge.exe Path
|
||||
$MKVMerge = 'H:\z_MKV\mkvtoolnix\mkvmerge.exe'
|
||||
|
||||
#Set Source and Target directories (Don't put an \ at the end)
|
||||
$sourceDirectory_1 = "D:\DOSSIER_SOURCE-1"
|
||||
$sourceDirectory_2 = "D:\DOSSIER_SOURCE-2"
|
||||
$destinationDirectory = "G:\DOSSIER_DESTINATION"
|
||||
|
||||
#If source and destination are the same folder, set this to True, Otherwise let it to "False"
|
||||
$merged_SUFFIX_name = "False"
|
||||
|
||||
#Set Subtitle Extension (Don't add the . before the extension)
|
||||
$SubExtension = 'eng.srt'
|
||||
|
||||
#### Objective : Keep audio and subtitles and tags from FILE n°1 - Add video from FILE n°2
|
||||
|
||||
##########################################
|
||||
#### FILE 1 - MKV - Keeping all but the video (audio + chapters tags)
|
||||
# ================== AUDIO ==================
|
||||
# Track 1 = Audio n°1
|
||||
# Name and language of Audio Track n°1
|
||||
$AudioTrackName_1 = "1:English - DTS 5.1 768kb/s"
|
||||
$AudioLang_1 = "1:fr"
|
||||
$AudioTrack_1_default = "1:yes"
|
||||
$file_1_options = "--no-video"
|
||||
|
||||
##########################################
|
||||
#### FILE 2 - MKV - Keeping only the video
|
||||
$file_2_options = "--no-audio --no-track-tags --no-global-tags"
|
||||
|
||||
##########################################
|
||||
#### FILE 3 - SRT - Keeping all but the video (audio + chapters tags)
|
||||
# ================== SUBTITLES ==================
|
||||
# Track 0 = Sub n°1 to keep
|
||||
# Name and language of Subtitle Track n°0 + Sync Value
|
||||
$SubTrackName_1 = "0:English SDH - SRT"
|
||||
$SubTrackLang_1 = "0:en"
|
||||
$SubTrack_1_default = "0:yes"
|
||||
$sub_charset_1 = "0:UTF-8"
|
||||
####
|
||||
|
||||
# ================== OTHER SETTINGS ==================
|
||||
# Define track order
|
||||
$track_order = "1:0,0:1,2:0"
|
||||
# Define subtitles track to keep
|
||||
#$subtitle_tracks = "3"
|
||||
|
||||
# Files name, without .mkv :
|
||||
# format = filename_1_part_1 + S + filename_season + E + i_counter + filename_1_part_2 + .mkv
|
||||
# format = filename_2_part_1 + S + filename_season + E + i_counter + filename_2_part_2 + .mkv
|
||||
$filename_1_part_1 = "Ma série (20xx) - "
|
||||
$filename_1_part_2 = " - 1080p-h264"
|
||||
# Final name 1 = Ma série (20xx) - S01E01 - 1080p-h264
|
||||
# The SRT file must have the same name (without the extention .eng.srt)
|
||||
|
||||
$filename_2_part_1 = "Ma série (20xx) - "
|
||||
$filename_2_part_2 = " - 1080p.x265"
|
||||
# Final name 2 = Ma série (20xx) - S01E01 - 1080p.x265
|
||||
|
||||
$filename_season = "01"
|
||||
$filename_ep_start = 4
|
||||
$filename_ep_final = 4
|
||||
##==============================================================================================
|
||||
##==============================================================================================
|
||||
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_2 = $sourceDirectory_2 + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged_2)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged_2 -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
# Testing if the Not-Merged folder already exists : if yes, it will be renamed, else it will be created.
|
||||
$Path_Folder_NotMerged_1 = $sourceDirectory_1 + "\Not-Merged"
|
||||
If(!(test-path $Path_Folder_NotMerged_1)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $Path_Folder_NotMerged_1 -Verbose
|
||||
} else {
|
||||
# Don't know what's the best... TO BE IMPROVED
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
#Move-Item -Path $Path_Folder_NotMerged_2 -Destination "$sourceDirectory\Not-Merged--backup" -Verbose
|
||||
}
|
||||
|
||||
#Process
|
||||
$MKV_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$SRT_1_List = Get-ChildItem $sourceDirectory_1 -Filter "*.$SubExtension" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_1 = $MKV_1_List.count
|
||||
$Count_1_SRT = $SRT_1_List.count
|
||||
Write-Host "$Count_1 MKV's to be processed and $Count_1_SRT SRT's to be processed in $sourceDirectory_1."
|
||||
if ($Count_1 -eq $Count_1_SRT) {
|
||||
Write-Host "There is the same number of MKV and SRT file in this folder. Let's continue."
|
||||
} else {
|
||||
Write-Host "The number of MKV and SRT files isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
|
||||
$MKV_2_List = Get-ChildItem $sourceDirectory_2 -Filter "*.mkv" | ForEach-Object { $_.FullName } | Sort-Object
|
||||
$Count_2 = $MKV_2_List.count
|
||||
Write-Host "$Count_2 MKV's to be processed in $sourceDirectory_2."
|
||||
if ($Count_1 -eq $Count_2) {
|
||||
Write-Host "There is the same number of MKV in the two sources folders. Let's continue."
|
||||
} else {
|
||||
Write-Host "The number of MKV in the two sources folders isn't the same. ABORT..." -foreground "red"
|
||||
Exit
|
||||
}
|
||||
|
||||
if (!($Count_1 -eq ($filename_ep_final - $filename_ep_start + 1))) {
|
||||
Write-Host "The number of epidoes set in the script isn't the same as the number of files in the folders... EXITING NOW !" -foreground "red"
|
||||
Exit
|
||||
}
|
||||
|
||||
for ($i = $filename_ep_start; $i -lt $filename_ep_final+1; $i++) {
|
||||
|
||||
# Genreating File Name
|
||||
# format = filename_1_part_1 + S + filename_season + E + i_counter + filename_1_part_2 + .mkv
|
||||
# format = filename_2_part_1 + S + filename_season + E + i_counter + filename_2_part_2 + .mkv
|
||||
# Final name 1 = Le Bureau des Légendes (2015) - S01E01 - 1080p-h264
|
||||
# Final name 2 = Le Bureau des Légendes (2015) - S01E01 - 1080p.BDRip.x265.Aac.NoTag
|
||||
|
||||
if ($i -lt 10 ) { # i<10
|
||||
$MKV_1_name = $filename_1_part_1 + "S" + $filename_season + "E0" + $i + $filename_1_part_2
|
||||
$SRT_1_name = $MKV_1_name
|
||||
$MKV_2_name = $filename_2_part_1 + "S" + $filename_season + "E0" + $i + $filename_2_part_2
|
||||
} else { # i=10
|
||||
$MKV_1_name = $filename_1_part_1 + "S" + $filename_season + "E" + $i + $filename_1_part_2
|
||||
$SRT_1_name = $MKV_1_name
|
||||
$MKV_2_name = $filename_2_part_1 + "S" + $filename_season + "E" + $i + $filename_2_part_2
|
||||
}
|
||||
$MKV_1 = $sourceDirectory_1 + "\" + $MKV_1_name + ".mkv"
|
||||
$SRT_1 = $sourceDirectory_1 + "\" + $SRT_1_name + "." + $SubExtension
|
||||
$MKV_2 = $sourceDirectory_2 + "\" + $MKV_2_name + ".mkv"
|
||||
|
||||
# Title for the video track
|
||||
$VideoTrackName = $MKV_2_name
|
||||
|
||||
#Set Output File Name
|
||||
#$Output = $Name + '___MERGED' + '.mkv'
|
||||
If ($merged_SUFFIX_name -eq "True") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '___MERGED' + '.mkv'
|
||||
} elseif ($merged_SUFFIX_name -eq "False") {
|
||||
$Output = $destinationDirectory + "\" + $VideoTrackName + '.mkv'
|
||||
} else {
|
||||
write-host "Error in the value of the merged_SUFFIX_name variable. Current value = $merged_SUFFIX_name" -foreground "red"
|
||||
write-host "Should be set to True or False.`nScript is exiting now..." -foreground "white"
|
||||
Exit
|
||||
}
|
||||
|
||||
|
||||
#Execute
|
||||
# Keep Audio/Subtitles/tags from MKV_1 + Only video from MKV_2
|
||||
<# Command to edit
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output"
|
||||
"$file_1_options"
|
||||
--language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default"
|
||||
"$MKV_1"
|
||||
"$file_2_options"
|
||||
--language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes"
|
||||
"$MKV_2"
|
||||
--sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default"
|
||||
"$SRT_1"
|
||||
#>
|
||||
|
||||
& $MKVMerge --title "$VideoTrackName" --track-order "$track_order" -o "$Output" --no-video --language "$AudioLang_1" --track-name "$AudioTrackName_1" --default-track "$AudioTrack_1_default" "$MKV_1" --no-audio --no-track-tags --no-global-tags --language "0:en" --track-name "0:$VideoTrackName" --default-track "0:yes" "$MKV_2" --sub-charset "$sub_charset_1" --language "$SubTrackLang_1" --track-name "$SubTrackName_1" --default-track "$SubTrack_1_default" "$SRT_1"
|
||||
|
||||
If (Test-Path $Output) {
|
||||
#Clean Up
|
||||
#Remove-Item $MKV
|
||||
#Remove-Item $Sub
|
||||
#Remove-Item $OtherSub
|
||||
# Move to folder Not-Merged, this folder's existence has already been tested, and the folder is created.
|
||||
Move-Item -Path $MKV_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
Move-Item -Path $SRT_1 -Destination $Path_Folder_NotMerged_1 -Verbose
|
||||
Move-Item -Path $MKV_2 -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
#Move-Item -Path $Sub -Destination $Path_Folder_NotMerged_2 -Verbose
|
||||
|
||||
# Renaming the output file is not necessary if the output filename doesn't have __MERGED in it
|
||||
#Rename-Item -Path $Output -NewName $MKV -Verbose
|
||||
|
||||
} Else {
|
||||
write-host "File NON-EXISTANT - $Output" -foreground "red"
|
||||
"File NON-EXISTANT - $Output" | Out-File "$destinationDirectory\Errors.txt" -Append
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
# Script pour créer un certain nombre de dossiers de même nom avec un n° qui change
|
||||
|
||||
# Source : https://stackoverflow.com/questions/28631419/how-to-recursively-remove-all-empty-folders-in-powershell
|
||||
|
||||
Clear-Host
|
||||
Invoke-Command -ScriptBlock {
|
||||
$source_folder = "PATH_WHERE_TO_CREATE_FOLDERS"
|
||||
$nb_folder = 10
|
||||
# Base Name : (number will be added after with a space)
|
||||
$folder_to_create = "My Folder Base NAME"
|
||||
|
||||
function Test-Directory {
|
||||
param (
|
||||
[Parameter(Mandatory)]$path_to_verify
|
||||
)
|
||||
If (!(test-path $path_to_verify)) {
|
||||
New-Item -ItemType "Directory" -Force -Path $path_to_verify
|
||||
Write-Host "The path $path_to_verify (or one of the last subfolder) didn't exist. It has been created." -ForegroundColor "DarkBlue"
|
||||
}
|
||||
else {
|
||||
Write-Host "The path $path_to_verify already exist." -ForegroundColor "DarkBlue"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for ($i = 1 ; $i -le $nb_folder ; $i++) {
|
||||
|
||||
$folder_name = $folder_to_create + " $i"
|
||||
|
||||
# Exceptions
|
||||
if ( $folder_name -eq "My Folder Base NAME 9" ) {
|
||||
$folder_name = "My Folder Base NAME Part.1"
|
||||
}
|
||||
elseif ( $folder_name -eq "My Folder Base NAME 10" ) {
|
||||
$folder_name = "My Folder Base NAME Part.2"
|
||||
}
|
||||
|
||||
# Construction of the final folder name
|
||||
$final_folder_name = $source_folder + "\" + $folder_name
|
||||
Test-Directory $final_folder_name
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
# Script pour tester si le dossier mis en paramètre contient des dossiers vides
|
||||
# et si oui, les supprimer.
|
||||
|
||||
# Source : https://stackoverflow.com/questions/28631419/how-to-recursively-remove-all-empty-folders-in-powershell
|
||||
|
||||
Clear-Host
|
||||
Invoke-Command -ScriptBlock {
|
||||
$folder_to_check = "PATH_TO_FOLDER_CONTAINING_EMPTY_FOLDERS"
|
||||
|
||||
$dirs = Get-ChildItem $folder_to_check -Directory -Recurse | Where-Object { (Get-ChildItem $_.fullName).count -eq 0 } | Select-Object -ExpandProperty FullName
|
||||
$dirs | Foreach-Object { Write-Host "Dossier qui sera supprimer car considéré comme vide : " $_ }
|
||||
# $dirs | Foreach-Object { Remove-Item $_ }
|
||||
|
||||
}
|
141
TUTO_Git_SourceTree.md
Normal file
@ -0,0 +1,141 @@
|
||||
Tutoriel pour Git avec SourceTree <!-- omit in toc -->
|
||||
============
|
||||
Le but de ce tuto est d'expliquer comment faire des commits proprement sur le Gitea de Zoz.
|
||||
|
||||
## Table des matières <!-- omit in toc -->
|
||||
- [1. Introduction & Installation](#1-introduction-installation)
|
||||
- [1.1. Prérequis :](#1-1-prérequis)
|
||||
- [1.2. Cloner le dépôt avec SourceTree :](#1-2-cloner-le-dépôt-avec-sourcetree)
|
||||
- [1.3. Explications rapides des fonctions de SourceTree utilisées dans ce tuto](#1-3-explications-rapides-des-fonctions-de-sourcetree-utilisées-dans-ce-tuto)
|
||||
- [2. Créer une branche de travail `mon_pseudo-travail` depuis la branche `master`](#2-créer-une-branche-de-travail-mon-pseudo-travail-depuis-la-branche-master)
|
||||
- [2.1. Méthode n°1 : depuis SourceTree](#2-1-méthode-n-1-depuis-sourcetree)
|
||||
- [2.2. Méthode n°2 : depuis l'interface web de Gitea](#2-2-méthode-n-2-depuis-l-interface-web-de-gitea)
|
||||
- [3. Envoi du premier commit, et des suivants...](#3-envoi-du-premier-commit-et-des-suivants)
|
||||
- [4. Demande de fusion de notre branche `mon_pseudo-travail` avec `master`](#4-demande-de-fusion-de-notre-branche-mon-pseudo-travail-avec-master)
|
||||
|
||||
## 1. Introduction & Installation
|
||||
|
||||
Ce petit tuto va utiliser l'application SourceTree : [https://www.sourcetreeapp.com/](https://www.sourcetreeapp.com/).<br>
|
||||
J'ai essayé plusieurs clients Git pour windows et macOS, et SourceTree est le seul (parmis ceux essayés) qui offre une interface graphique assez similaire sur ces deux plateformes, et est assez facile d'utilisation. Ce tuto sera donc en partie rédigé pour utiliser cette application.
|
||||
|
||||
**Ce tuto va donc servir de guide pour contribuer au dépôt avec le moins possible de ligne de commande, voir aucune.**
|
||||
|
||||
### 1.1. Prérequis :
|
||||
|
||||
- Vous devrez aussi avoir installé Git pour windows (ou macos) : [https://git-scm.com/downloads](https://git-scm.com/downloads). Ça pourra être nécessaire si on passe par la ligne de commande.
|
||||
- Installez SourceTree. <br> Une fois Git installé, et SourceTree installé, allez dans les options de SourceTree pour vérifier que le Git utilisé est bien celui que vous venez d'installer (en externe du point de vue de SourceTree) :<br>
|
||||
[<img src="https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/SourceTree-Git-config.png" align="" height="500" />](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/SourceTree-Git-config.png)<br>
|
||||
Tous les autres paramètres étant ceux par défaut.
|
||||
|
||||
### 1.2. Cloner le dépôt avec SourceTree :
|
||||
|
||||
[<img src="https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/Capture-05.png" align="" height="500" />](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/Capture-05.png)<br>
|
||||
Une fois le dépôt cloné, on peut commencer à commiter comme un pro :D.
|
||||
Vous devriez avoir ce genre d'affichage :<br>
|
||||
[<img src="https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/Capture-06.png" align="" height="500" />](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/raw/branch/master/Tuto-Git-SourceTree/Capture-06.png)<br>
|
||||
|
||||
### 1.3. Explications rapides des fonctions de SourceTree utilisées dans ce tuto
|
||||
|
||||
Dans ce tuto, nous n'allons pas utiliser beaucoup de fonctionnalités de SourceTree, mais voilà les principales :
|
||||
|
||||
- **Bouton Valider** : permet d'afficher l'écran de validation du commit que l'on s'apprête à finaliser. On peut, et on doit, laisser un bref message indiquant sommairement ce que contient ce commit (en termes d'ajout, modification, etc...).<br>
|
||||
En ligne de commande, ce serait : `git commit -m "ma super modif"`.
|
||||
- **Bouton Récupérer** : C'est le `git pull`, ça permet de récupérer dans la branche en cours le conteneur d'une branche distante :
|
||||
- **Bouton Envoyer** : C'est le `git push`, ça permet d'envoyer les modifications locales sur le dépôt distant. En général, je préfère utiliser la case à cocher "Envoyer les modifications vers origin/ma-brancheblabla" à l'étape de validation du commit (voir plus bas).
|
||||
- **Bouton Rapatrier** : Je l'utilise lorsque je suis sur la branche `master` pour récupérer les données et enlever de SourceTree les branches distantes qui ont été supprimées.
|
||||
- **Bouton Changer de branche** : C'est avec ce bouton que je crée une nouvelle branche depuis la de départ `master`.
|
||||
|
||||
|
||||
## 2. Créer une branche de travail `mon_pseudo-travail` depuis la branche `master`
|
||||
|
||||
#### 2.1. Méthode n°1 : depuis SourceTree
|
||||
|
||||
- Il faut tout d'abord se placer sur la branche master en double cliquant dessus.<br>
|
||||

|
||||
- Ensuite, toujours choisir "Parent de la copie de travail" avant de créer la branche :<br>
|
||||

|
||||
|
||||
On est maintenant prêt à faire nos commit :<br>
|
||||

|
||||
|
||||
#### 2.2. Méthode n°2 : depuis l'interface web de Gitea
|
||||
|
||||
<br><br>
|
||||
<br><br>
|
||||
<br><br>
|
||||

|
||||
|
||||
Si vous créez votre branche depuis Gitea, il faudra l'importer dans SourceTree.
|
||||
- Pour ce faire :
|
||||
- soit vous double-cliquez sur la branche distance à rapatrier,
|
||||
- soit vous faites un clic droit dessus :<br>
|
||||

|
||||
|
||||
- Ensuite vous cochez bien la case indiquée, et laissez le nom qui s'affiche pour la branche locale, puis validez par OK :<br>
|
||||

|
||||
<br><br><br>
|
||||
|
||||
**Une fois la branche créée, vérifiez bien que cette dernière est bien sélectionnée !**
|
||||
|
||||

|
||||
|
||||
## 3. Envoi du premier commit, et des suivants...
|
||||
|
||||
Vous pouvez maintenant créer vos dossiers/fichiers, faire les modifications sur les fichiers/dossiers existants.
|
||||
|
||||
Une fois que vous arrivez à une étape clé, ou bien pour être sûr que votre travail soit "sauvegardé" sur le serveur, vous pouvez faire votre 1er commit.
|
||||
|
||||
- Cliquez sur le bouton + :<br>
|
||||

|
||||
- Puis choisissez les élements à indexer :<br>
|
||||

|
||||
- Puis pensez bien à écrire un commentaire et à cocher la case en bas pour que le commit soit envoyé sur le dépôt distant.<br>
|
||||
Cette case est l'équivalent d'un `git push`.<br>
|
||||

|
||||
|
||||
Pour la rédaction de ce tuto, j'ai fait pas mal de commits ^^. Voilà çe que ça donne avec une vue :
|
||||
|
||||

|
||||
|
||||
On voit même une branche (MilesTEG) que j'ai supprimé en cours de route... (ça rendait trop complexe la gestion des branches).
|
||||
|
||||
## 4. Demande de fusion de notre branche `mon_pseudo-travail` avec `master`
|
||||
|
||||
Une fois qu'on a fini de travailler sur notre branche, dernier commit fait, ou bien pour soumettre le travail fait à la relecture par les autres membres, on peut faire une demande de fusion.
|
||||
|
||||
Je vais illustrer cela maintenant, même si au moment où je fais la capture, le tuto n'est pas entièrement terminé.
|
||||
|
||||
- Pour faire cette demande de fusion, le plus simple est d'aller là [aller sur la page web des branches](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/branches) puis de cliquer sur le bouton "**Nouvelle demande de fusion**" de notre branche (il se peut que ce bouton s'intitule juste "**Demande de fusion**"):<br>
|
||||

|
||||
<br>
|
||||
(On voit que j'ai 12 commits dans cette branche, je ne sais pas à quoi correspond le 0...)
|
||||
|
||||
- Ensuite, on vérifie bien qu'on a la bonne branche de destination `master` (à gauche) et notre branche source `mon_pseudo-travail` :<br>
|
||||

|
||||
|
||||
- Étape suivante : (lisez le texte dans la capture)<br>
|
||||

|
||||
<br><br>
|
||||
|
||||
Si vous faites encore des commits avant de fusionner, vous les verrez apparaître à la suite des précédents et des modifications apportées à la demande de fusion (message, ajout d'étiquette, etc...):<br>
|
||||

|
||||
|
||||
- Dernière étape : Sélectionnez quelques relecteurs dans la liste<br>
|
||||

|
||||
|
||||
- Si jamais vous avez cliquez sur WIP, quand vous aurez terminé vos modifications, il faudra cliquer sur le bouton "**Enlever le préfixe WIP**" pour fusionner votre branche avec `master`.
|
||||

|
||||
<br><br>
|
||||
|
||||
Il ne vous reste plus qu'à attendre la validation par un relecteur, et qu'il fusionne votre branche avec la branche `master`.
|
||||
|
||||
À l'issue de cette fusion, votre branche sera supprimée. Si vous vouliez continuer à travailler dessus, mettez-là en statut WIP, en postant un message indiquant votre intention.
|
||||
|
||||
> :pencil2: **Note :** Si jamais vous envoyiez un nouveau commit (ou plusieurs) après que la fusion ait été faite, mais avant que la branche soit supprimée, il faudra refaire une demande de fusion.<br>
|
||||
|
||||
___
|
||||
Ça y est, c'est la fin du tutoriel :D
|
||||
|
||||
Merci d'avoir tout lu et tout suivi ;)
|
||||
|
||||
Votre avis, conseils et idées d'amélioration sont les bienvenues. Vous pouvez faire ue branche et commiter dessus ^^ ou bien me demander directement sur Discord.
|
BIN
Tuto-Git-SourceTree/Capture-01.png
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
Tuto-Git-SourceTree/Capture-02.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
Tuto-Git-SourceTree/Capture-03.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
Tuto-Git-SourceTree/Capture-04.png
Normal file
After Width: | Height: | Size: 102 KiB |
BIN
Tuto-Git-SourceTree/Capture-05.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
Tuto-Git-SourceTree/Capture-06.png
Normal file
After Width: | Height: | Size: 160 KiB |
BIN
Tuto-Git-SourceTree/Capture-07.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
Tuto-Git-SourceTree/Capture-08.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
Tuto-Git-SourceTree/Capture-10.png
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
Tuto-Git-SourceTree/Capture-11.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
Tuto-Git-SourceTree/Capture-12.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
Tuto-Git-SourceTree/Capture-14.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
Tuto-Git-SourceTree/Capture-16.png
Normal file
After Width: | Height: | Size: 82 KiB |
BIN
Tuto-Git-SourceTree/Capture-17.png
Normal file
After Width: | Height: | Size: 92 KiB |
BIN
Tuto-Git-SourceTree/Capture-18.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
Tuto-Git-SourceTree/Capture-19.png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
Tuto-Git-SourceTree/Capture-20.png
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
Tuto-Git-SourceTree/Capture-21.png
Normal file
After Width: | Height: | Size: 127 KiB |
BIN
Tuto-Git-SourceTree/Capture-22.png
Normal file
After Width: | Height: | Size: 131 KiB |
BIN
Tuto-Git-SourceTree/Capture-23.png
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
Tuto-Git-SourceTree/Capture-24.png
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
Tuto-Git-SourceTree/SourceTree-Git-config.png
Normal file
After Width: | Height: | Size: 34 KiB |
@ -31,3 +31,8 @@ https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt
|
||||
|
||||
* `Firebog.net - ads-and-tracking-extended`<br/>
|
||||
https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
* `Lien vers : COLLECTION BIG BLOCKLIST`<br/>
|
||||
https://firebog.net
|
||||
|
@ -1,50 +1,65 @@
|
||||
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/mobile.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/smarttv.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/nomsdata.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/gamefake.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/jbfake.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/fakenewsde.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/adobeblock.txt
|
||||
https://raw.githubusercontent.com/Akamaru/Pi-Hole-Lists/master/other.txt
|
||||
https://justdomains.github.io/blocklists/lists/easylist-justdomains.txt
|
||||
https://raw.githubusercontent.com/kboghdady/youTube_ads_4_pi-hole/master/black.list
|
||||
https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt
|
||||
https://www.github.developerdan.com/hosts/lists/tracking-aggressive-extended.txt
|
||||
https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
|
||||
https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts_without_controversies.txt
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts
|
||||
https://v.firebog.net/hosts/static/w3kbl.txt
|
||||
https://adaway.org/hosts.txt
|
||||
https://v.firebog.net/hosts/AdguardDNS.txt
|
||||
https://www.github.developerdan.com/hosts/lists/amp-hosts-extended.txt
|
||||
https://www.github.developerdan.com/hosts/lists/tracking-aggressive-extended.txt
|
||||
https://www.github.developerdan.com/hosts/lists/ads-and-tracking-extended.txt
|
||||
https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts_without_controversies.txt
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts
|
||||
https://v.firebog.net/hosts/static/w3kbl.txt
|
||||
https://adaway.org/hosts.txt
|
||||
https://v.firebog.net/hosts/AdguardDNS.txt
|
||||
https://v.firebog.net/hosts/Admiral.txt
|
||||
https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt
|
||||
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
|
||||
https://v.firebog.net/hosts/Easylist.txt
|
||||
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts
|
||||
https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts
|
||||
https://v.firebog.net/hosts/Easyprivacy.txt
|
||||
https://v.firebog.net/hosts/Prigent-Ads.txt
|
||||
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt
|
||||
https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt
|
||||
https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt
|
||||
https://v.firebog.net/hosts/Easylist.txt
|
||||
https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts
|
||||
https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts
|
||||
https://v.firebog.net/hosts/Easyprivacy.txt
|
||||
https://v.firebog.net/hosts/Prigent-Ads.txt
|
||||
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-blocklist.txt
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts
|
||||
https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt
|
||||
https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt
|
||||
https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser
|
||||
https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt
|
||||
https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt
|
||||
https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser
|
||||
https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt
|
||||
https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt
|
||||
https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt
|
||||
https://mirror1.malwaredomains.com/files/justdomains
|
||||
https://v.firebog.net/hosts/Prigent-Crypto.txt
|
||||
https://mirror.cedia.org.ec/malwaredomains/immortal_domains.txt
|
||||
https://www.malwaredomainlist.com/hostslist/hosts.txt
|
||||
https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt
|
||||
https://phishing.army/download/phishing_army_blocklist_extended.txt
|
||||
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt
|
||||
https://v.firebog.net/hosts/Shalla-mal.txt
|
||||
https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
|
||||
https://urlhaus.abuse.ch/downloads/hostfile/
|
||||
https://emmanuel-lecoq.fr/wp-content/uploads/2020/02/Pi-hole-list.txt
|
||||
https://ransomwaretracker.abuse.ch/downloads/RW_DOMBL.txt
|
||||
https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/list.txt
|
||||
https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt
|
||||
https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt
|
||||
https://v.firebog.net/hosts/Prigent-Crypto.txt
|
||||
https://bitbucket.org/ethanr/dns-blacklists/raw/8575c9f96e5b4a1308f2f12394abd86d0927a4a0/bad_lists/Mandiant_APT1_Report_Appendix_D.txt
|
||||
https://phishing.army/download/phishing_army_blocklist_extended.txt
|
||||
https://gitlab.com/quidsup/notrack-blocklists/raw/master/notrack-malware.txt
|
||||
https://v.firebog.net/hosts/Shalla-mal.txt
|
||||
https://raw.githubusercontent.com/Spam404/lists/master/main-blacklist.txt
|
||||
https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts
|
||||
https://urlhaus.abuse.ch/downloads/hostfile/
|
||||
https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/list.txt
|
||||
http://sysctl.org/cameleon/hosts
|
||||
https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt
|
||||
https://gist.githubusercontent.com/anudeepND/adac7982307fec6ee23605e281a57f1a/raw/5b8582b906a9497624c3f3187a49ebc23a9cf2fb/Test.txt
|
||||
https://raw.githubusercontent.com/Dawsey21/Lists/master/main-blacklist.txt
|
||||
https://v.firebog.net/hosts/Kowabit.txt
|
||||
http://forcet.fr/shared/pihole/Samsung-TV.txt
|
||||
https://raw.githubusercontent.com/neodevpro/neodevhost/master/host
|
||||
https://raw.githubusercontent.com/durablenapkin/scamblocklist/master/hosts.txt
|
||||
https://raw.githubusercontent.com/PolishFiltersTeam/KADhosts/master/KADhosts.txt
|
||||
https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt
|
||||
https://someonewhocares.org/hosts/zero/hosts
|
||||
https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts
|
||||
https://winhelp2002.mvps.org/hosts.txt
|
||||
https://v.firebog.net/hosts/neohostsbasic.txt
|
||||
https://raw.githubusercontent.com/RooneyMcNibNug/pihole-stuff/master/SNAFU.txt
|
||||
https://paulgb.github.io/BarbBlock/blacklists/hosts-file.txt
|
||||
https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/extra.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/mobile.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/smarttv.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/adobeblock.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/nintendoblock.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/nomsdata.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/gamefake.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/fakenewsde.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/cryptomine.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/other.txt
|
||||
https://git.ponywave.de/Akamaru/Pi-Hole-Lists/raw/branch/master/unsorted.txt
|
||||
https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV.txt
|
||||
https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts
|
@ -1,12 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
##========================================================================================##
|
||||
## Script bridgemacvlan-interface.sh ##
|
||||
## ##
|
||||
## Script de création d'interface virtuelle pour le conteneur AdGuardHome_macvlan ##
|
||||
## Voir tuto : https://www.nas-forum.com/forum/topic/69319-tuto-docker-macvlan-pi-hole/ ##
|
||||
## ##
|
||||
##========================================================================================##
|
||||
##===========================================================================================##
|
||||
## Script bridgemacvlan-interface.sh ##
|
||||
## ##
|
||||
## Script de création d'interface virtuelle pour les conteneurs en macvlan ##
|
||||
## Voir tutos : ##
|
||||
## https://www.nas-forum.com/forum/topic/69319-tuto-docker-macvlan-pi-hole/ ##
|
||||
## https://www.nas-forum.com/forum/topic/67311-tuto-certificat-ssl-reverse-proxy-via-docker/ ##
|
||||
## ##
|
||||
## Rappels des différentes IP : ##
|
||||
## - Plage d'IP macvlan : 192.168.xxx.MMM/28 == 192.168.2.208/28 ##
|
||||
## - IP virtuelle unique : 192.168.xxx.zzz/32 == 192.168.2.210/32 ##
|
||||
## - Plage d'IP du LAN : 192.168.xxx.0/24 == 192.168.2.0/24 ##
|
||||
## - Passerelle/routeur : 192.168.xxx.1 == 192.168.2.1 ##
|
||||
## - IP conteneur n°1 : 192.168.xxx.yyy == 192.168.2.209 ##
|
||||
## - IP conteneur n°2 : 192.168.xxx.ooo == 192.168.2.210 AdGuard_Home ##
|
||||
## ##
|
||||
##=============================================================================================
|
||||
|
||||
# Set timeout to wait host network is up and running
|
||||
sleep 60
|
||||
@ -14,10 +24,14 @@ sleep 60
|
||||
echo "$(date "+%R:%S - ") Script de création d'une interface virtuelle pour le NAS"
|
||||
echo "$(date "+%R:%S - ") Exécution des commandes..."
|
||||
|
||||
ip link add macv0 link ovs_eth0 type macvlan mode bridge # macv0 : est le nom données à l'interface virtuelle
|
||||
# ovs_eth0 : est l'interface réseau utilisée sur le NAS (lorsque VMM est utilisé)
|
||||
ip addr add 192.168.xxx.zzz/32 dev macv0 # Adresse IP virtuelle 192.168.x.zzz/32 -- Il faut que cette adresse soit libre dans le réseau
|
||||
ip link add macv0 link eth0 type macvlan mode bridge # macv0 : est le nom données à l'interface virtuelle
|
||||
# eth0 : est l'interface réseau utilisée sur le NAS (lorsque VMM n'est pas utilisé)
|
||||
# si VMM est utilisé, ce sera ovs_eth0
|
||||
ip addr add 192.168.xxx.zzz/32 dev macv0 # Adresse IP virtuelle 192.168.x.zzz/32 -- Il faut que cette adresse soit libre dans le réseau
|
||||
# et qu'elle ne fasse pas partie du DHCP du routeur/box
|
||||
#
|
||||
#### Dans mon cas, c'est cette commande :
|
||||
#### ip addr add 192.168.2.230/32 dev macv0
|
||||
|
||||
ip link set dev macv0 address 5E:00:01:02:03:04 # MAC adresse pour l'adaptateur ayant l'IP virtuelle
|
||||
# Il faut que l'adresse MAC respecte ces conditions :
|
||||
@ -32,7 +46,9 @@ ip link set macv0 up
|
||||
ip route add 192.168.xxx.MMM/28 dev macv0 # 192.168.xxx.MMM/28 : Plage d'adresse macvlan
|
||||
# IP réellement disponible : voir les calculateurs internet
|
||||
# Utiliser Portainer ou l'interface Docker ou encore le script : create-macvlan-network.sh
|
||||
|
||||
#
|
||||
#### Dans mon cas, c'est cette commande :
|
||||
#### ip route add 192.168.2.208/28 dev macv0
|
||||
|
||||
echo "$(date "+%R:%S - ") Script terminé"
|
||||
exit
|
||||
|
@ -1,31 +1,46 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Fichier docker-compose.yml pour Adguard-Home en macvlan ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
##=======================================================================================================##
|
||||
## ##
|
||||
## Attention, il faut créer le réseau macvlan à l'aide du script : docker_network_create_macvlan.sh , ##
|
||||
## ou avec Portainer. ##
|
||||
## Ce dernier va créer un réseau macvlan ayant comme IP unique 192.168.xxx.yyy ##
|
||||
## Le conteneur sera donc vu comme une machine sur le réseau LAN, mais ne pourra pas être ##
|
||||
## joint par le NAS lui-même. ##
|
||||
## Pour celà, il faut utiliser le second script : bridgemacvlan-interface.sh ##
|
||||
## Ce dernier va créer une IP-interface virtuelle 192.168.xxx.zzz qui pourra être accessible par le NAS. ##
|
||||
## Cette interface ne persiste pas au démarrage, il faudra mettre le script en tâche planifiée avec le ##
|
||||
## planificateur de tâches dans DSM. ##
|
||||
## ##
|
||||
## Voir tuto : https://www.nas-forum.com/forum/topic/69319-tuto-docker-macvlan-pi-hole/ ##
|
||||
## ##
|
||||
##=======================================================================================================##
|
||||
##============================================================================================##
|
||||
## ##
|
||||
## Attention, il faut créer le réseau macvlan à l'aide du script : macvlan-network.sh ##
|
||||
## Ce dernier va créer un réseau macvlan ayant comme IP unique 192.168.2.210 ##
|
||||
## Cette IP doit être dans la plage d'IP mavclan définie dans le script de création du réseau.##
|
||||
## Le conteneur sera donc vu comme une machine sur le réseau LAN, mais ne pourra pas être ##
|
||||
## joint par le NAS lui-même. ##
|
||||
## Pour celà, il faut utiliser le second script : boot-bridgemacvlan-interface.sh ##
|
||||
## Ce dernier va créer une IP-interface virtuelle qui pourra être accessible par le NAS. ##
|
||||
## Cette interface ne persiste pas au démarrage, il faudra mettre le script en tâche ##
|
||||
## planifiée avec le planificateur de tâches dans DSM. ##
|
||||
## ##
|
||||
## Voir tuto : https://www.nas-forum.com/forum/topic/69319-tuto-docker-macvlan-pi-hole/ ##
|
||||
## ##
|
||||
## Attention ! ##
|
||||
## ##
|
||||
## Ces deux scripts ne sont à utiliser qu'une seule fois, quelque soit le nombre de ##
|
||||
## conteneurs qui en bénéficieront. ##
|
||||
## Par exemple, si vous utilisez 2 conteneurs en macvlan, une fois le réseau macvlan créé ##
|
||||
## pour le 1er, il est inutile (et impossible) de le recréer. ##
|
||||
## Le script boot-bridgemacvlan-interface.sh ne doit être lancé qu'une seule fois, et à ##
|
||||
## chaque reboot. L'IP virtuelle est unique, il ne faut pas en recréer une seconde. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
---
|
||||
version: "2.4"
|
||||
services:
|
||||
adguardhome_macvlan:
|
||||
image: adguard/adguardhome:latest # https://github.com/AdguardTeam/AdGuardHome
|
||||
image: adguard/adguardhome:latest # https://github.com/AdguardTeam/AdGuardHome
|
||||
# https://github.com/AdguardTeam/AdGuardHome/wiki/Docker
|
||||
container_name: adguardhome_macvlan
|
||||
|
||||
hostname: AdGuard-Home--DS920+ # Permet d'avoir un nom pour le conteneur dans AdGuard lui même (sinon c'est une chaine aléatoire)
|
||||
|
||||
environment:
|
||||
- PUID=1000 # Utiliser la commande (en SSH) : id NOM_UTILISATEUR
|
||||
- PGID=100 # Utiliser la commande (en SSH) : id NOM_UTILISATEUR
|
||||
@ -33,16 +48,16 @@ services:
|
||||
- LANG=fr_FR.UTF8
|
||||
- LANGUAGE=fr_FR.UTF8
|
||||
|
||||
# ###############
|
||||
# ---------------------------------------------------------------------------------
|
||||
# Le label ci-dessous permet à Watchtower de faire les mises à jour automatiquement
|
||||
# Cela peut-être supprimé si Watchtower n'est pas utilisé.
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
# ###############
|
||||
# ---------------------------------------------------------------------------------
|
||||
|
||||
volumes:
|
||||
- "/volume1/docker/adguardhome_macvlan/work:/opt/adguardhome/work"
|
||||
- "/volume1/docker/adguardhome_macvlan/conf:/opt/adguardhome/conf"
|
||||
- "/volume1/docker/adguardhome_macvlan/conf:/opt/adguardhome/conf"
|
||||
|
||||
# La déclaration des ports n'est pas utile lors d'une installation en macvlan, car tous les ports seront directement accessible
|
||||
# avec l'IP virtuelle.
|
||||
@ -57,10 +72,17 @@ services:
|
||||
|
||||
networks:
|
||||
macvlan-network:
|
||||
ipv4_address: 192.168.xxx.yyy # Mettre ici l'IP macvlan définie dans les scripts
|
||||
ipv4_address: 192.168.xxx.yyy # Mettre ici l'IP macvlan dans la plage définie dans les scripts
|
||||
# Dans mon cas c'est 192.168.2.210
|
||||
|
||||
restart: unless-stopped
|
||||
|
||||
healthcheck:
|
||||
test: "/bin/netstat -pant | /bin/grep 53"
|
||||
interval: 45s
|
||||
timeout: 30s
|
||||
retries: 3
|
||||
|
||||
networks:
|
||||
macvlan-network: # Ce réseau devra bien entendu être créé avant avec le script annexe ou avec Portainer.
|
||||
external: true
|
@ -1,15 +1,28 @@
|
||||
#!/bin/bash
|
||||
|
||||
##============================================================================================##
|
||||
## Script macvlan-network.sh ##
|
||||
## ##
|
||||
## Script de création d'interface virtuelle pour les conteneurs Swag at AdGuard Home ##
|
||||
## Script docker_network_create_macvlan.sh ##
|
||||
## ##
|
||||
## Script de création d'interface virtuelle pour les conteneurs qui auront une IP macvlan ##
|
||||
## Voir tutos : ##
|
||||
## https://www.nas-forum.com/forum/topic/69319-tuto-docker-macvlan-pi-hole/ ##
|
||||
## https://www.nas-forum.com/forum/topic/67311-tuto-certificat-ssl-reverse-proxy-via-docker/ ##
|
||||
## ##
|
||||
## Les IPs prévues pour les conteneurs sont : ##
|
||||
## - AdGuard-Home : 192.168.xxx.yyy ##
|
||||
## - Conteneur A : 192.168.xxx.yyy ##
|
||||
## - AdGuard-Home : 192.168.xxx.ooo ##
|
||||
## ##
|
||||
## Rappels des différentes IP : ##
|
||||
## - Plage d'IP macvlan : 192.168.xxx.MMM/28 ##
|
||||
## - IP virtuelle unique : 192.168.xxx.zzz/32 ##
|
||||
## - IP conteneur n°1 : 192.168.xxx.yyy ##
|
||||
## - IP conteneur n°2 : 192.168.xxx.ooo ##
|
||||
## - Plage d'IP du LAN : 192.168.xxx.0/24 ##
|
||||
## - Passerelle/routeur : 192.168.xxx.1 ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## --ip-range=192.168.xxx.MMM/28 : cela correspond à la plage d'IP pour le réseau macvlan ##
|
||||
@ -28,5 +41,19 @@ docker network create -d macvlan \
|
||||
--subnet=192.168.xxx.0/24 \
|
||||
--ip-range=192.168.xxx.MMM/28 \
|
||||
--gateway=192.168.xxx.1 \
|
||||
-o parent=ovs_eth0 \
|
||||
macvlan-network
|
||||
-o parent=eth0 \ # Ici, eth0 est à remplacer par votre interface réseau : eth0, ovs_eth0 ou autre...
|
||||
macvlan-network
|
||||
|
||||
##==============================================================================================
|
||||
## Pour exemple, voilà mes valeurs à moi : ##
|
||||
## ##
|
||||
## - Conteneur A : 192.168.2.209 ##
|
||||
## - AdGuard-Home : 192.168.2.210 ##
|
||||
## - Conteneur B : 192.168.2.211 ##
|
||||
## ##
|
||||
## Rappels des différentes IP : ##
|
||||
## - Plage d'IP macvlan : 192.168.xxx.MMM/28 == 192.168.2.208/28 ##
|
||||
## - IP virtuelle unique : 192.168.xxx.zzz/32 == 192.168.2.210/32 ##
|
||||
## - Plage d'IP du LAN : 192.168.xxx.0/24 == 192.168.2.0/24 ##
|
||||
## - Passerelle/routeur : 192.168.xxx.1 == 192.168.2.1 ##
|
||||
##==============================================================================================
|
||||
|
@ -1,5 +1,5 @@
|
||||
## Discord Plex FR : https://discord.gg/ERpYMqS
|
||||
## Version 2021-02-26
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
version: '3.3'
|
||||
services:
|
||||
adguardhome:
|
||||
|
@ -1,21 +0,0 @@
|
||||
## Discord Plex FR : https://discord.gg/ERpYMqS
|
||||
## Version 2021-02-26
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
bitwarden:
|
||||
image: bitwardenrs/server
|
||||
restart: unless-stopped
|
||||
# Decommenter les 2 lignes suivantes pour que watchtower surveille ce conteneur
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
ports:
|
||||
- 80:80 # WebUI
|
||||
volumes:
|
||||
- /volume1/docker/bitwarden/bw-data:/data
|
||||
environment:
|
||||
- WEBSOCKET_ENABLED: 'true' # Necessaire pour utiliser websockets
|
||||
- SIGNUPS_ALLOWED: 'true' # Mettre faux une fois le 1er utilisateur creer et redemarrer le conteneur
|
||||
# Network conseillé de ne pas utiliser host (pas de redirection de port) ni default_bridge car limité a 16 ip
|
||||
network_mode: 'bitwardenrs_network'
|
||||
|
@ -1,201 +0,0 @@
|
||||
## Discord Plex FR : https://discord.gg/ERpYMqS
|
||||
## Version 2021-04-12
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Fichier docker-compose.yml pour Bitwarden_RS avec Bitwarden-Backup ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Attention, avec ce fichier, il faut avoir créer le réseau "bitwarden_network" avant de ##
|
||||
## créer les conteneurs. ##
|
||||
## ##
|
||||
## La mise en place de fail2ban se fera avec un docker-compose dédié. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## NOTE IMPORTANTE ##
|
||||
## ----------------- ##
|
||||
## ##
|
||||
## Lors de l'importation d'un fichier contenant beaucoup d'entrées, j'ai eu une erreur ##
|
||||
## 405 Not Allowed - Nginx ##
|
||||
## Après quelques recherches, et un certains nombre de minutes, il s'est avéré que les ##
|
||||
## expiration du délai ... (les timeout) dans le reverse proxy par défaut de 60s étaient ##
|
||||
## trop faible. ##
|
||||
## En passant les 3 valeurs à 300s (5min), ça a réglé mon problème. ##
|
||||
## (Pensez à relancer le script Bitwarden_RS__Enable_Websocket.sh après ces modifications) ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Ajout des Notifications Websocket ##
|
||||
## ##
|
||||
## Pour qu'elles'fonctionnent, il faut configurer le reverse-proxy correctement. ##
|
||||
## Pour celui de DSM, il n'est malheureusement pas possible de configurer les ##
|
||||
## redirections /notifications/hub vers le serveur WebSocket ni celles vers le port normal ##
|
||||
## /notifications/hub/negotiate ##
|
||||
## Voir cet article pour tout ce qui n'est pas possible via l'interface de DSM : ##
|
||||
## https://github.com/dani-garcia/bitwarden_rs/wiki/Enabling-WebSocket-notifications ##
|
||||
## ##
|
||||
## Dès lors, il faut ruser et passer par l'exécution d'un petit script qui va créer un ##
|
||||
## fchier ws.locations contenant les modifications précédentes, et qui va écrire une ##
|
||||
## ligne dans le fichier /etc/nginx/app.d/server.ReverseProxy.conf pour inclure le ##
|
||||
## fichier ws.locations au niveau de la section concernant le nom de domaine pour ##
|
||||
## bitwarden_RS. ##
|
||||
## Comme cela, il n'est pas nécessaire de passer par le changement de reverse-proxy, assez ##
|
||||
## complexe à mettre en oeuvre... ##
|
||||
## ##
|
||||
## Le script est : Bitwarden_RS__Enable_Websocket.sh ##
|
||||
## ##
|
||||
## Il faudra la lancer régulièrement et à chaque redémarrage du NAS, via deux tâches ##
|
||||
## plannifiées dédiées, en donnant 3 paramètres au fichier : ##
|
||||
## - le nom de domaine de bitwarden ##
|
||||
## - le port HTTP exposé (donc pas l'interne du conteneur) pour l'interface graphique ##
|
||||
## - le port websocket exposé (donc pas l'interne du conteneur) ##
|
||||
## Voir les commentaires de ce fichier Bitwarden_RS__Enable_Websocket.sh pour plus ##
|
||||
## d'explications. ##
|
||||
## ##
|
||||
##==============================================================================================
|
||||
|
||||
---
|
||||
version: "2.4"
|
||||
|
||||
services:
|
||||
bitwardenrs: # Voir : https://github.com/dani-garcia/bitwarden_rs
|
||||
image: bitwardenrs/server:latest
|
||||
container_name: bitwardenrs
|
||||
networks:
|
||||
- bitwarden_network
|
||||
environment:
|
||||
# Utiliser la commande (en SSH) : id NOM_UTILISATEUR
|
||||
- PUID=XXxxXX
|
||||
- PGID=XXxxXX
|
||||
- TZ=Europe/Paris
|
||||
|
||||
# Pour l'envoi d'emails
|
||||
- SMTP_HOST=XXxxXX
|
||||
- SMTP_FROM=XXxxXX
|
||||
- SMTP_FROM_NAME=BlaBla
|
||||
- SMTP_PORT=XXxxXX
|
||||
- SMTP_SSL=true
|
||||
- SMTP_USERNAME=XXxxXX
|
||||
- SMTP_PASSWORD=XXxxXX
|
||||
|
||||
- INVITATION_ORG_NAME=Bitwarden_RS [Votre Nom, pseudo...] # Permet de spécifier un nom d'application pour les invitations d'organisation
|
||||
|
||||
# Nécessaire pour activer le 2FA pour la connexion à notre serveur bitwarden_rs
|
||||
# Il est possible de spécifier un port de connexion dans l'URL. Le https:// est obligatoire.
|
||||
# Pour cette option, il est donc OBLIGATOIRE d'avoir fait le nécessaire pour avoir du HTTPS (certificats, reverse-proxy, ...)
|
||||
- DOMAIN=XXxxXX
|
||||
|
||||
# Pour enregistrer les log avec un niveau particulier
|
||||
- LOG_FILE=/data/bitwarden.log
|
||||
- LOG_LEVEL=warn
|
||||
- EXTENDED_LOGGING=true
|
||||
|
||||
# je n'aime pas les indices pour les mots de passe...
|
||||
- SHOW_PASSWORD_HINT=false
|
||||
|
||||
# Pour activer la console d'administation, accessible via : https://mon.domaine.tld/admin/
|
||||
# Voir détails ici : https://github.com/dani-garcia/bitwarden_rs/wiki/Enabling-admin-page
|
||||
# /!\
|
||||
# /!\ N'importe qui pourra accéder à la page de connexion, alors blinder le token d'amdin ci-dessous (64 caractères pour moi) !
|
||||
# /!\ Il est de plus TRÈS important d'avoir ACTIVÉ le HTTPS avant l'activation de cette option.
|
||||
# /!\
|
||||
# Je conseille de ne l'activer qu'en cas de nécessité, et de la désactiver après.
|
||||
# Pour désactiver, il suffit de commenter la ligne ci-dessous.
|
||||
- ADMIN_TOKEN=XXxxXX
|
||||
# À noter :
|
||||
# La première fois que vous enregistrez un paramètre dans la page d'administration, 'config.json' sera généré
|
||||
# dans votre 'DATA_FOLDER'. Les valeurs de ce fichier auront priorité sur les valeurs 'environnement'.
|
||||
|
||||
- SIGNUPS_ALLOWED=false # Fait en sorte que les inscriptions soient bloquées, seul l'admin pourra inviter
|
||||
# des utilisateurs avec un envoi d'email depuis la console d'administation
|
||||
|
||||
- WEBSOCKET_ENABLED=true # Active les WebSocket notifications (Nécessite la configuration du reverse-proxy)
|
||||
# Durant le nombre importants d'essais, j'en suis venu à laisser le port par défaut
|
||||
# pour le WEBSOCKET_PORT. Il est possible que ça fonctionne avec un port différent.
|
||||
# Il faudra alors décommenter la ligne suivante, et changer le port exposé plus bas.
|
||||
#- WEBSOCKET_PORT=3012 # Par défaut = 3012
|
||||
|
||||
# Pour activer la récupération des icones des IP LAN, il faut mettre sur false la variable ICON_BLACKLIST_NON_GLOBAL_IPS
|
||||
- ICON_BLACKLIST_NON_GLOBAL_IPS=false # Par défaut = true
|
||||
|
||||
# On défini ici quelques chemins de dossiers qu'il faudra créer (pas sur que le conteneur les crées lui-même...)
|
||||
- ICON_CACHE_FOLDER=data/icon_cache
|
||||
- ATTACHMENTS_FOLDER=data/attachments
|
||||
- SENDS_FOLDER=data/sends
|
||||
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
|
||||
volumes:
|
||||
- "/volume1/docker/bitwarden_rs/bitwarden-data/:/data/"
|
||||
ports:
|
||||
- XXxxXX:3012 # Choisir un port libre pour le websocket
|
||||
- XXxxXX:80 # Choisir un port libre pour l'interface WEB
|
||||
restart: unless-stopped
|
||||
|
||||
# Sauvegarde automatique de la base de données, au-cas-où !
|
||||
bitwarden_backup: # Voir : https://gitlab.com/1O/bitwarden_rs-backup
|
||||
image: bruceforce/bw_backup:latest
|
||||
container_name: bitwarden_backup
|
||||
networks:
|
||||
- bitwarden_network
|
||||
restart: always
|
||||
depends_on:
|
||||
bitwardenrs:
|
||||
condition: service_healthy
|
||||
labels:
|
||||
- "com.centurylinklabs.watchtower.enable=true"
|
||||
volumes:
|
||||
#- /etc/localtime:/etc/localtime:ro # Devenu inutile sur nos Syno avec la variable d'env. TZ (voir plus bas)
|
||||
- /volume1/docker/bitwarden_rs/bitwarden-data/:/data/
|
||||
# Chemin d'accès pour stocker le backup, voir https://gitlab.com/1O/bitwarden_rs-backup#wrong-permissions
|
||||
- /volume1/docker/bitwarden_rs/bitwarden-backup:/backup_folder/
|
||||
|
||||
environment:
|
||||
# Path to the Bitwarden sqlite3 database inside the container
|
||||
- DB_FILE=/data/db.sqlite3
|
||||
|
||||
# Path to the desired backup location inside the container
|
||||
# - BACKUP_FILE=/data/db_backup/backup.sqlite3
|
||||
- BACKUP_FILE=/backup_folder/backup.sqlite3
|
||||
|
||||
# Sets the permissions of the backup file
|
||||
# The permissions should at least be 700 since the backup folder itself gets the same permissions
|
||||
# and with 600 it would not be accessible.
|
||||
- BACKUP_FILE_PERMISSIONS=700
|
||||
|
||||
# Cronjob format "Minute Hour Day_of_month Month_of_year Day_of_week Year"
|
||||
# https://crontab.guru/#0_9_*_*_*
|
||||
# minutes | heures | jour du mois | mois | jour de la semaine
|
||||
- CRON_TIME=0 18 * * *
|
||||
|
||||
# Set to true to append timestamp to the BACKUP_FILE
|
||||
- TIMESTAMP=true
|
||||
|
||||
# User ID to run the cron job with
|
||||
- UID=1038 # J'ai créé un utilisateur dédié à Bitwarden, utiliser la commande 'id nom_user'
|
||||
|
||||
# Group ID to run the cron job with
|
||||
- GID=100
|
||||
|
||||
# Path to the logfile inside the container
|
||||
#- LOGFILE
|
||||
|
||||
# Path to the cron file inside the container
|
||||
#- CRONFILE
|
||||
|
||||
# Delete old backups after X many days
|
||||
- DELETE_AFTER=14
|
||||
|
||||
# If you need timestamps in your local timezone you should mount /etc/timezone:/etc/timezone:ro and
|
||||
# /etc/localtime:/etc/localtime:ro like it's done in the docker-compose.yml.
|
||||
# An other possible solution is to set the environment variable accordingly (like TZ=Europe/Berlin)
|
||||
# (see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for more information).
|
||||
- TZ=Europe/Paris
|
||||
|
||||
|
||||
networks:
|
||||
bitwarden_network:
|
||||
external:
|
||||
name: bitwarden_network
|
27
docker-compose/dashy/docker-compose.yml
Normal file
@ -0,0 +1,27 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
|
||||
version: "3.8"
|
||||
services:
|
||||
dashy:
|
||||
container_name: Dashy
|
||||
image: lissy93/dashy
|
||||
# Decommenter les 2 lignes suivantes pour que watchtower surveille ce conteneur
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
volumes:
|
||||
- /volume1/docker/dashy/conf.yml:/app/public/conf.yml
|
||||
- /volume1/docker/dashy/item-icons:/app/public/item-icons
|
||||
ports:
|
||||
- 4000:80
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- UID=1000
|
||||
- GID=1000
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ['CMD', 'node', '/app/services/healthcheck']
|
||||
interval: 1m30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
33
docker-compose/dashy/readme.md
Normal file
@ -0,0 +1,33 @@
|
||||
Dashy
|
||||
============
|
||||
|
||||
Dashy vous aide à organiser vos services auto-hébergés, en les rendant tous accessibles à partir d'un seul endroit
|
||||
|
||||
<p align="center">
|
||||
<img width="220" src="https://i.ibb.co/yhbt6CY/dashy.png" />
|
||||
</p>
|
||||
|
||||
## Caractéristiques
|
||||
|
||||
* Recherche instantanée par nom, domaine et tags - commencez simplement à taper
|
||||
* Raccourcis clavier entièrement personnalisables pour la navigation, le filtrage et le lancement d'applications
|
||||
* Plusieurs thèmes de couleurs intégrés, avec éditeur de couleurs d'interface utilisateur et prise en charge du CSS personnalisé
|
||||
* Disposition personnalisable, tailles, texte, visibilité des composants, comportement et couleurs, etc.
|
||||
* De nombreuses options pour les icônes, y compris la prise en charge de Font-Awesome, le favicon à récupération automatique, les images et les emojis
|
||||
* Possibilité d'afficher l'état du service pour chacune de vos applications/liens, pour une surveillance de base de la disponibilité et de la disponibilité
|
||||
* Choisissez comment lancer les applications, que ce soit dans votre navigateur, une vue modale contextuelle ou un espace de travail
|
||||
* Option pour l'image d'arrière-plan en plein écran, les liens de barre de navigation personnalisés, le pied de page html, le titre, etc.
|
||||
* Fonctionnalité de sauvegarde et de restauration en nuage cryptée en option disponible
|
||||
* Authentification facultative avec prise en charge multi-utilisateurs et privilèges configurables pour protéger votre tableau de bord
|
||||
* La petite taille de l'ensemble, l'interface utilisateur et la PWA entièrement réactives rendent l'application facile à utiliser sur n'importe quel appareil
|
||||
* Facile à configurer avec Docker, ou sur bare metal, ou avec un déploiement cloud en un clic
|
||||
* Prise en charge multilingue, avec plus de langues ajoutées régulièrement
|
||||
* Configuration simple basée sur YAML à fichier unique, ou configuration de l'application directement via l'interface utilisateur
|
||||
* Fort accent sur la confidentialité
|
||||
* Et bien plus encore...
|
||||
|
||||
## Demo ⚡
|
||||
|
||||
[Demo 1](https://dashy-demo-1.as93.net) ┆ [Demo 2](https://dashy-demo-2.as93.net) ┆ [Demo 3](https://dashy-demo-3.as93.net)
|
||||
|
||||
Lien du Github : https://github.com/Lissy93/dashy
|
19
docker-compose/deluge/docker-compose.yml
Normal file
@ -0,0 +1,19 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
|
||||
version: "2.1"
|
||||
services:
|
||||
deluge:
|
||||
image: ghcr.io/linuxserver/deluge:latest
|
||||
container_name: deluge
|
||||
environment:
|
||||
- PUID=1000 # Utiliser la commande (en SSH) : id NOM_UTILISATEUR
|
||||
- PGID=1000 # Utiliser la commande (en SSH) : id NOM_UTILISATEUR
|
||||
ports:
|
||||
- 8112:8112 # Port de gauche à modifier si nécessaire
|
||||
volumes:
|
||||
- /volume1/docker/deluge/config:/config # Chemin des fichiers de configuration de Deluge
|
||||
- /volume1/torrent:/downloads # Chemin où Deluge dépose les téléchargements
|
||||
restart: unless-stopped
|
||||
labels:
|
||||
- com.centurylinklabs.watchtower.enable=true # Ce label permet à Watchtower de faire les mises à jour automatiquement
|
22
docker-compose/docker-compose.yml
Normal file
@ -0,0 +1,22 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-09-18
|
||||
##
|
||||
## Pour une aide à l'installation, consulter le README
|
||||
##
|
||||
version: "2.1"
|
||||
|
||||
services:
|
||||
unifi-controller:
|
||||
image: ghcr.io/linuxserver/unifi-controller
|
||||
container_name: unifi-controller
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
network_mode: host
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- MEM_LIMIT=1024M
|
||||
- MEM_STARTUP=1024M
|
||||
volumes:
|
||||
- /volume1/docker/unifi/config:/config
|
||||
restart: unless-stopped
|
@ -1,5 +1,5 @@
|
||||
## Discord Plex FR : https://discord.gg/ERpYMqS
|
||||
## Version 2021-03-03
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
version: '3.3'
|
||||
services:
|
||||
linuxserver:
|
||||
|
@ -79,7 +79,7 @@ services:
|
||||
|
||||
# Les différents chemins d'accès vers les fichiers log des services à protéger par fail2ban
|
||||
# On ajoute ro pour read-only (lecture seule)
|
||||
- "/volume1/docker/bitwarden_rs/bitwarden-data:/bitwarden:ro" # Bitwarden_RS
|
||||
- "/volume1/docker/vaultwarden/vaultwarden-data:/vaultwarden:ro" # Vaultwarden
|
||||
- "/volume1/docker/gitea/data/gitea/log:/gitea:ro" # Gitea
|
||||
#- "/var/log/auth.log:/log/host_ssh_auth.log:ro" # SSH sur l'hôte (Synology)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# /volume1/docker/fail2ban/filter.d/bitwarden_rs-admin.conf
|
||||
# /volume1/docker/fail2ban/filter.d/vaultwarden-admin.conf
|
||||
|
||||
[INCLUDES]
|
||||
before = common.conf
|
@ -1,4 +1,4 @@
|
||||
# /volume1/docker/fail2ban/filter.d/bitwarden_rs.conf
|
||||
# /volume1/docker/fail2ban/filter.d/vaultwarden.conf
|
||||
|
||||
[INCLUDES]
|
||||
before = common.conf
|
@ -1,4 +1,4 @@
|
||||
# /volume1/docker/fail2ban/jail.d/bitwarden_rs-admin.conf
|
||||
# /volume1/docker/fail2ban/jail.d/vaultwarden-admin.conf
|
||||
|
||||
[DEFAULT]
|
||||
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
|
||||
@ -27,11 +27,11 @@ action = %(action_mwl)s
|
||||
backend = auto
|
||||
|
||||
|
||||
[bitwarden_rs-admin]
|
||||
[vaultwarden-admin]
|
||||
enabled = true
|
||||
port = 882,3012
|
||||
|
||||
# Doit correspondre au nom du fichier .conf dans le dossier filter.d
|
||||
filter = bitwarden_rs-admin
|
||||
filter = vaultwarden-admin
|
||||
|
||||
logpath = /bitwarden/bitwarden.log
|
||||
logpath = /vaultwarden/vaultwarden.log
|
@ -1,4 +1,4 @@
|
||||
# /volume1/docker/fail2ban/jail.d/bitwarden_rs.conf
|
||||
# /volume1/docker/fail2ban/jail.d/vaultwarden.conf
|
||||
|
||||
[DEFAULT]
|
||||
# "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
|
||||
@ -27,11 +27,11 @@ action = %(action_mwl)s
|
||||
backend = auto
|
||||
|
||||
|
||||
[bitwarden_rs]
|
||||
[vaultwarden]
|
||||
enabled = true
|
||||
port = 882,3012
|
||||
|
||||
# Doit correspondre au nom du fichier .conf dans le dossier filter.d
|
||||
filter = bitwarden_rs
|
||||
filter = vaultwarden
|
||||
|
||||
logpath = /bitwarden/bitwarden.log
|
||||
logpath = /vaultwarden/vaultwarden.log
|
43
docker-compose/ghost-mysql/docker-compose.yml
Normal file
@ -0,0 +1,43 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2022-08-21
|
||||
version: '3.1'
|
||||
|
||||
services:
|
||||
ghost:
|
||||
container_name: blog_ghost
|
||||
image: ghost:5-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 2368:2368
|
||||
volumes:
|
||||
- ./ghost_content:/var/lib/ghost/content
|
||||
environment:
|
||||
url: https://blog.ndd.fr # LIEN DU BLOG, peut être http://IP_LOCAL:2368 si utilisation local uniquement
|
||||
database__client: mysql
|
||||
database__connection__host: db
|
||||
database__connection__user: root
|
||||
database__connection__password: PASSWORD_SUPER_FORT # CHOISIR UN MOT DE PASSE
|
||||
database__connection__database: ghost
|
||||
# - DEBUT - CONFIGURATION MAIL - NON OBLIGATOIRE #
|
||||
# mail__transport: SMTP
|
||||
# mail__from: monmail@ndd.fr
|
||||
# mail__options__service: SMTP
|
||||
# mail__options__host: serveur.smtp.net
|
||||
# mail__options__port: <PORT_SMTP>
|
||||
# mail__options__auth__user: nom_utilisateur
|
||||
# mail__options__auth__pass: mon_mot_de_passe
|
||||
# - FIN - CONFIGURATION MAIL - NON OBLIGATOIRE #
|
||||
depends_on:
|
||||
- db
|
||||
mem_limit: 512m
|
||||
|
||||
db:
|
||||
container_name: blog_db
|
||||
image: mysql:8-debian
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: PASSWORD_SUPER_FORT # RE-UTILISER LE MOT DE PASSE CHOISI DANS LES VARIABLES DE GHOST
|
||||
volumes:
|
||||
- ./ghost_db:/var/lib/mysql
|
||||
mem_limit: 768m
|
||||
|
26
docker-compose/ghost/docker-compose.yml
Normal file
@ -0,0 +1,26 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
ghost:
|
||||
container_name: ghost
|
||||
image: ghost:4-alpine
|
||||
# Decommenter les 2 lignes suivantes pour que watchtower surveille ce conteneur
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- ghost-network
|
||||
restart: always
|
||||
ports:
|
||||
- 2368:2368
|
||||
volumes:
|
||||
- /mnt/volume1/docker/ghost/content:/var/lib/ghost/content
|
||||
environment:
|
||||
url : http://192.168.1.10:2368
|
||||
|
||||
networks:
|
||||
ghost-network:
|
||||
external:
|
||||
name: ghost-network
|
@ -1,99 +1,118 @@
|
||||
Changer le thème de Gitea <!-- omit in toc -->
|
||||
============
|
||||
---
|
||||
> :pencil2: **Mise à jour :** Ajout de la possibilité de changer le style dans le menu `Configuration / Comptes / Sélectionner le thème par défaut` pour les thèmes Gitea de [theme.park](https://github.com/gilbN/theme.park/wiki/Gitea). <br>
|
||||
*Voir* [§ 2. Ajouter les différents thèmes en laissant le choix à l'utilisateur](#2-ajouter-les-différents-thèmes-en-laissant-le-choix-à-l-utilisateur)
|
||||
> :pencil2: **Mise à jour v3.1 :** Suppression du `header.tmpl` au profit de `body_outer_pre.tmpl` suite à la MAJ par theme-park ([voir ici](https://github.com/GilbN/theme.park/issues/293#issuecomment-972038142)). Suppression de l'ancienne méthode.<br>
|
||||
> :pencil2: **Mise à jour v3.0 :** Gros changement `header.tmpl` suite à la MAJ par theme-park. Suppression de l'ancienne méthode.<br>
|
||||
> :pencil2: **Mise à jour v2.1 :** Petit changement du `header.tmpl` suite à la MAJ 1.15 de Gitea.<br>
|
||||
> :pencil2: **Mise à jour :** De nouveaux thèmes sont disponibles. Il faut re-télécharger les fichiers CSS. <br>
|
||||
*Voir* [§ 1. Ajouter les différents thèmes en laissant le choix à l'utilisateur](#1-ajouter-les-différents-thèmes-en-laissant-le-choix-à-lutilisateur)
|
||||
---
|
||||
|
||||
:arrow_forward: Vous pouvez trouver quelques thèmes ici : https://gitea.com/gitea/awesome-gitea#themes
|
||||
|
||||
:book: Dans la suite de ce tuto, on ne parlera que des thèmes Gitea de [theme.park](https://github.com/gilbN/theme.park/wiki/Gitea).
|
||||
:book: Dans la suite de ce tuto, on ne parlera que des thèmes Gitea de [theme.park](https://docs.theme-park.dev/themes/gitea/).
|
||||
|
||||
## Table des matières <!-- omit in toc -->
|
||||
- [1. Modifier le thème sans laisser le choix à l'utilisateur](#1-modifier-le-thème-sans-laisser-le-choix-à-l-utilisateur)
|
||||
- [1.1. Installer le thème](#1-1-installer-le-thème)
|
||||
- [1.2. Exemple avec le dernier lien du dépôt donnée précédemment](#1-2-exemple-avec-le-dernier-lien-du-dépôt-donnée-précédemment)
|
||||
- [1.2.1. Installer le thème (imposé pour tous)](#1-2-1-installer-le-thème-imposé-pour-tous)
|
||||
- [1.2.2. Changer le thème](#1-2-2-changer-le-thème)
|
||||
- [2. Ajouter les différents thèmes en laissant le choix à l'utilisateur](#2-ajouter-les-différents-thèmes-en-laissant-le-choix-à-l-utilisateur)
|
||||
- [1. Ajouter les différents thèmes en laissant le choix à l'utilisateur](#1-ajouter-les-différents-thèmes-en-laissant-le-choix-à-l-utilisateur)
|
||||
- [1.1. Création des dossiers dans `/volume1/docker/gitea/data/`](#1-1-création-des-dossiers-dans-volume1-docker-gitea-data)
|
||||
- [1.2. Création du fichier `body_outer_pre.tmpl` -- MAJ v3.1](#1-2-création-du-fichier-body-outer-pre-tmpl-maj-v3-1)
|
||||
- [1.3. Modification du fichier `/data/gitea/conf/app.ini`](#1-3-modification-du-fichier-data-gitea-conf-app-ini)
|
||||
- [1.3.1. Point info sur la modification de ce fichier](#1-3-1-point-info-sur-la-modification-de-ce-fichier)
|
||||
- [1.3.2. Ce qu'il faut ajouter au fichier `/data/gitea/conf/app.ini`](#1-3-2-ce-qu-il-faut-ajouter-au-fichier-data-gitea-conf-app-ini)
|
||||
- [2.4.3. Redémarrer le conteneur](#2-4-3-redémarrer-le-conteneur)
|
||||
- [2.5. Choisir son thème dans l'interface graphique de Gitea](#2-5-choisir-son-thème-dans-l-interface-graphique-de-gitea)
|
||||
- [2. Méthode précédente - Ajouter les différents thèmes en laissant le choix à l'utilisateur (Laissée pour la postérité)](#2-méthode-précédente-ajouter-les-différents-thèmes-en-laissant-le-choix-à-l-utilisateur-laissée-pour-la-postérité)
|
||||
- [2.1. Création des dossiers dans `/volume1/docker/gitea/data/`](#2-1-création-des-dossiers-dans-volume1-docker-gitea-data)
|
||||
- [2.2. Télécharger les différents css](#2-2-télécharger-les-différents-css)
|
||||
- [2.3. Création du fichier `header.tmpl`](#2-3-création-du-fichier-header-tmpl)
|
||||
- [2.3. Création du fichier `header.tmpl` -- MAJ v2.1](#2-3-création-du-fichier-header-tmpl-maj-v2-1)
|
||||
- [2.4. Modification du fichier `/data/gitea/conf/app.ini`](#2-4-modification-du-fichier-data-gitea-conf-app-ini)
|
||||
- [2.4.1. Point info sur la modification de ce fichier](#2-4-1-point-info-sur-la-modification-de-ce-fichier)
|
||||
- [2.4.2. Ce qu'il faut ajouter au fichier `/data/gitea/conf/app.ini`](#2-4-2-ce-qu-il-faut-ajouter-au-fichier-data-gitea-conf-app-ini)
|
||||
- [2.4.3. Redémarrer le conteneur](#2-4-3-redémarrer-le-conteneur)
|
||||
- [2.5. Choisir son thème dans l'interface graphique de Gitea](#2-5-choisir-son-thème-dans-l-interface-graphique-de-gitea)
|
||||
- [2.4.3. Redémarrer le conteneur](#2-4-3-redémarrer-le-conteneur-1)
|
||||
- [2.5. Choisir son thème dans l'interface graphique de Gitea](#2-5-choisir-son-thème-dans-l-interface-graphique-de-gitea-1)
|
||||
|
||||
# 1. Modifier le thème sans laisser le choix à l'utilisateur
|
||||
|
||||
## 1.1. Installer le thème
|
||||
---
|
||||
|
||||
Il faut vérifier si la variable GITEA_CUSTOM a été paramétrée. En temps normal, ce n'est pas le cas.
|
||||
# 1. Ajouter les différents thèmes en laissant le choix à l'utilisateur
|
||||
|
||||
Si ce n'est pas le cas, on peut aller vérifier le chemin qui est paramétré pour le dossier dit CUSTOM de gitea. Pour celà, il faut aller ici : <br>
|
||||
> :memo: Cette partie devrait être compatible avec d'autres thèmes qui n'apportent qu'un seul fichier `.css`. ***À confirmer...***
|
||||
|
||||
## 1.1. Création des dossiers dans `/volume1/docker/gitea/data/`
|
||||
|
||||
- Il faut vérifier si la variable GITEA_CUSTOM a été paramétrée. En temps normal, ce n'est pas le cas.
|
||||
|
||||
- Si ce n'est pas le cas, on peut aller vérifier le chemin qui est paramétré pour le dossier dit CUSTOM de gitea. Pour celà, il faut aller ici :
|
||||
`https://url-de-votre-gitea.tlds/admin/config`
|
||||
|
||||
Puis chercher la ligne `GITEA_CUSTOM` où apparaîtra le chemin d'accès : `/data/gitea`.
|
||||
- Puis chercher la ligne `GITEA_CUSTOM` où apparaîtra le chemin d'accès : `/data/gitea`.
|
||||
|
||||
Dans le cas d'une installation Docker, ça donnerait ceci : `/docker/gitea/data/gitea`
|
||||
- Dans le cas d'une installation Docker, ça donnerait ceci : `/docker/gitea/data/gitea`
|
||||
<br>(voir le fichier **docker-compose.yml** pour le chemin d'accès avant le `/data/gitea`)
|
||||
|
||||
Il faudra alors créer les dossiers suivants :
|
||||
- Il faudra alors créer les dossiers suivants :
|
||||
|
||||
- `public`
|
||||
- `templates`
|
||||
- `templates/custom`
|
||||
- `public`
|
||||
- `public/css`
|
||||
- `templates`
|
||||
- `templates/custom`
|
||||
|
||||
Puis il faudra suivre les instructions du thème choisi. Pour ceux qui n'auraient pas d'instructions, le fichier `styles.css` devra se trouver dans le dossier `public`.
|
||||
## 1.2. Création du fichier `body_outer_pre.tmpl` -- MAJ v3.1
|
||||
|
||||
## 1.2. Exemple avec le dernier lien du dépôt donnée précédemment
|
||||
|
||||
### 1.2.1. Installer le thème (imposé pour tous)
|
||||
|
||||
Je vais prendre le dernier lien présent dans le dépôt donné avant la table des matières.
|
||||
|
||||
> - [theme.park](https://github.com/gilbN/theme.park/wiki/Gitea) - A theme suite for Gitea.
|
||||
|
||||
Dans ce nouveau dépôt ( https://github.com/gilbN/theme.park/wiki/Gitea ) vous trouverez plusieurs thèmes.
|
||||
|
||||
Je trouve les thèmes plex, dark et space-gray relativement sympas.
|
||||
Des captures sont présentes plus bas dans la page : https://github.com/gilbN/theme.park/wiki/Gitea#screenshots
|
||||
|
||||
Il faut créer deux fichiers :
|
||||
|
||||
- `public/styles.css` qui contient (avec des commentaires perso) :
|
||||
```css
|
||||
/* Source : https://github.com/gilbN/theme.park/wiki/Gitea
|
||||
Possibilités : https://gilbn.github.io/theme.park/CSS/themes/gitea/XXX.css
|
||||
aquamarine.css <--- pas terrible
|
||||
hotline.css
|
||||
plex.css <--- TOP
|
||||
dark.css <--- TOP
|
||||
space-gray.css <--- TOP
|
||||
organizr-dark.css
|
||||
*/
|
||||
@import url("https://gilbn.github.io/theme.park/CSS/themes/gitea/plex.css");
|
||||
- Supprimer le fichier `header.tmpl` du le dossier `.../templates/custom/` s'il est présent (créé lors d'une méthode précédente dépréciée).
|
||||
- Créer le fichier `body_outer_pre.tmpl` et l'enregistrer dans le dossier `.../templates/custom/` créé précédemment.
|
||||
```go
|
||||
<!-- Voir : https://docs.theme-park.dev/themes/gitea/#adding-the-themes-in-gitea -->
|
||||
{{ if .IsSigned }}
|
||||
{{ if and (ne .SignedUser.Theme "gitea") (ne .SignedUser.Theme "arc-green") }}
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{.SignedUser.Theme}}.css">
|
||||
{{end}}
|
||||
{{ else if and (ne DefaultTheme "gitea") (ne DefaultTheme "arc-green") }}
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{DefaultTheme}}.css">
|
||||
{{end}}
|
||||
```
|
||||
- Vous pouvez aussi récupérer le fichier tout prêt [dans dossier `data--gitea/public/template/custom/` de ce dépôt](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/gitea/data--gitea/templates/custom/body_outer_pre.tmpl). Il contient en commentaires quelques détails.
|
||||
|
||||
- `templates/custom/header.tmpl` qui contient :
|
||||
```html
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/styles.css">
|
||||
## 1.3. Modification du fichier `/data/gitea/conf/app.ini`
|
||||
|
||||
### 1.3.1. Point info sur la modification de ce fichier
|
||||
|
||||
Pour modifier ce fichier, il se peut que vous n'ayez pas les permissions d'enregistrer les modifications apportées... Il faudra alors le copier ailleurs, faire les modifications et sauvegarder, puis re-copier dans l'autre sens le fichier dans son dossier d'origine.
|
||||
|
||||
C'est ce que je dois faire. Depuis une ligne de commande SSH, je fais :
|
||||
- Je copie le fichier dans un dossier où mon utilisateur Admin à les droits en écriture (je ne me logue pas avec l'utilisateur choisir pour Gitea) : <br>`cp /volume1/docker/gitea/data/gitea/conf/app.ini /volume1/docker/gitea/`
|
||||
- Je modifie et sauvegarde mon fichier...
|
||||
- puis je copie en retour le fichier modifier : `cp /volume1/docker/gitea/app.ini /volume1/docker/gitea/data/gitea/conf/`
|
||||
- Il faut ensuite relancer le conteneur Gitea avec Portainer/DSM ou en CLI : `docker restart gitea`
|
||||
|
||||
### 1.3.2. Ce qu'il faut ajouter au fichier `/data/gitea/conf/app.ini`
|
||||
|
||||
Il faut ajouter ceci au fichier `app.ini` :
|
||||
|
||||
```ini
|
||||
[ui]
|
||||
THEMES = gitea,arc-green,dracula,plex,dark,aquamarine,hotline,hotpink,nord,organizr,overseerr,space-gray,onedark,blackberry-abyss,blackberry-amethyst,blackberry-carol,blackberry-dreamscape,blackberry-flamingo,blackberry-hearth,blackberry-martian,blackberry-pumpkin,blackberry-royal,blackberry-shadow,blackberry-solar,blackberry-vanta
|
||||
DEFAULT_THEME = dracula
|
||||
```
|
||||
Une fois les fichiers créés et placés dans ces dossiers (faire attention aux permissions), il suffit de redémarrer Gitea (ou le conteneur si installation en Docker).
|
||||
> :memo: Note 1 : Il se peut que la section `[ui]` soit déjà présente dans votre `app.ini`, il faudra alors modifier la ligne `THEMES`.
|
||||
> :memo: Note 2 : **Le thème par défaut n'a plus besoin d'être obligatoirement "gitea".**
|
||||
|
||||
### 1.2.2. Changer le thème
|
||||
### 2.4.3. Redémarrer le conteneur
|
||||
|
||||
Pour changer le thème, il suffit de :
|
||||
Il faut bien penser à redémarrer le conteneur une fois le app.ini modifié et copié dans `/data/gitea/conf/`.
|
||||
|
||||
- modifier le `public/styles.css` avec le nom du css désiré ;
|
||||
- redémarrer Gitea ;
|
||||
- ne pas oublier de vider le cache du navigateur... sinon le nouveau thème ne sera pas visible... (ça m'a pris 15 minutes d'essais et au bout de ce temps l'utilisation d'un autre navigateur pour le comprendre...).
|
||||
## 2.5. Choisir son thème dans l'interface graphique de Gitea
|
||||
|
||||
---
|
||||
---
|
||||

|
||||
|
||||
# 2. Ajouter les différents thèmes en laissant le choix à l'utilisateur
|
||||

|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
|
||||
# 2. Méthode précédente - Ajouter les différents thèmes en laissant le choix à l'utilisateur (Laissée pour la postérité)
|
||||
|
||||
> :memo: Cette partie devrait être compatible avec d'autres thèmes qui n'apportent qu'un seul fichier `.css`. ***À confirmer...***
|
||||
|
||||
@ -118,17 +137,23 @@ Pour changer le thème, il suffit de :
|
||||
|
||||
## 2.2. Télécharger les différents css
|
||||
|
||||
- Télécharger les différents thèmes .css ici : https://github.com/gilbN/theme.park/tree/master/CSS/themes/gitea.
|
||||
- Télécharger les différents fichiers .css [du dossier `data--gitea/public/css/` de ce dépôt](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/gitea/data--gitea/public/css).
|
||||
*(Ne pas les renommer.)*
|
||||
- Placer ces fichiers dans le dossier `...public/css` créé précédemment.
|
||||
|
||||
## 2.3. Création du fichier `header.tmpl`
|
||||
## 2.3. Création du fichier `header.tmpl` -- MAJ v2.1
|
||||
|
||||
- Créer le fichier `header.tmpl` et l'enregistrer dans le dossier `.../templates/custom/` créé précédemment.
|
||||
```html
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/{{DefaultTheme}}.css">
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/{{.SignedUser.Theme}}.css">
|
||||
{{if .IsSigned }}
|
||||
{{ if ne .SignedUser.Theme "gitea" }}
|
||||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/{{.SignedUser.Theme}}.css?v={{MD5 AppVer}}">
|
||||
{{end}}
|
||||
{{else if ne DefaultTheme "gitea"}}
|
||||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme}}.css?v={{MD5 AppVer}}">
|
||||
{{end}}
|
||||
```
|
||||
- Vous pouvez aussi récupérer le fichier tout prêt [dans dossier `data--gitea/public/template/custom/` de ce dépôt](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/gitea/data--gitea/templates/custom/header.tmpl). Il contient en commentaires quelques détails.
|
||||
|
||||
## 2.4. Modification du fichier `/data/gitea/conf/app.ini`
|
||||
|
||||
@ -148,14 +173,15 @@ Il faut ajouter ceci au fichier `app.ini` :
|
||||
|
||||
```ini
|
||||
[ui]
|
||||
THEMES = gitea,arc-green,plex,aquamarine,dark,hotline,organizr-dark,space-gray
|
||||
DEFAULT_THEME = arc-green
|
||||
THEMES = gitea,arc-green,dracula,dracula-test,plex,dark,aquamarine,hotline,hotpink,nord,organizr,overseerr,space-gray,onedark,blackberry-abyss,blackberry-amethyst,blackberry-carol,blackberry-dreamscape,blackberry-flamingo,blackberry-hearth,blackberry-martian,blackberry-pumpkin,blackberry-royal,blackberry-shadow,blackberry-solar,blackberry-vanta
|
||||
DEFAULT_THEME = gitea
|
||||
```
|
||||
> :memo: Note : Il se peut que la section `[ui]` soit déjà présente dans votre `app.ini`, il faudra alors modifier la ligne `THEMES`.
|
||||
> :memo: Note 1 : Il se peut que la section `[ui]` soit déjà présente dans votre `app.ini`, il faudra alors modifier la ligne `THEMES`.
|
||||
> :memo: Note 2 : **Il faut que le thème par défaut soit "gitea" car les nouveaux thèmes de theme.park se base sur celui-là.**
|
||||
|
||||
### 2.4.3. Redémarrer le conteneur
|
||||
|
||||
Il faut bien penser à redémarrer le conteneur.
|
||||
Il faut bien penser à redémarrer le conteneur une fois le app.ini modifié et copié dans `/data/gitea/conf/`.
|
||||
|
||||
## 2.5. Choisir son thème dans l'interface graphique de Gitea
|
||||
|
||||
@ -168,4 +194,6 @@ Il faut bien penser à redémarrer le conteneur.
|
||||
|
||||
---
|
||||
|
||||
Voilà, c'est la fin :D
|
||||
Voilà, c'est la fin :D
|
||||
|
||||
---
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
@ -6,30 +5,43 @@
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA AQUAMARINE THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: radial-gradient(ellipse at center, #47918a 0%, #0b3161 100%) center center/cover no-repeat fixed;
|
||||
--modal-bg-color: radial-gradient(ellipse at top, #47918a 0%, #0b3161 100%) center center/cover no-repeat fixed;
|
||||
--button-color: #009688;
|
||||
--button-color-hover: #12afa0;
|
||||
--button-text: #eee;
|
||||
--accent-color: #12afa0;
|
||||
--accent-color-hover: #fff;
|
||||
--text: #eee;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-color: #12afa0;
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
--heatmap-color-1: #002D24;
|
||||
--heatmap-color-2: #004B40;
|
||||
--heatmap-color-3: #006B5F;
|
||||
--heatmap-color-4: #008C7E;
|
||||
--heatmap-color-5: #12AFA0;
|
||||
}
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/aquamarine.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-abyss.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-amethyst.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-carol.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-dreamscape.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-flamingo.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-hearth.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-martian.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-pumpkin.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-royal.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-shadow.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-solar.css";
|
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/blackberry-vanta.css";
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
@ -6,30 +5,43 @@
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA DARK THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: radial-gradient(circle, #3a3a3a, #2d2d2d, #202020, #141414, #000000) center center/cover no-repeat fixed;
|
||||
--modal-bg-color: radial-gradient(circle , #3a3a3a, #2d2d2d, #202020, #141414, #000000) center center/cover no-repeat fixed;
|
||||
--button-color: hsla(0,0%,100%,.15);
|
||||
--button-color-hover: hsla(0,0%,100%,.30);
|
||||
--button-text: #eee;
|
||||
--accent-color: #646464;
|
||||
--accent-color-hover: #ffffff73;
|
||||
--text: #b7b7b7;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-hover: rgba(255, 255, 255, 0.45);
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
--heatmap-color-1: #303030;
|
||||
--heatmap-color-2: #5E5E5E;
|
||||
--heatmap-color-3: #919191;
|
||||
--heatmap-color-4: #C6C6C6;
|
||||
--heatmap-color-5: #FFFFFF;
|
||||
}
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/dark.css";
|
47
docker-compose/gitea/data--gitea/public/css/dracula-test.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/dracula.css";
|
47
docker-compose/gitea/data--gitea/public/css/dracula.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/dracula.css";
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
@ -6,30 +5,43 @@
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA HOTLINE THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: radial-gradient(ellipse at center, #F44336 0%, #0b3161 100%) center center/cover no-repeat fixed;
|
||||
--modal-bg-color: radial-gradient(ellipse at top, #F44336 0%, #0b3161 100%) center center/cover no-repeat fixed;
|
||||
--button-color: hsla(0,0%,100%,.15);
|
||||
--button-color-hover: hsla(0,0%,100%,.30);
|
||||
--button-text: #eee;
|
||||
--accent-color: #F44336;
|
||||
--accent-color-hover: #0b3161;
|
||||
--text: #eee;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-hover: #F44336;
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
--heatmap-color-1: #690000;
|
||||
--heatmap-color-2: #890000;
|
||||
--heatmap-color-3: #AC0002;
|
||||
--heatmap-color-4: #D0191D;
|
||||
--heatmap-color-5: #F44336;
|
||||
}
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/hotline.css";
|
47
docker-compose/gitea/data--gitea/public/css/hotpink.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/hotpink.css";
|
47
docker-compose/gitea/data--gitea/public/css/nord.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/nord.css";
|
59
docker-compose/gitea/data--gitea/public/css/onedark.css
Normal file
@ -0,0 +1,59 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
blackberry-abyss.css
|
||||
blackberry-amethyst.css
|
||||
blackberry-carol.css
|
||||
blackberry-dreamscape.css
|
||||
blackberry-flamingo.css
|
||||
blackberry-hearth.css
|
||||
blackberry-martian.css
|
||||
blackberry-pumpkin.css
|
||||
blackberry-royal.css
|
||||
blackberry-shadow.css
|
||||
blackberry-solar.css
|
||||
blackberry-vanta.css
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/onedark.css";
|
@ -1,35 +0,0 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA ORGANIZR-DARK THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: #1f1f1f;
|
||||
--modal-bg-color: #1b1b1b;
|
||||
--button-color: #2cabe3;
|
||||
--button-color-hover: rgb(44 171 227 / .8);
|
||||
--button-text: #eee;
|
||||
--accent-color:#2cabe3;
|
||||
--accent-color-hover: #fff;
|
||||
--text: #96a2b4;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-color: #2cabe3;
|
||||
|
||||
--heatmap-color-1: #002A57;
|
||||
--heatmap-color-2: #004878;
|
||||
--heatmap-color-3: #00679A;
|
||||
--heatmap-color-4: #0088BE;
|
||||
--heatmap-color-5: #2CABE3;
|
||||
}
|
47
docker-compose/gitea/data--gitea/public/css/organizr.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/organizr.css";
|
47
docker-compose/gitea/data--gitea/public/css/overseerr.css
Normal file
@ -0,0 +1,47 @@
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
/* 88 88' `88 88ooood8 88'`88'`88 88ooood8 88' `88 88' `88 88' `88 88888" */
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/overseerr.css";
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
@ -6,30 +5,43 @@
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA PLEX THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: url("https://raw.githubusercontent.com/gilbN/theme.park/master/Resources/blur-noise.png"), url("https://raw.githubusercontent.com/gilbN/theme.park/master/Resources/preset-light2.png") center center/cover no-repeat fixed;
|
||||
--modal-bg-color: url("https://raw.githubusercontent.com/gilbN/theme.park/master/Resources/blur-noise.png"), url("https://raw.githubusercontent.com/gilbN/theme.park/master/Resources/preset-dark2.png") center center/cover no-repeat fixed;
|
||||
--button-color: #cc7b19;
|
||||
--button-color-hover: #e59029;
|
||||
--button-text: #eee;
|
||||
--accent-color: #e5a00d;
|
||||
--accent-color-hover: #ffc107;
|
||||
--text: #eee;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-color:#fff;
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
--heatmap-color-1: #492000;
|
||||
--heatmap-color-2: #6E4500;
|
||||
--heatmap-color-3: #9B6C00;
|
||||
--heatmap-color-4: #CC9500;
|
||||
--heatmap-color-5: #FFC107;
|
||||
}
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/plex.css";
|
@ -1,4 +1,3 @@
|
||||
|
||||
/* dP dP dP */
|
||||
/* 88 88 88 */
|
||||
/* d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP */
|
||||
@ -6,31 +5,43 @@
|
||||
/* 88 88 88 88. ... 88 88 88 88. ... 88. .88 88. .88 88 88 `8b. */
|
||||
/* dP dP dP `88888P' dP dP dP `88888P' 88 88Y888P' `88888P8 dP dP `YP */
|
||||
/* 88 */
|
||||
/* dP */
|
||||
/* dP */
|
||||
|
||||
/* Made by @gilbN */
|
||||
/* Made by @gilbN */
|
||||
/* https://github.com/gilbN/theme.park */
|
||||
|
||||
/* GITEA SPACE GRAY THEME */
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/gitea-base.css);
|
||||
@import url(https://gilbn.github.io/theme.park/CSS/themes/gitea/chroma.css);
|
||||
:root {
|
||||
--main-bg-color: radial-gradient( ellipse at center, rgba(87,108,117,1) 0%, rgba(37,50,55,1) 100.2% ) center center/cover no-repeat fixed;
|
||||
--modal-bg-color: radial-gradient( ellipse at top, rgba(87,108,117,1) 0%, rgba(37,50,55,1) 100.2% ) center center/cover no-repeat fixed;
|
||||
--button-color: #607D8B;
|
||||
--button-color-hover: #81a6b7;
|
||||
--button-text: #eee;
|
||||
--accent-color: #81a6b7;
|
||||
--accent-color-hover: #81a6b7;
|
||||
--text: #eee;
|
||||
--text-hover: #fff;
|
||||
--text-muted: #bbb;
|
||||
--link-color: #81a6b7;
|
||||
/* https://docs.theme-park.dev/setup/#stylus-method
|
||||
|
||||
--heatmap-color-1: #002634;
|
||||
--heatmap-color-2: #1D4352;
|
||||
--heatmap-color-3: #3E6272;
|
||||
--heatmap-color-4: #5F8394;
|
||||
--heatmap-color-5: #81A6B7;
|
||||
|
||||
}
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/theme-options/THEME.css";
|
||||
aquamarine.css
|
||||
dark.css
|
||||
dracula.css
|
||||
hotline.css
|
||||
hotpink.css
|
||||
nord.css
|
||||
organizr.css
|
||||
overseerr.css
|
||||
plex.css
|
||||
space-gray.css
|
||||
|
||||
Nouveaux thèmes avec :
|
||||
@import "https://theme-park.dev/css/base/<APP_NAME>/<APP_NAME>-base.css";
|
||||
@import "https://theme-park.dev/css/community-theme-options/THEME.css";
|
||||
mind.css
|
||||
onedark.css
|
||||
power.css
|
||||
reality.css
|
||||
soul.css
|
||||
space.css
|
||||
time.css
|
||||
... voir ici la liste -> https://github.com/GilbN/theme.park/tree/master/css/community-theme-options
|
||||
*/
|
||||
|
||||
@import "https://theme-park.dev/css/base/gitea/gitea-base.css";
|
||||
@import "https://theme-park.dev/css/base/gitea/chroma.css";
|
||||
@import "https://theme-park.dev/css/theme-options/space-gray.css";
|
@ -1,10 +0,0 @@
|
||||
/* Source : https://github.com/gilbN/theme.park/wiki/Gitea
|
||||
Possibilités : https://gilbn.github.io/theme.park/CSS/themes/gitea/XXX.css
|
||||
aquamarine.css <--- Pas mal celui là.
|
||||
hotline.css
|
||||
plex.css <--- TOP
|
||||
dark.css <--- TOP
|
||||
space-gray.css <--- TOP, mon préféré !
|
||||
organizr-dark.css
|
||||
*/
|
||||
@import url("https://gilbn.github.io/theme.park/CSS/themes/gitea/space-gray.css");
|
@ -0,0 +1,16 @@
|
||||
<!-- Voir : https://docs.theme-park.dev/themes/gitea/#adding-the-themes-in-gitea -->
|
||||
<!-- Pensez à supprimer le fichier header.tmpl du serveur Gitea ! -->
|
||||
|
||||
{{ if .IsSigned }}
|
||||
{{ if and (ne .SignedUser.Theme "gitea") (ne .SignedUser.Theme "arc-green") }}
|
||||
{{ if (eq .SignedUser.Theme "dracula-test") }}
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/gitea-base.css">
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/chroma.css">
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/theme-options/dracula.css">
|
||||
{{else}}
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{.SignedUser.Theme}}.css">
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{ else if and (ne DefaultTheme "gitea") (ne DefaultTheme "arc-green") }}
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{DefaultTheme}}.css">
|
||||
{{end}}
|
@ -1,6 +1,23 @@
|
||||
<!--
|
||||
// Copie de la méthode d'installation qui ne laisse aucun choix à l'utilisateur
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/styles.css">
|
||||
-->
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/{{DefaultTheme}}.css">
|
||||
<link rel="stylesheet" href="{{AppSubUrl}}/css/{{.SignedUser.Theme}}.css">
|
||||
<!-- NE PLUS UTILISER CE FICHIER, voir tuto pour utiliser body_outer_pre.tmpl -->
|
||||
<!-- IL FAUT SUPPRIMER CE FICHIER du serveur Gitea... (il peut rester dans le dépôt) -->
|
||||
|
||||
<!-- Voir : https://docs.theme-park.dev/themes/gitea/#adding-the-themes-in-gitea -->
|
||||
|
||||
{{ if .IsSigned }}
|
||||
{{ if and (ne .SignedUser.Theme "gitea") (ne .SignedUser.Theme "arc-green") }}
|
||||
<!-- <link rel="stylesheet" href="/styles.css"> -->
|
||||
<!-- <link rel="stylesheet" href="/css/gitea.css"> -->
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/gitea-base.css">
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/chroma.css">
|
||||
|
||||
<!-- <link rel="stylesheet" href="https://theme-park.dev/css/theme-options/{{.SignedUser.Theme}}.css"> -->
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{.SignedUser.Theme}}.css">
|
||||
{{end}}
|
||||
|
||||
{{ else if and (ne DefaultTheme "gitea") (ne DefaultTheme "arc-green") }}
|
||||
<!-- <link rel="stylesheet" href="/styles.css"> -->
|
||||
<!-- <link rel="stylesheet" href="/css/gitea.css"> -->
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/gitea-base.css">
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/chroma.css">
|
||||
<link rel="stylesheet" href="https://theme-park.dev/css/base/gitea/{{DefaultTheme}}.css">
|
||||
{{end}}
|
@ -1,5 +1,5 @@
|
||||
## Discord Plex FR : https://discord.gg/ERpYMqS
|
||||
## Version 2021-04-19
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Fichier docker-compose.yml pour Gitea ##
|
||||
|
@ -1,3 +1,4 @@
|
||||
#!/bin/bash
|
||||
##==============================================================================================
|
||||
## ##
|
||||
## Script gitea-backup.sh ##
|
||||
@ -75,11 +76,17 @@ GITEA_DATA_DIR=data
|
||||
NOM_CONTENEUR=gitea
|
||||
|
||||
# ID de l'utilisateur du NAS qui a les droits sur le conteneur
|
||||
ID_USER_NAS=1000
|
||||
ID_USER_NAS=1060
|
||||
|
||||
# Nombre de jours d'archives-backup à garder (ça inclus le jour actuel)
|
||||
NB_JOURS_A_GARDER=10
|
||||
|
||||
##──── ────────────────────────────────────────────────────────────────────────────────────────
|
||||
##──── ────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
function pause() {
|
||||
read -p "$*"
|
||||
}
|
||||
|
||||
echo "$(date "+%R:%S - ") Script de sauvegarde des données du conteneur Gitea"
|
||||
|
||||
@ -191,22 +198,23 @@ if [ $mode_backup -eq 0 ] || [ $mode_backup -eq 2 ]; then
|
||||
echo "###############################################################################"
|
||||
cd $GITEA_DOCKER_DIR # Même si on est censé déjà être là...
|
||||
|
||||
retour_cmd=1111 # Valeur reset
|
||||
echo -e "\t-- Extinction du conteneur $(docker stop $NOM_CONTENEUR)\n"
|
||||
retour_cmd=$? # Le code d'exit de la fonction est stocké dans cette variable.
|
||||
if [ $retour_cmd -ne 0 ]; then
|
||||
if [ $retour_cmd -eq 1111 ]; then
|
||||
echo "### DEBUG : soucis avec la récupération du retour de commande #1470000 "
|
||||
exit 1470000
|
||||
fi
|
||||
echo "!! Le conteneur $NOM_CONTENEUR ne peut pas être arrêté..."
|
||||
echo "!! Fin du script. Erreur 777"
|
||||
echo
|
||||
exit 777
|
||||
fi echo "-- Création de l'archive du dossier $GITEA_DATA_DIR"
|
||||
#retour_cmd=1111 # Valeur reset
|
||||
echo "-- Extinction du conteneur $(docker stop $NOM_CONTENEUR) : OK."
|
||||
# retour_cmd=$? # Le code d'exit de la fonction est stocké dans cette variable.
|
||||
# if [ $retour_cmd -ne 0 ]; then
|
||||
# if [ $retour_cmd -eq 1111 ]; then
|
||||
# echo "### DEBUG : soucis avec la récupération du retour de commande #1470000 "
|
||||
# exit 1470000
|
||||
# fi
|
||||
# echo "!! Le conteneur $NOM_CONTENEUR ne peut pas être arrêté..."
|
||||
# echo "!! Fin du script. Erreur 777"
|
||||
# echo
|
||||
# exit 777
|
||||
# fi
|
||||
echo "-- Création de l'archive du dossier $GITEA_DATA_DIR"
|
||||
|
||||
# Compression tar.gz :
|
||||
tar -czf $GITEA_BACKUP_DIR/Gitea-Data-Backup-`date +%Y-%m-%d--%Hh%Mm%Ss`.tar.gz ./$GITEA_DATA_DIR
|
||||
#tar -czf $GITEA_BACKUP_DIR/Gitea-Data-Backup-`date +%Y-%m-%d--%Hh%Mm%Ss`.tar.gz ./$GITEA_DATA_DIR
|
||||
|
||||
# Compression 7z après obtention d'un .tar
|
||||
# On Linux/Unix, in order to backup directories you must use tar :
|
||||
@ -216,19 +224,42 @@ if [ $mode_backup -eq 0 ] || [ $mode_backup -eq 2 ]; then
|
||||
|
||||
echo "-- Archive de tout le dossier $GITEA_DATA_DIR créée."
|
||||
|
||||
retour_cmd=1111 # Valeur reset
|
||||
echo -e "\t-- Redémarrage du conteneur $(docker start $NOM_CONTENEUR)\n"
|
||||
retour_cmd=$? # Le code d'exit de la fonction est stocké dans cette variable.
|
||||
if [ $retour_cmd -ne 0 ]; then
|
||||
if [ $retour_cmd -eq 1111 ]; then
|
||||
echo "### DEBUG : soucis avec la récupération du retour de commande #1470000 "
|
||||
exit 1470000
|
||||
fi
|
||||
echo "!! Le conteneur $NOM_CONTENEUR ne peut pas être redémarré..."
|
||||
echo "!! Fin du script. Erreur 777"
|
||||
echo
|
||||
exit 777
|
||||
fi
|
||||
# retour_cmd=1111 # Valeur reset
|
||||
echo "-- Redémarrage du conteneur $(docker start $NOM_CONTENEUR) : OK."
|
||||
# retour_cmd=$? # Le code d'exit de la fonction est stocké dans cette variable.
|
||||
# if [ $retour_cmd -ne 0 ]; then
|
||||
# if [ $retour_cmd -eq 1111 ]; then
|
||||
# echo "### DEBUG : soucis avec la récupération du retour de commande #1470000 "
|
||||
# exit 1470000
|
||||
# fi
|
||||
# echo "!! Le conteneur $NOM_CONTENEUR ne peut pas être redémarré..."
|
||||
# echo "!! Fin du script. Erreur 777"
|
||||
# echo
|
||||
# exit 777
|
||||
# fi
|
||||
|
||||
# Section concernant la rotation des sauvegardes.
|
||||
echo
|
||||
echo "-- Rotation des sauvegardes anciennes selon le nombre de jours d'archives à garder (=$NB_JOURS_A_GARDER) incluant ce jour :"
|
||||
echo
|
||||
echo
|
||||
echo "-- -- Utilisation de la fonction find pour trouver les fichiers de plus de $nb_jours_a_garder jours (incluant ce jour)."
|
||||
echo "-- -- Les fichiers suivants seront supprimés :"
|
||||
find $GITEA_BACKUP_DIR/* -name 'Gitea-Data-Backup*' -mtime +"$((NB_JOURS_A_GARDER - 1))" -exec ls -lat --color {} \;
|
||||
|
||||
# Utile pour débugguer avant de supprimer réellement les fichiers.
|
||||
#pause '--DEBUG-- Appuyer sur la touche [Entrer] pour continuer...'
|
||||
|
||||
echo "-- -- Suppression de ces fichiers..."
|
||||
find $GITEA_BACKUP_DIR/* -name 'Gitea-Data-Backup*' -mtime +"$((NB_JOURS_A_GARDER - 1))" -exec rm -v {} \;
|
||||
|
||||
############################################################
|
||||
# Cette partie peut être commentée
|
||||
echo
|
||||
echo "-- -- Il reste donc les fichiers suivants :"
|
||||
ls -lat --color $GITEA_BACKUP_DIR/Gitea-Data-Backup*
|
||||
############################################################
|
||||
|
||||
|
||||
echo "###############################################################################"
|
||||
echo "-- Processus de sauvegarde par création d'archive terminé."
|
||||
|
23
docker-compose/gotify/docker-compose.yml
Normal file
@ -0,0 +1,23 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
version: "2.1"
|
||||
services:
|
||||
gotify:
|
||||
image: gotify/server
|
||||
container_name: gotify
|
||||
labels:
|
||||
- "autoheal=true" # Voir autoheal pour relance automatique de container instable
|
||||
- com.centurylinklabs.watchtower.enable=true # Le label ci-dessous permet à Watchtower de faire les mises à jour automatiquement
|
||||
ports:
|
||||
- 2222:80 # Choisir un port (de gauche) de connexion libre sur votre machine, ce sera le port de connexion
|
||||
environment:
|
||||
- GOTIFY_DEFAULTUSER_PASS=custom
|
||||
- GOTIFY_DATABASE_DIALECT=sqlite3
|
||||
- GOTIFY_DATABASE_CONNECTION=data/gotify.db
|
||||
- GOTIFY_DEFAULTUSER_NAME=admin
|
||||
- GOTIFY_DEFAULTUSER_PASS=admin
|
||||
- GOTIFY_PASSSTRENGTH=10
|
||||
- GOTIFY_UPLOADEDIMAGESDIR=data/images
|
||||
- GOTIFY_PLUGINSDIR=data/plugins
|
||||
volumes:
|
||||
- /volume1/docker/gotify/data:/app/data # chemin des fichiers de config de Gotify
|
29
docker-compose/grocy/docker-compose.yml
Normal file
@ -0,0 +1,29 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-09-18
|
||||
##
|
||||
## Pour une aide à l'installation, consulter le README
|
||||
##
|
||||
version: "2.1"
|
||||
|
||||
services:
|
||||
grocy:
|
||||
image: ghcr.io/linuxserver/grocy
|
||||
container_name: grocy
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- grocy-network
|
||||
environment:
|
||||
- PUID=1000
|
||||
- PGID=1000
|
||||
- TZ=Europe/Paris
|
||||
volumes:
|
||||
- /volume1/docker/grocy/config:/config
|
||||
ports:
|
||||
- 9283:80
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
grocy-network:
|
||||
external:
|
||||
name: grocy-network
|
97
docker-compose/grocy/readme.md
Normal file
@ -0,0 +1,97 @@
|
||||
Installation de Grocy
|
||||
============
|
||||
|
||||
Bienvenue sur mon nouveau tutoriel. Celui-ci, je l'espere va vous apprendre à installer Grocy.
|
||||
|
||||
**Grocy, c'est quoi ?**
|
||||
Grocy est une solution de gestion d'épicerie et de ménage auto-hébergée sur le Web pour votre maison.
|
||||
|
||||
## Table des matières
|
||||
- 1. [Prérequis](#1-prérequis)
|
||||
- 1.a [Création des dossiers](#1-a-création-des-dossiers)
|
||||
- 1.b [Modifications du .env](#1-b-modifications-du-env)
|
||||
- 1.c [Transfert des fichiers dans /edition-videos](#1-c-transfert-des-fichiers-dans-edition-videos)
|
||||
- 2. [Création des conteneurs](#2-création-des-conteneurs)
|
||||
- 2.a [Création du réseau](#2-a-création-du-réseau)
|
||||
- 2.b [Création des conteneurs](#2-b-création-des-conteneurs)
|
||||
- 3. [Les Bases](#3-les-bases)
|
||||
- 3.a [Commandes de bases ( Docker )](#3-a-commandes-de-bases-docker)
|
||||
- 3.b [Accès aux interfaces ( WebUI )](#3-b-accès-aux-interfaces-webui)
|
||||
- 4. Dépannage ( Ce construira au fur et a mesure des questions )
|
||||
|
||||
## 1. Prérequis
|
||||
|
||||
- Dans le paragraphe 1.a nous allons les créer avec une ligne de commande, et dans le paragraphe 1.b nous allons modifier le .env afin qu'il utilise bien ces dossiers ( en fonction de leurs localisation sur votre machine ).
|
||||
|
||||
### 1.a. Création des dossiers
|
||||
|
||||
- Avec `cd` aller dans le dossier de votre choix, par exemple "docker".
|
||||
Exemple : Si votre dossier "docker" ce trouve dans /volume1, alors la commande sera :
|
||||
`cd /volume1/docker`
|
||||
|
||||
- Maintenant que nous sommes dans le bon dossier, nous allons executer la commande suivante pour créer le dossier grocy qui contiendra la configuration de grocy :
|
||||
|
||||
`mkdir -p grocy/config`
|
||||
|
||||
### 1.b. Modifications des .env
|
||||
- Récupérer sur votre machine le fichier [docker-compose.yml](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/grocy/docker-compose.yml).
|
||||
|
||||
> Vous pouvez faire un clic droit - Enregistrer sous ... sur les liens ci-dessus pour télécharger les fichiers.
|
||||
|
||||
- Dans le fichier `docker-compose.yml` vous allez devoir modifier plusieurs chose :
|
||||
|
||||
**PUID et PGID** devront correspondre aux ID de votre utilisateurs, plus d'info ici : [Connaitre le PUID / PGID d'un utilisateur](https://www.forum-nas.fr/viewtopic.php?f=56&t=13213)
|
||||
|
||||
Dans la ligne `/volume1/docker/grocy/config:/config`, la partie `/volume1/docker/grocy/config` doit correspondre au chemin vers le dossier grocy/config créé a l'étape 1.a.
|
||||
Dans ce cas, c'est : `/volume1/docker/grocy/config`
|
||||
|
||||
### 1.c Transfert des fichiers dans /edition-videos
|
||||
- Une fois les modifications effectuées, il faut transfert le fichier ( docker-compose.yml ) dans le dossier `/grocy` précédemment créé ! Par exemple, avec FileZilla.
|
||||
|
||||
## 2. Création des conteneurs
|
||||
### 2.a Création du réseau
|
||||
- On créé le reseau `grocy-network` necesaire au fonctionnement du conteneur :
|
||||
|
||||
```
|
||||
docker network create grocy-network
|
||||
```
|
||||
|
||||
### 2.b Création des conteneurs
|
||||
Maintenant que votre "stack" est prete rendez-vous dans le dossier `grocy`, dans mon cas `/volume1/docker/grocy` :
|
||||
```
|
||||
cd /volume1/docker/grocy/config
|
||||
```
|
||||
|
||||
## 3. Les Bases
|
||||
Il est possible d'utilise n'importe qu'elle interface de gestion de conteneur*, ou SSH.
|
||||
|
||||
Voici quelques commandes de base :
|
||||
|
||||
**[Portainer](https://www.forum-nas.fr/viewtopic.php?f=56&t=14030) par exemple.*
|
||||
|
||||
### 3.a Commandes de bases ( Docker )
|
||||
- Arreter un conteneur : `docker stop <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **grocy** : `docker stop grocy`
|
||||
|
||||
- Redémarrer un conteneur : `docker restart <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **grocy** : `docker restart grocy`
|
||||
|
||||
- Démarrer un conteneur : `docker start <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **grocy** : `docker start grocy`
|
||||
|
||||
- Supprimer un conteneur : `docker rm <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **grocy** : `docker rm grocy`
|
||||
|
||||
- Créer le conteneur : `docker-compose up -d`
|
||||
Cette commande permet de créer ou re-créer le conteneur présent dans le fichier docker-compose.yml.
|
||||
> Note : Vous devez etre dans la dossier contenant le fichier docker-compose.yml pour que cette commande fonctionne.
|
||||
|
||||
### 3.b Accès aux interfaces ( WebUI )
|
||||
|
||||
- L'acces à chaque service se fait via une WebUI ( Interface Web ), sur un port quil lui est propre.
|
||||
- Pour Grocy, c'est le port `9283`. Donc l'adresse sera sous la forme : `http://IP_DE_LA_MACHINE:9283`
|
||||
Exemple : Si l'adresse IP de votre machine est `192.168.1.10`, alors l'adresse d'accès sera : `http://192.168.1.10:9283`
|
||||
|
||||
## 4. Aller plus loin
|
||||
|
||||
A VENIR ...
|
@ -0,0 +1,9 @@
|
||||
PUID=1000
|
||||
GUID=100
|
||||
TZ=Europe/Paris
|
||||
|
||||
DISPLAY_WIDTH=1280
|
||||
DISPLAY_HEIGHT=768
|
||||
|
||||
RACINE=/volume1/docker/edition-videos
|
||||
STORAGE=/storage
|
@ -0,0 +1,115 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2021-08-23
|
||||
##
|
||||
## Pour une aide à l'installation, consulter le README
|
||||
##
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
handbrake:
|
||||
image: jlesage/handbrake:latest
|
||||
container_name: edition-video_handbrake
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- edition-videos-network
|
||||
environment:
|
||||
- USER_ID=${PUID}
|
||||
- GROUP_ID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
|
||||
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
|
||||
ports:
|
||||
- "6800:5800"
|
||||
volumes:
|
||||
- "${RACINE}/handbrake/config:/config:rw"
|
||||
- "${RACINE}/handbrake/watch:/watch:rw"
|
||||
- "${RACINE}/handbrake/output:/output:rw"
|
||||
- "${STORAGE}:/storage:ro"
|
||||
restart: unless-stopped
|
||||
|
||||
mediainfo:
|
||||
image: jlesage/mediainfo:latest
|
||||
container_name: edition-video_mediainfo
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- edition-videos-network
|
||||
environment:
|
||||
- USER_ID=${PUID}
|
||||
- GROUP_ID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
|
||||
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
|
||||
ports:
|
||||
- 6801:5800
|
||||
volumes:
|
||||
- "${RACINE}/mediainfo/config:/config:rw"
|
||||
- "${STORAGE}:/storage:ro"
|
||||
restart: unless-stopped
|
||||
|
||||
avidemux:
|
||||
image: jlesage/avidemux:latest
|
||||
container_name: edition-video_avidemux
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- edition-videos-network
|
||||
environment:
|
||||
- USER_ID=${PUID}
|
||||
- GROUP_ID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
|
||||
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
|
||||
ports:
|
||||
- 6802:5800
|
||||
volumes:
|
||||
- "${RACINE}/avidemux/config:/config:rw"
|
||||
- "${STORAGE}:/storage:rw"
|
||||
restart: unless-stopped
|
||||
|
||||
makemkv:
|
||||
image: jlesage/makemkv:latest
|
||||
container_name: edition-video_makemkv
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- edition-videos-network
|
||||
environment:
|
||||
- USER_ID=${PUID}
|
||||
- GROUP_ID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
|
||||
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
|
||||
ports:
|
||||
- 6803:5800
|
||||
volumes:
|
||||
- "${RACINE}/makemkv/config:/config:rw"
|
||||
- "${RACINE}/makemkv/output:/output:rw"
|
||||
- "${STORAGE}:/storage:ro"
|
||||
restart: unless-stopped
|
||||
|
||||
mkvtoolnix:
|
||||
image: jlesage/mkvtoolnix:latest
|
||||
container_name: edition-video_mkvtoolnix
|
||||
# labels:
|
||||
# - com.centurylinklabs.watchtower.enable=true
|
||||
networks:
|
||||
- edition-videos-network
|
||||
environment:
|
||||
- USER_ID=${PUID}
|
||||
- GROUP_ID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- DISPLAY_WIDTH=${DISPLAY_WIDTH}
|
||||
- DISPLAY_HEIGHT=${DISPLAY_HEIGHT}
|
||||
ports:
|
||||
- 6804:5800
|
||||
volumes:
|
||||
- "${RACINE}/makemkv/config:/config:rw"
|
||||
- "${STORAGE}:/storage:ro"
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
edition-videos-network:
|
||||
external:
|
||||
name: edition-videos-network
|
@ -0,0 +1,135 @@
|
||||
Installation de la stack "Édition-Vidéos"
|
||||
============
|
||||
|
||||
Bienvenue sur mon nouveau tutoriel. Celui-ci, je l'espere va vous apprendre à installer Handbrake, Mediainfo, Avidemux, MakeMKV et MKVToolNix simplement via docker.
|
||||
|
||||
Cette stack docker-compose contient les logiciels suivants :
|
||||
| Nom du service | Site Officiel | Dépot utilisé* |
|
||||
| ------ | ------ | ------ |
|
||||
| Handbrake | [Handbrake.fr](https://handbrake.fr/) | [jlesage](https://github.com/jlesage/docker-handbrake) |
|
||||
| Mediainfo | [MediaArea](https://mediaarea.net/fr/MediaInfo) | [jlesage](https://github.com/jlesage/docker-mediainfo) |
|
||||
| Avidemux | [Fixounet](http://fixounet.free.fr/avidemux/) | [jlesage](https://github.com/jlesage/docker-avidemux) |
|
||||
| MakeMKV | [GuinpinSoft](http://makemkv.com/) | [jlesage](https://github.com/jlesage/docker-makemkv) |
|
||||
| MKVToolNix | [Moritz Bunkus](https://mkvtoolnix.download/) | [jlesage](https://github.com/jlesage/docker-mkvtoolnix) |
|
||||
|
||||
## Table des matières
|
||||
- 1. [Prérequis](#1-prérequis)
|
||||
- 1.a [Création des dossiers](#1-a-création-des-dossiers)
|
||||
- 1.b [Modifications du .env](#1-b-modifications-du-env)
|
||||
- 1.c [Transfert des fichiers dans /edition-videos](#1-c-transfert-des-fichiers-dans-edition-videos)
|
||||
- 2. [Création des conteneurs](#2-création-des-conteneurs)
|
||||
- 2.a [Création du réseau](#2-a-création-du-réseau)
|
||||
- 2.b [Création des conteneurs](#2-b-création-des-conteneurs)
|
||||
- 3. [Les Bases](#3-les-bases)
|
||||
- 3.a [Commandes de bases ( Docker )](#3-a-commandes-de-bases-docker)
|
||||
- 3.b [Accès aux interfaces ( WebUI )](#3-b-accès-aux-interfaces-webui)
|
||||
- 4. Dépannage ( Ce construira au fur et a mesure des questions )
|
||||
|
||||
## 1. Prérequis
|
||||
|
||||
- Cette stack est concu pour fonctionner dans un dossier `edition-videos`, avec l'architecture suivante :
|
||||
```
|
||||
edition-videos ---- handbrake ------- config
|
||||
| |_ watch
|
||||
| |_ output
|
||||
|
|
||||
|-- mediainfo ------ config
|
||||
|
|
||||
|-- avidemux ------- config
|
||||
|
|
||||
|-- makemkv -------- config
|
||||
| |_ output
|
||||
|
|
||||
|-- mkvtoolnix ----- config
|
||||
```
|
||||
|
||||
- Dans le paragraphe 1.a nous allons les créer avec une ligne de commande, et dans le paragraphe 1.b nous allons modifier le .env afin qu'il utilise bien ces dossiers ( en fonction de leurs localisation sur votre machine ).
|
||||
|
||||
### 1.a. Création des dossiers
|
||||
|
||||
- Avec `cd` aller dans le dossier de votre choix, par exemple "docker".
|
||||
Exemple : Si votre dossier "docker" ce trouve dans /volume1, alors la commande sera :
|
||||
`cd /volume1/docker`
|
||||
|
||||
- Maintenant que nous sommes dans le bon dossier, nous allons executer la commande suivante pour créer d'un coup, toute l'architecture nécessaire :
|
||||
|
||||
`mkdir -p edition-videos/handbrake/{config,watch,output} edition-videos/mediainfo/config edition-videos/avidemux/config edition-videos/makemkv/{config,output} edition-videos/mkvtoolnix/config`
|
||||
|
||||
### 1.b. Modifications des .env
|
||||
- Récupérer sur votre machine les fichiers [.env](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/handbrake-mediainfo-avidemux-makemkv-mkvtoolnix/.env) et [docker-compose.yml](https://gitea.zoz-serv.org/Zoz/plex_fr_discord_repo/src/branch/master/docker-compose/handbrake-mediainfo-avidemux-makemkv-mkvtoolnix/docker-compose.yml).
|
||||
|
||||
> Vous pouvez faire un clic droit - Enregistrer sous ... sur les liens ci-dessus pour télécharger les fichiers.
|
||||
|
||||
- Dans le fichier `.env` vous allez devoir modifier plusieurs chose :
|
||||
|
||||
**PUID et PGID** devront correspondre aux ID de votre utilisateurs, plus d'info ici : [Connaitre le PUID / PGID d'un utilisateur](https://www.forum-nas.fr/viewtopic.php?f=56&t=13213)
|
||||
|
||||
**RACINE** correspond au chemin vers le dossier edition-videos créé a l'étape 1.a.
|
||||
Dans ce cas, c'est : `/volume1/docker/edition-videos`
|
||||
|
||||
**RACINE** correspond au chemin vers votre dossiers de médias.
|
||||
Dans ce cas, c'est : `/storage`
|
||||
|
||||
|
||||
### 1.c Transfert des fichiers dans /edition-videos
|
||||
- Une fois les modifications effectuées, il faut transfert tous les fichiers ( .env et docker-compose.yml ) dans le dossier `/edition-videos` précédemment créé ! Par exemple, avec FileZilla.
|
||||
|
||||
## 2. Création des conteneurs
|
||||
### 2.a Création du réseau
|
||||
- On créé le reseau `edition-videos-network` necesaire au fonctionnement du conteneurs VPN :
|
||||
|
||||
```
|
||||
docker network create edition-videos-network
|
||||
```
|
||||
|
||||
### 2.b Création des conteneurs
|
||||
Maintenant que votre "stack" est prete rendez-vous dans le dossier `edition-videos`, dans mon cas `/volume1/docker/edition-videos` :
|
||||
```
|
||||
cd /volume1/docker/edition-videos
|
||||
```
|
||||
|
||||
## 3. Les Bases
|
||||
Il est possible d'utilise n'importe qu'elle interface de gestion de conteneur*, ou SSH.
|
||||
|
||||
Voici quelques commandes de base :
|
||||
|
||||
**[Portainer](https://www.forum-nas.fr/viewtopic.php?f=56&t=14030) par exemple.*
|
||||
|
||||
### 3.a Commandes de bases ( Docker )
|
||||
- Arreter un conteneur : `docker stop <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **edition-video_handbrake** : `docker stop edition-video_handbrake`
|
||||
|
||||
- Redémarrer un conteneur : `docker restart <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **edition-video_handbrake** : `docker restart edition-video_handbrake`
|
||||
|
||||
- Démarrer un conteneur : `docker start <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **edition-video_handbrake** : `docker start edition-video_handbrake`
|
||||
|
||||
- Supprimer un conteneur : `docker rm <nom_du_conteneur>`
|
||||
Exemple pour le conteneur **edition-video_handbrake** : `docker rm edition-video_handbrake`
|
||||
|
||||
- Créer / Mettre à jour la "stack" : `docker-compose up -d`
|
||||
Cette commande permet de créer la stack présent dans le fichier docker-compose.yml, les conteneurs non-existant seront créés, les modifiés seront mis à jour.
|
||||
> Note : Vous devez etre dans la dossier contenant le fichier docker-compose.yml pour que cette commande fonctionne.
|
||||
|
||||
### 3.b Accès aux interfaces ( WebUI )
|
||||
|
||||
- L'acces à chaque service se fait via une WebUI ( Interface Web ), sur un port quil lui est propre.
|
||||
- Pour Handbrake, c'est le port `6800`. Donc l'adresse sera sous la forme : `http://IP_DE_LA_MACHINE:6800`
|
||||
Exemple : Si l'adresse IP de votre machine est `192.168.1.10`, alors l'adresse d'accès sera : `http://192.168.1.10:6800`
|
||||
|
||||
- Ci-dessus la liste des ports des interfaces de chaque service :
|
||||
| Service | Port |
|
||||
| ------ | ------ |
|
||||
| Handbrake | 6800 |
|
||||
| Mediainfo | 6801 |
|
||||
| Avidemux | 6802 |
|
||||
| MakeMKV | 6803 |
|
||||
| MKVToolNix | 6804 |
|
||||
|
||||
## 6. Aller plus loin
|
||||
- Retrouvez ici des astuces pour aller "un peu plus loin" dans la configurations de vos conteneurs, avec par exemple, la méthode pour rajouter des montages ( dossier de votre serveur dans le conteneur ), ou régler la mise à jour automatique de vos conteneurs.
|
||||
|
||||
/!\ Depuis l'interface SSH, les commandes ci-dessous sont à executer en étant à la racine de votre dossier `edition-videos`.
|
||||
|
||||
A VENIR ...
|
21
docker-compose/hasty-paste/docker-compose.yml
Normal file
@ -0,0 +1,21 @@
|
||||
## Discord Plex FR : https://discord.gg/3gtABCH
|
||||
## Version 2022-09-25
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
paste-bin:
|
||||
container_name: paste-bin
|
||||
image: ghcr.io/enchant97/hasty-paste:1
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- "NEW_AT_INDEX=True"
|
||||
- "UI_DEFAULT__USE_LONG_ID=True"
|
||||
- "UI_DEFAULT__EXPIRE_TIME__ENABLE=True"
|
||||
- "UI_DEFAULT__EXPIRE_TIME__MINUTES=0"
|
||||
- "UI_DEFAULT__EXPIRE_TIME__HOURS=0"
|
||||
- "UI_DEFAULT__EXPIRE_TIME__DAYS=31"
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
ports:
|
||||
- 8000:8000
|
||||
|