1
0

Compare commits

...

3 Commits

Author SHA1 Message Date
unfr
e87da06111 ajout effacement si dispo 2025-08-10 11:54:40 +02:00
unfr
c6c92bf1ef coreection chargement js server.js 2025-08-10 11:49:16 +02:00
unfr
abc64501e2 ajout stats nyuu live 2025-08-10 11:31:51 +02:00
3 changed files with 46 additions and 14 deletions

View File

@ -58,12 +58,18 @@ while true; do
{ {
echo -e "${VERT}UPLOAD SUR USENET${NORMAL}" echo -e "${VERT}UPLOAD SUR USENET${NORMAL}"
files=( ${FILESANSEXT}.* )
checkusenet checkusenet
nyuu -h ${NG_HOST} -P ${NG_PORT} -S -u ${NG_USER} -p ${NG_PASS} -n ${NG_NBR_CONN} \ script -q -c \
-g alt.binaries.boneless -o "${DOSSIER_NZB_ATTENTE}${FILESANSEXT}.nzb" \ "nyuu -h ${NG_HOST} -P ${NG_PORT} -S -u ${NG_USER} -p ${NG_PASS} -n ${NG_NBR_CONN} \
--nzb-title "${FILESANSEXT}" -f "{rand(14)} {rand(14)}@{rand(5)}.{rand(3)}" \ -g alt.binaries.boneless -o '${DOSSIER_NZB_ATTENTE}${FILESANSEXT}.nzb' \
--message-id "{rand(32)}@{rand(8)}.{rand(3)}" \ --nzb-title '${FILESANSEXT}' \
--subject "{rand(32)}" --nzb-subject "{filename}" --obfuscate-articles ${FILESANSEXT}.* -f '{rand(14)} {rand(14)}@{rand(5)}.{rand(3)}' \
--message-id '{rand(32)}@{rand(8)}.{rand(3)}' \
--subject '{rand(32)}' --nzb-subject '{filename}' \
--obfuscate-articles ${files[*]} \
--progress=stderr" \
/dev/null
if [ -e "${DOSSIER_NFO}${FILESANSEXT}.json" ] || [ -e "${DOSSIER_NFO}${FILESANSEXT}.txt" ]; then if [ -e "${DOSSIER_NFO}${FILESANSEXT}.json" ] || [ -e "${DOSSIER_NFO}${FILESANSEXT}.txt" ]; then
echo -e "${JAUNE}VERIF DU NZB${NORMAL}" echo -e "${JAUNE}VERIF DU NZB${NORMAL}"
@ -110,7 +116,7 @@ while true; do
else else
echo -e "${ROUGE}ENVOI SUR LE SITE IMPOSSIBLE NFO MANQUANT${NORMAL}" echo -e "${ROUGE}ENVOI SUR LE SITE IMPOSSIBLE NFO MANQUANT${NORMAL}"
fi fi
} > >(tee -a "$LOG") 2>&1 } 2>&1 | tee -a "$LOG"
fi fi
else else
echo -e "${ROUGE}PROBLEME DE PROPAGATION POST EN PAUSE${NORMAL}" echo -e "${ROUGE}PROBLEME DE PROPAGATION POST EN PAUSE${NORMAL}"

View File

@ -9,6 +9,7 @@ const os = require('os');
const config = require('./config'); const config = require('./config');
const db = require('./db'); const db = require('./db');
db.testConnection(); // vérification au démarrage db.testConnection(); // vérification au démarrage
const app = express(); const app = express();
@ -27,8 +28,14 @@ app.use(express.static('public'));
const autopostRouter = express.Router(); const autopostRouter = express.Router();
autopostRouter.use('/js', express.static(path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'))); app.use('/js', express.static(
autopostRouter.use('/jquery', express.static(path.join(__dirname, '../node_modules/jquery/dist'))); path.join(__dirname, '../node_modules/@tailwindcss/browser/dist'),
{ setHeaders: (res) => res.type('application/javascript') } // optionnel
));
app.use('/jquery', express.static(
path.join(__dirname, '../node_modules/jquery/dist'),
{ setHeaders: (res) => res.type('application/javascript') } // optionnel
));
// --------------------------- Auth non protégée ----------------------------- // --------------------------- Auth non protégée -----------------------------
autopostRouter.get('/login', (req, res) => { autopostRouter.get('/login', (req, res) => {
@ -39,7 +46,7 @@ autopostRouter.get('/login', (req, res) => {
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Login</title> <title>Login</title>
<!-- Inclusion de Tailwind CSS via le CDN --> <!-- Inclusion de Tailwind CSS via le CDN -->
<script src="js/index.global.js"></script> <script src="/js/index.global.js"></script>
</head> </head>
<body class="bg-slate-900 flex items-center justify-center min-h-screen"> <body class="bg-slate-900 flex items-center justify-center min-h-screen">
<div class="bg-slate-700 p-8 rounded-lg shadow-md w-80"> <div class="bg-slate-700 p-8 rounded-lg shadow-md w-80">
@ -69,6 +76,7 @@ autopostRouter.post('/login', (req, res) => {
res.send('Identifiants invalides. <a href="/autopost/login">Réessayer</a>'); res.send('Identifiants invalides. <a href="/autopost/login">Réessayer</a>');
} }
}); });
autopostRouter.get('/logout', (req, res) => { autopostRouter.get('/logout', (req, res) => {
req.session.destroy(); req.session.destroy();
res.redirect('/autopost/login'); res.redirect('/autopost/login');
@ -106,8 +114,8 @@ autopostRouter.get('/', async (req, res) => {
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>Suivi Autopost</title> <title>Suivi Autopost</title>
<script src="js/index.global.js"></script> <script src="/js/index.global.js"></script>
<script src="jquery/jquery.min.js"></script> <script src="/jquery/jquery.min.js"></script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap" rel="stylesheet">
</head> </head>
<body class="bg-slate-900 text-white font-sans p-4"> <body class="bg-slate-900 text-white font-sans p-4">
@ -171,6 +179,10 @@ autopostRouter.get('/', async (req, res) => {
statusText = 'DEJA DISPONIBLE'; statusText = 'DEJA DISPONIBLE';
statusClass = 'bg-pink-300 text-black font-bold'; statusClass = 'bg-pink-300 text-black font-bold';
break; break;
case 4:
statusText = 'EN COURS';
statusClass = 'bg-yellow-300 text-black font-bold';
break;
default: default:
statusText = 'INCONNU'; statusText = 'INCONNU';
} }
@ -269,6 +281,10 @@ autopostRouter.get('/', async (req, res) => {
statusText = 'DEJA DISPONIBLE'; statusText = 'DEJA DISPONIBLE';
statusClass = 'bg-pink-300 text-black font-bold'; statusClass = 'bg-pink-300 text-black font-bold';
break; break;
case 4:
statusText = 'EN COURS';
statusClass = 'bg-yellow-300 text-black font-bold';
break;
default: default:
statusText = 'INCONNU'; statusText = 'INCONNU';
} }
@ -420,6 +436,10 @@ autopostRouter.get('/', async (req, res) => {
statusText = 'DEJA DISPONIBLE'; statusText = 'DEJA DISPONIBLE';
statusClass = 'bg-pink-300 text-black font-bold'; statusClass = 'bg-pink-300 text-black font-bold';
break; break;
case 4:
statusText = 'EN COURS';
statusClass = 'bg-yellow-300 text-black font-bold';
break;
default: default:
statusText = 'INCONNU'; statusText = 'INCONNU';
} }

View File

@ -86,7 +86,10 @@ do_add() {
if [ "$code" = "2" ]; then if [ "$code" = "2" ]; then
echo -e "$ROUGE""$explain""$NORMAL" echo -e "$ROUGE""$explain""$NORMAL"
db_query "INSERT INTO \`release\` (nom, status) VALUES ('${release_name}', 3);" db_query "INSERT INTO \`$MYSQL_TABLE\` (nom, status) VALUES ('${release_name}', 3);"
if [ -e "${DOSSIER_GLOBAL}${release_name}" ]; then
rm "${DOSSIER_GLOBAL}""${release_name}"
fi
exit 1 exit 1
else else
echo -e "$VERT""DEPLACEMENT DE LA RELEASE ${release_name} DANS LE REPERTOIRE DE TRAVAIL""$NORMAL" echo -e "$VERT""DEPLACEMENT DE LA RELEASE ${release_name} DANS LE REPERTOIRE DE TRAVAIL""$NORMAL"
@ -97,7 +100,7 @@ do_add() {
echo -e "$ROUGE""CREATION MEDIAINFO""$NORMAL" echo -e "$ROUGE""CREATION MEDIAINFO""$NORMAL"
mediainfo --output=JSON --full "${DOSSIER_GLOBAL}${release_name}" > "${DOSSIER_NFO}${release_without_ext}.json" mediainfo --output=JSON --full "${DOSSIER_GLOBAL}${release_name}" > "${DOSSIER_NFO}${release_without_ext}.json"
echo -e "$CYAN""AJOUT DE LA RELEASE ${release_name} DANS LA DATABASE""$NORMAL" echo -e "$CYAN""AJOUT DE LA RELEASE ${release_name} DANS LA DATABASE""$NORMAL"
db_query "INSERT INTO \`release\` (nom, status) VALUES ('${release_name}', 0);" db_query "INSERT INTO \`$MYSQL_TABLE\` (nom, status) VALUES ('${release_name}', 0);"
elif [[ "${release_name}" =~ \.(iso)$ ]]; then elif [[ "${release_name}" =~ \.(iso)$ ]]; then
if [ ! -e "${DOSSIER_GLOBAL}${release_name}" ]; then if [ ! -e "${DOSSIER_GLOBAL}${release_name}" ]; then
cp -rl "${release_path}" "${DOSSIER_GLOBAL}" cp -rl "${release_path}" "${DOSSIER_GLOBAL}"
@ -107,7 +110,7 @@ do_add() {
BDInfo -p "${DOSSIER_GLOBAL}${release_name}" -o "${DOSSIER_NFO}${release_without_ext}.txt" BDInfo -p "${DOSSIER_GLOBAL}${release_name}" -o "${DOSSIER_NFO}${release_without_ext}.txt"
BDInfoDataSubstractor "${DOSSIER_NFO}${release_without_ext}.txt" BDInfoDataSubstractor "${DOSSIER_NFO}${release_without_ext}.txt"
echo -e "$CYAN""AJOUT DE LA RELEASE ${release_name} DANS LA DATABASE""$NORMAL" echo -e "$CYAN""AJOUT DE LA RELEASE ${release_name} DANS LA DATABASE""$NORMAL"
db_query "INSERT INTO \`release\` (nom, status) VALUES ('${release_name}', 0);" db_query "INSERT INTO \`$MYSQL_TABLE\` (nom, status) VALUES ('${release_name}', 0);"
else else
echo "il ne s'agit pas d'un fichier mkv ou mp4" echo "il ne s'agit pas d'un fichier mkv ou mp4"
fi fi
@ -126,6 +129,9 @@ do_check() {
echo -e "${release_name}" "$ROUGE""$explain""$NORMAL" echo -e "${release_name}" "$ROUGE""$explain""$NORMAL"
else else
echo -e "${release_name}" "$BLEU""$explain""$NORMAL" echo -e "${release_name}" "$BLEU""$explain""$NORMAL"
if [ -e "${DOSSIER_GLOBAL}${release_name}" ]; then
rm "${DOSSIER_GLOBAL}""${release_name}"
fi
fi fi
} }