Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0f86fde08e |
74
README.md
74
README.md
@@ -1,70 +1,8 @@
|
|||||||
# Trova link giusto di streamingcommunity
|
# Streaming Community Redirector
|
||||||
|
|
||||||
## INDICE README
|
Un plugin per nginx scritto in njs per dare un HTTP 301 a un dominio X.
|
||||||
- [Motivazioni & FAQ](#motivazioni--faq)
|
|
||||||
- [Perchè esiste questo git?](#perchè-esiste-questo-git)
|
|
||||||
- [Cosa fanno gli script?](#cosa-fanno-gli-script)
|
|
||||||
- [Cosa fare se "attuale.txt" risulta vuoto?](#cosa-fare-se-attualetxt-risulta-vuoto)
|
|
||||||
- [Mostra il link giusto](#mostra-il-link-giusto)
|
|
||||||
- [Crea una pagina html accattivante con il link giusto](#crea-una-pagina-html-accattivante-con-il-link-giusto)
|
|
||||||
- [Crea un feed rss con il link giusto](#crea-un-feed-rss-con-il-link-giusto)
|
|
||||||
- [Selfhostare il servizio](#selfhostare-il-servizio)
|
|
||||||
|
|
||||||
## Motivazioni & FAQ
|
1. Install njs
|
||||||
### Perchè esiste questo git?
|
2. Copia main.js dove vuoi
|
||||||
Anzitutto fanculo merdflix. <br>
|
3. Aggiungi main.js dentro il tuo nginx
|
||||||
Esistono molti cloni online di streamingcommunity, e tutti offrono un servizio simile all'originale, ma contente malware di ogni tipo e solitamente più scadente.<br>
|
4. Metti crontab per generare automaticamente il file con l'ultimo indirizzo di steraming community
|
||||||
Stufe di fare ricerche eterne per trovare il link giusto, sperando di non incappare in qualche ottimo clone... ecco pronto il git che risolve il problema permettendoci di gustarci i nostri film e serie preferite, con tutta la tranquillità necessaria e qualche funzionalità aggiuntiva.<br>
|
|
||||||
|
|
||||||
### Cosa fanno gli script?
|
|
||||||
Il cuore degli script di questo git si occupa di seguire il vecchio link noto di streamingcommunity, quindi controlla se c'è un redirect su un nuovo link, e se lo trova aggiorna <code>attuale.txt</code> contenente il link corretto.<br>
|
|
||||||
- [show_link.sh](./show_link.sh) mostra il link giusto
|
|
||||||
- [make_index.sh](./make_index.sh) crea una pagina html accattivante con il link giusto. Clicca [qui](http://streamingcommunity.accol.li) per una demo
|
|
||||||
- [rss_generator.sh](./rss_generator.sh) crea un feed rss con il link giusto. Clicca [qui](http://streamingcommunity.accol.li/rss.xml) per una demo
|
|
||||||
|
|
||||||
### Cosa fare se "attuale.txt" risulta vuoto?
|
|
||||||
Molto poco raramente streamingcommunity subisce attacchi informatici, lo script è pronto a non rompersi: arifanculo merdflix. <br>
|
|
||||||
Se per qualche strano caso dovessero avvenire redirect assurdi, il massimo che può succedere è che si cancelli il contenuto di <code>attuale.txt</code>. In questo caso tornate su questa repo. Probabilmente sarà stato trovato un bug e gli script sono già stati aggiornati o l'aggiornamento è in corso d'opera. Quindi recuperarate <code>attuale.txt</code>, ed aggiornate gli script.
|
|
||||||
|
|
||||||
## Mostra il link giusto
|
|
||||||
Per conoscere semplicemente il link aggiornato di streamingcommunity lancia lo script [show_link.sh](./show_link.sh)
|
|
||||||
```bash
|
|
||||||
# (richiede "attuale.txt")
|
|
||||||
# Lancia lo script:
|
|
||||||
./show_link.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Crea una pagina html accattivante con il link giusto
|
|
||||||
|
|
||||||
Se vuoi creare una pagina che mostra il link aggiornato, lancia lo script [make_index.sh](./make_index.sh). <br>
|
|
||||||
Clicca [qui](http://streamingcommunity.accol.li) per una demo<br>
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# (richiede "attuale.txt")
|
|
||||||
# Lancialo script manualmente
|
|
||||||
./make_index.sh
|
|
||||||
|
|
||||||
# oppure mettilo in cron
|
|
||||||
0 0 * * * /path/to/make_index.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Crea un feed rss con il link giusto
|
|
||||||
Se vuoi creare un feed rss in xml con il link aggiornato, lancia lo script [rss_generator.sh](./rss_generator.sh)<br>
|
|
||||||
Clicca [qui](http://streamingcommunity.accol.li/rss.xml) per una demo<br>
|
|
||||||
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# (richiede "attuale.txt")
|
|
||||||
# Lancialo manualmente
|
|
||||||
./rss_generator.sh
|
|
||||||
|
|
||||||
# oppure mettilo in cron nella riga dopo "make_index.sh"
|
|
||||||
0 0 * * * /path/to/rss_generator.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## Selfhostare il servizio
|
|
||||||
1. Edita lo script [make_index.sh](./make_index.sh):
|
|
||||||
- setta la variabile <code>PWD_SC</code> in testa
|
|
||||||
- decommenta i comandi per i permessi in fondo.
|
|
||||||
- (se usi anche [rss_generator.sh](./rss_generator.sh), editalo nello stesso modo )
|
|
||||||
2. Infine metti la tua cartella (quella che hai messo anche in <code>PWD_SC</code>) dietro a un reverse proxy.<br>
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
streamingunity.cool
|
|
||||||
8
main.js
Normal file
8
main.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
var fs = require('fs');
|
||||||
|
|
||||||
|
function redirect(r) {
|
||||||
|
|
||||||
|
r.return(301, fs.readFileSync('/etc/nginx/streaming_community_last_url.txt', {string: 'utf-8'}).toString().trim() );
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {redirect};
|
||||||
130
make_index.sh
130
make_index.sh
@@ -1,130 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
|
|
||||||
# Es: PWD_SC="/var/www/html/streamingcommunity"
|
|
||||||
# O LASCIARE COSIì PER TESTARE IN LOCALE
|
|
||||||
PWD_SC="$PWD"
|
|
||||||
|
|
||||||
# Segue link per vedere se è stato aggiornato...
|
|
||||||
attuale="$(cat "$PWD_SC/attuale.txt")"
|
|
||||||
nuovo=$(curl --no-progress-meter -L $attuale | grep -oP 'streaming\w+(\.\w+)?' | grep -v "streamingcommunityoriginale" | head -n1)
|
|
||||||
|
|
||||||
#vecchio curl
|
|
||||||
#nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streamingcommunity\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streamingcommunity\.\w+(\.\w+)?' | head -n1)
|
|
||||||
|
|
||||||
# Se il nuovo link è diverso dal nuovo, allora...
|
|
||||||
if [ "$attuale" != "$nuovo" ]; then
|
|
||||||
# se è vuoto lascia il vecchio
|
|
||||||
if [ -z "$nuovo" ]; then
|
|
||||||
echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK"
|
|
||||||
else
|
|
||||||
# Se non è vuoto lo aggiorna con il nuovo link il file attuale.txt
|
|
||||||
attuale="$nuovo"
|
|
||||||
echo "$attuale" > $PWD_SC/attuale.txt
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# se il link giusto è ancora il vecchio lascia il vecchio
|
|
||||||
echo "Il link giusto è ancora il vecchio"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# Formatta il link e lo stampa
|
|
||||||
formatted="https://$(cat "$PWD_SC/attuale.txt")"
|
|
||||||
echo "$formatted"
|
|
||||||
|
|
||||||
# Crea pagina "index.html"
|
|
||||||
cat <<- _EOF > $PWD_SC/index.html
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>StreamingCommunity Link Giusto</title>
|
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin: 0;
|
|
||||||
padding: 4wh;
|
|
||||||
border: 10px solid #ccc;
|
|
||||||
background-color: #121212;
|
|
||||||
color: #e4d183;
|
|
||||||
}
|
|
||||||
|
|
||||||
div {
|
|
||||||
width: 200wj;
|
|
||||||
height: 200wj;
|
|
||||||
background-color: #1e1e1e;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
max-width: 90%;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
width: 300wj;
|
|
||||||
height: 200wj;
|
|
||||||
color: #bb86fc
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 36px;
|
|
||||||
/* Default size */
|
|
||||||
}
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
h1 {
|
|
||||||
font-size: 17px;
|
|
||||||
/* Size mobile phones */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media (max-width: 480px) {
|
|
||||||
h3 {
|
|
||||||
font-size: 15px;
|
|
||||||
/* Size mobile phones */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<center>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="link">
|
|
||||||
<h3> Link aggiornato per Streaming Community: </h3>
|
|
||||||
<h1> <a href=$formatted>$formatted </a> </h1>
|
|
||||||
<h3> (cambia circa una volta al mese) </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<a href=$formatted target="_blank">
|
|
||||||
<img style="display:block; margin-left: auto; margin-right: auto" src="./splash.gif">
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<div class="link">
|
|
||||||
<h3> Link aggiornato per Streaming Community: </h3>
|
|
||||||
<h1> <a href=$formatted> $formatted </a> </h1>
|
|
||||||
<h3> (cambia circa una volta al mese) </h3>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
</center>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
_EOF
|
|
||||||
|
|
||||||
# Setta i permessi giusti (decommentare se hostato)
|
|
||||||
#chown -R root:root $PWD_SC; chmod 740 $PWD_SC/*; echo "reset a root dei permessi della cartella $PWD_SC e tutti i suoi file"
|
|
||||||
#chmod +x $PWD_SC ; echo "permetto di leggere dentro a $PWD_SC"
|
|
||||||
#chown -R www-data:www-data $PWD_SC/*.html; chmod -R 744 $PWD_SC/*.html; echo "do i permessi agli html dentro a $PWD_SC"
|
|
||||||
#chown www-data:www-data $PWD_SC/splash.gif; chmod 744 $PWD_SC/splash.gif; echo "do i permesi alla gif splash"
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# SETTARE QUESTA VARIABILE CON IL PERCORSO GIUSTO:
|
|
||||||
# Es: PWD_SC="/var/www/html/streamingcommunity"
|
|
||||||
# O LASCIARE COSIì PER TESTARE IN LOCALE
|
|
||||||
PWD_SC="$PWD"
|
|
||||||
|
|
||||||
# Formatta il link e lo stampa
|
|
||||||
formatted="https://$(cat "$PWD_SC/attuale.txt")"
|
|
||||||
echo "$formatted"
|
|
||||||
|
|
||||||
data=$(date +%Y-%m-%d)
|
|
||||||
|
|
||||||
# Crea pagina "rss.xml"
|
|
||||||
cat <<- _EOF > $PWD_SC/rss.xml
|
|
||||||
|
|
||||||
<rss version="2.0">
|
|
||||||
<channel>
|
|
||||||
<title>Fanculo Netflix</title>
|
|
||||||
<link>$formatted</link>
|
|
||||||
<description>Link sempre aggiornato</description>
|
|
||||||
<lastBuildDate>$data</lastBuildDate>
|
|
||||||
<language>it-IT</language>
|
|
||||||
<item>
|
|
||||||
<title>$formatted</title>
|
|
||||||
<link>$formatted</link>
|
|
||||||
<pubDate>$date</pubDate>
|
|
||||||
<guid isPermaLink="false">$formatted</guid>
|
|
||||||
</item>
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
|
|
||||||
_EOF
|
|
||||||
|
|
||||||
|
|
||||||
# Setta permessi giusti standalone selfhosted (LEGGERE GLI NB)
|
|
||||||
# NB DECOMMENTARE QUESTI COMANDI SOLO SE USI rss_generator selfhosted MA NON makeindex.sh
|
|
||||||
# NB NELLA MAGGIORPARTE DEI CASI TI SERVIRA' SOLO IL COMANDO PER GLI XML
|
|
||||||
#chown -R root:root $PWD_SC; chmod 740 $PWD_SC/*; echo "reset a root dei permessi della cartella $PWD_SC e tutti i suoi file"
|
|
||||||
#chmod +x $PWD_SC ; echo "permetto a chiunque di attraversare $PWD_SC"
|
|
||||||
#chown root:root ./*.sh; chmod 744 ./*.sh; echo "do i permessi giusti agli sh dentro $PWD_SC"
|
|
||||||
|
|
||||||
|
|
||||||
# Setta permessi giusti versione selfhosted con make_index (versione tipica)
|
|
||||||
#chown -R www-data:www-data $PWD_SC/*.xml; chmod -R 744 $PWD_SC/*.xml; echo "do i permessi giusti agli xml dentro a $PWD_SC"
|
|
||||||
32
show_link.sh
32
show_link.sh
@@ -1,32 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# SETTARE QUESTA VARIABILE SE LO SCRIPT NON VIENE USATO IN LOCALE:
|
|
||||||
PWD_SC="$PWD"
|
|
||||||
|
|
||||||
# Segue link per vedere se è stato aggiornato...
|
|
||||||
attuale="$(cat "$PWD_SC/attuale.txt")"
|
|
||||||
nuovo=$(curl --no-progress-meter -L $attuale | grep -oP 'streaming\w+(\.\w+)?' | grep -v "streamingcommunityoriginale" | head -n1)
|
|
||||||
# vecchio grep/sed
|
|
||||||
#nuovo=$(curl --no-progress-meter -L $attuale | sed -n 's/.*\(https:\/\/cdn\.streaming\.[^ ]*images[^ ]*\).*/\1/p' | grep -oP 'streaming\.\w+(\.\w+)?' | head -n1)
|
|
||||||
#echo -e "\n\nQUA $nuovo"
|
|
||||||
|
|
||||||
# Se il nuovo link è diverso dal nuovo, allora...
|
|
||||||
if [ "$attuale" != "$nuovo" ]; then
|
|
||||||
# se è vuoto lascia il vecchio
|
|
||||||
if [ -z "$nuovo" ]; then
|
|
||||||
echo "STANNO FACENDO CASINI O LINK CORROTTO. LASCIATO IL VECCHIO LINK"
|
|
||||||
else
|
|
||||||
# Se non è vuoto lo aggiorna con il nuovo link il file attuale.txt
|
|
||||||
attuale="$nuovo"
|
|
||||||
echo "$attuale" > $PWD_SC/attuale.txt
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# se il link giusto è ancora il vecchio lascia il vecchio
|
|
||||||
echo "Il link giusto è ancora il vecchio"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Formatta il link e lo stampa
|
|
||||||
attuale="https://$(cat "$PWD_SC/attuale.txt")"
|
|
||||||
echo -e "\nLink aggiornato:\n$attuale\n"
|
|
||||||
BIN
splash.gif
BIN
splash.gif
Binary file not shown.
|
Before Width: | Height: | Size: 488 KiB |
5
update_link.sh
Executable file
5
update_link.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
giusto=$(curl -L https://www.giardiniblog.it/streamingcommunity-nuovo-link/ | grep -oP '(?<=<strong>).*?(?=</strong></span></p>)' | grep -oP 'https://streamingcommunity.*')
|
||||||
|
|
||||||
|
echo -n "${giusto}" > /etc/nginx/streaming_community_last_url.txt
|
||||||
Reference in New Issue
Block a user