7 Commits

Author SHA1 Message Date
justuser-31 74878bb6c7 Update README.md 2022-10-06 14:11:15 +00:00
justuser-31 c6c81f837c Update 2022-10-06 14:24:37 +03:00
justuser-31 3da9503a4e Update 2022-10-06 14:23:38 +03:00
justuser-31 8f888b66ee Add new atation. 2022-10-06 14:16:21 +03:00
justuser-31 e4ad207f5d Update README.md 2022-10-06 13:58:48 +03:00
justuser-31 27422e9e63 Merge run.sh and up.py. 2022-10-06 13:55:32 +03:00
justuser-31 828abf2fbe Update README.md 2022-10-06 08:13:46 +00:00
5 changed files with 74 additions and 42 deletions
+4 -3
View File
@@ -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.
----- -----
+68
View File
@@ -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
-13
View File
@@ -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
+2 -2
View File
@@ -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
-24
View File
@@ -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