Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 74878bb6c7 | |||
| c6c81f837c | |||
| 3da9503a4e | |||
| 8f888b66ee | |||
| e4ad207f5d | |||
| 27422e9e63 | |||
| 828abf2fbe |
@@ -1,4 +1,4 @@
|
|||||||
## [Install](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#0install) | [Usage](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#1usage) | [Telegram](https://t.me/getnetradio) | [Updates](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#contact-updates)
|
## [Install](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#0install) | [Usage](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#1usage) | [Telegram](https://t.me/getnetradio) | [Updates](https://gitlab.com/justuser31/getnetradio/-/blob/master/README.md#contact-updates) | [Realeses](https://gitlab.com/justuser31/getnetradio/-/releases)
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
@@ -21,8 +21,8 @@ cd getnetradio
|
|||||||
--to https://t.me/getnetradio_nashe0punk
|
--to https://t.me/getnetradio_nashe0punk
|
||||||
#Here your link telegram channel
|
#Here your link telegram channel
|
||||||
|
|
||||||
#Start(nohup for work in background)
|
#Start(nohup and "&" for work in background)
|
||||||
nohup ./run.sh
|
nohup python3 main.py &
|
||||||
#Stop
|
#Stop
|
||||||
./stop.sh
|
./stop.sh
|
||||||
```
|
```
|
||||||
@@ -43,6 +43,7 @@ nohup ./run.sh
|
|||||||
|
|
||||||
> 05.10.2022 - Migrate to gitlab.com
|
> 05.10.2022 - Migrate to gitlab.com
|
||||||
|
|
||||||
|
> 06.10.2022 - Merge st.sh and up.py, new release.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
from os import listdir,system as ss
|
||||||
|
from time import sleep
|
||||||
|
#Theards
|
||||||
|
import threading
|
||||||
|
#Time&Date
|
||||||
|
from datetime import date
|
||||||
|
import time
|
||||||
|
|
||||||
|
#RADIO STATIONS
|
||||||
|
rad = [
|
||||||
|
"https://nashe1.hostingradio.ru:18000/nashepunks.mp3",
|
||||||
|
"https://ic7.101.ru:8000/v1_1 -O nrj.mp3".
|
||||||
|
"https://emgregion.hostingradio.ru:8064/moscow.retrofm.mp3 -O retrofm.mp3"
|
||||||
|
]
|
||||||
|
###
|
||||||
|
|
||||||
|
#TIME(IN MINUTES)
|
||||||
|
tw = 3
|
||||||
|
wait = tw
|
||||||
|
###
|
||||||
|
|
||||||
|
#Save location
|
||||||
|
prefix = "~/ARCHIVE/"
|
||||||
|
###
|
||||||
|
|
||||||
|
#Upload in telegram
|
||||||
|
def upload():
|
||||||
|
today = date.today()
|
||||||
|
files = listdir()
|
||||||
|
#Set date&time
|
||||||
|
tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime()))
|
||||||
|
|
||||||
|
for i in files:
|
||||||
|
if i == "nashepunks.mp3":
|
||||||
|
ss("telegram-upload "+i+" --to https://t.me/getnetradio_nashe0punk --caption "+tim)
|
||||||
|
ss("mkdir "+prefix+tim)
|
||||||
|
ss("mv "+i+" "+prefix+tim+"/")
|
||||||
|
elif i == "nrj.mp3":
|
||||||
|
ss("telegram-upload "+i+" --to https://t.me/getnetradio_nrj --caption "+tim)
|
||||||
|
ss("mkdir "+prefix+tim)
|
||||||
|
ss("mv "+i+" "+prefix+tim+"/")
|
||||||
|
elif i == "retrofm.mp3":
|
||||||
|
ss("telegram-upload "+i+" --to https://t.me/getnetradio_retrofm --caption "+tim)
|
||||||
|
ss("mkdir "+prefix+tim)
|
||||||
|
ss("mv "+i+" "+prefix+tim+"/")
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
while True:
|
||||||
|
#Download function
|
||||||
|
def rad_down(ch):
|
||||||
|
ss("wget "+i)
|
||||||
|
#Run download
|
||||||
|
for i in rad:
|
||||||
|
th = threading.Thread(target=rad_down, args=(i,))
|
||||||
|
th.start()
|
||||||
|
|
||||||
|
#Wait
|
||||||
|
sleep(wait)
|
||||||
|
|
||||||
|
#Stop download
|
||||||
|
ss("killall wget")
|
||||||
|
|
||||||
|
#Upload
|
||||||
|
upload()
|
||||||
|
|
||||||
|
break
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
while :
|
|
||||||
do
|
|
||||||
wget https://nashe1.hostingradio.ru:18000/nashepunks.mp3 &
|
|
||||||
th1=$!
|
|
||||||
wget https://ic7.101.ru:8000/v1_1 -O nrj.mp3 &
|
|
||||||
th2=$!
|
|
||||||
|
|
||||||
sleep 30m
|
|
||||||
kill -9 $th1
|
|
||||||
kill -9 $th2
|
|
||||||
|
|
||||||
python3 up.py
|
|
||||||
done
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
kl=$(ps aux | grep run.sh | grep bin | awk -F " " '{print $2}')
|
kl=$(ps aux | grep main.py | grep python3 | awk -F " " '{print $2}')
|
||||||
kill $kl
|
kill $kl
|
||||||
killall wget
|
killall wget
|
||||||
rm *.mp3
|
rm *.mp3
|
||||||
rm nohup.out
|
#rm nohup.out
|
||||||
|
|||||||
@@ -1,24 +0,0 @@
|
|||||||
from os import listdir,system as ss
|
|
||||||
from datetime import date
|
|
||||||
import time
|
|
||||||
|
|
||||||
today = date.today()
|
|
||||||
files = listdir()
|
|
||||||
prefix = "~/ARCHIVE/"
|
|
||||||
|
|
||||||
for i in files:
|
|
||||||
tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime()))
|
|
||||||
|
|
||||||
#Check type,no need for this
|
|
||||||
#tp = i[i.find('.') + 1:]
|
|
||||||
|
|
||||||
if i == "nashepunks.mp3":
|
|
||||||
ss("telegram-upload "+i+" --to https://t.me/getnetradio_nashe0punk --caption "+tim)
|
|
||||||
ss("mkdir "+prefix+tim)
|
|
||||||
ss("mv "+i+" "+prefix+tim+"/")
|
|
||||||
elif i == "nrj.mp3":
|
|
||||||
ss("telegram-upload "+i+" --to https://t.me/getnetradio_nrj --caption "+tim)
|
|
||||||
ss("mkdir "+prefix+tim)
|
|
||||||
ss("mv "+i+" "+prefix+tim+"/")
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
Reference in New Issue
Block a user