From 35cf3796e18c6f258686ad4a8ed9849f72e1e797 Mon Sep 17 00:00:00 2001 From: Justuser Date: Wed, 5 Oct 2022 11:43:48 +0300 Subject: [PATCH] Rename files,small fix and add stop.sh --- run.sh | 10 ++++++++++ stop.sh | 5 +++++ up.py | 11 ++++++----- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100755 run.sh create mode 100755 stop.sh diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..4323825 --- /dev/null +++ b/run.sh @@ -0,0 +1,10 @@ +while : +do + wget https://nashe1.hostingradio.ru:18000/nashepunks.mp3 & + th1=$! + + sleep 30m + kill -9 $th1 + + python3 up.py +done diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..e195c07 --- /dev/null +++ b/stop.sh @@ -0,0 +1,5 @@ +kl=$(ps aux | grep run.sh | grep bin | awk -F " " '{print $2}') +kill $kl +killall wget +rm *.mp3 +rm nohup.out diff --git a/up.py b/up.py index 9150836..2ed4642 100644 --- a/up.py +++ b/up.py @@ -8,8 +8,9 @@ files = listdir() for i in files: tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime())) - tp = i[i.find('.') + 1:] - if tp == "mp3": - ss("telegram-upload "+i+" --to https://t.me/streamsradio --caption "+tim) - ss("mkdir "+tim) - ss("mv "+i+" "+tim+"/") + #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 ARCHIVE/"+tim) + ss("mv "+i+" ARCHIVE/"+tim+"/")