46 Commits

Author SHA1 Message Date
justuser-31 26f9c15cfd Update README.md 2022-10-06 19:32:09 +00:00
justuser-31 44e1960a5e Update README.md 2022-10-06 19:30:30 +00:00
justuser-31 00d7d0c582 Update README.md 2022-10-06 19:29:49 +00:00
justuser-31 8b372a4ed4 New config! More easier. 2022-10-06 22:28:51 +03:00
justuser-31 883307b9d4 Merge branch 'master' of https://gitlab.com/justuser31/getnetradio 2022-10-06 20:03:58 +03:00
justuser-31 0c47043168 Add check bitrate and convert. 2022-10-06 20:03:49 +03:00
justuser-31 b40b367280 Update README.md 2022-10-06 17:01:38 +00:00
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
justuser-31 e168fd1cf1 Hello GPL! 2022-10-05 18:35:48 +00:00
justuser-31 560c013fc8 Update README.md 2022-10-05 16:49:34 +00:00
justuser-31 a6d4743c89 Update README.md 2022-10-05 16:48:31 +00:00
justuser-31 65168509a3 Update README.md 2022-10-05 16:47:40 +00:00
justuser-31 b1fb3cb8d1 Small update 2022-10-05 19:42:50 +03:00
justuser-31 99889165c5 test 2022-10-05 19:40:01 +03:00
justuser-31 0c6e6c97f6 Update 2022-10-05 18:56:19 +03:00
justuser-31 a93bbc62c7 test 2022-10-05 18:50:35 +03:00
justuser-31 fdb570f748 Enable upload all stations 2022-10-05 16:44:43 +03:00
justuser-31 39f849539c fix tabs 2022-10-05 14:51:34 +03:00
justuser-31 b495cd66ad Fix bug.I forget '&' at the end of command. 2022-10-05 13:22:19 +03:00
justuser-31 0d1ea3cd0e Add energy station 2022-10-05 12:42:27 +03:00
justuser-31 53b62aa278 Update 'README.md' 2022-10-05 09:25:38 +00:00
justuser-31 4d93102164 Update 'README.md' 2022-10-05 09:05:02 +00:00
justuser-31 f1189369a2 Update 'README.md' 2022-10-05 09:04:30 +00:00
justuser-31 93184aacf6 Update 'README.md' 2022-10-05 08:59:11 +00:00
justuser-31 4b63e11ade Add "Install" and "Usage" 2022-10-05 08:57:22 +00:00
justuser-31 347d865196 Merge branch 'master' of https://notabug.org/Justuser/getnetradio 2022-10-05 11:44:47 +03:00
justuser-31 35cf3796e1 Rename files,small fix and add stop.sh 2022-10-05 11:43:48 +03:00
justuser-31 a5961a369f Rename run file. 2022-10-05 08:43:08 +00:00
justuser-31 4edc2cff2e Update 'README.md' 2022-10-04 19:36:30 +00:00
justuser-31 4393824e06 update 2022-10-04 22:09:11 +03:00
justuser-31 c70303aa70 Small update 2022-10-04 21:55:46 +03:00
justuser-31 4a3860995e Update 'README.md' 2022-10-04 18:10:15 +00:00
justuser-31 adcc3d225d General update 2022-10-04 21:06:03 +03:00
justuser-31 30f0e442f4 Update 'README.md' 2022-10-04 17:55:07 +00:00
justuser-31 45d2beea9e update 2022-10-04 20:53:57 +03:00
justuser-31 22f0c98175 update 2022-10-04 20:53:28 +03:00
justuser-31 891122c5d0 update 2022-10-04 20:50:52 +03:00
justuser-31 cef9a66694 update 2022-10-04 20:50:01 +03:00
justuser-31 26d881c0b2 my scripts 2022-10-04 20:47:17 +03:00
justuser-31 6a31a54dd8 first commit 2022-10-04 20:41:53 +03:00
4 changed files with 31 additions and 28 deletions
+3 -8
View File
@@ -1,4 +1,4 @@
## [Install](https://gitea.dmcraft.online/justuser/getnetradio#0-install) | [Usage](https://gitea.dmcraft.online/justuser/getnetradio#1-usage) | [Telegram](https://t.me/getnetradio) | [Updates](https://gitea.dmcraft.online/justuser/getnetradio#contact-updates) | [Realeses](https://gitea.dmcraft.online/justuser/getnetradio/releases) ## [Install](https://gitlab.com/justuser31/getnetradio#0install) | [Usage](https://gitlab.com/justuser31/getnetradio#1usage) | [Telegram](https://t.me/getnetradio) | [Updates](https://gitlab.com/justuser31/getnetradio#contact-updates) | [Realeses](https://gitlab.com/justuser31/getnetradio/-/releases)
----- -----
@@ -11,11 +11,8 @@ sudo pip3 install -U telegram-upload
#Check if all works(If not,READ MESSAGE) #Check if all works(If not,READ MESSAGE)
telegram-upload README.md telegram-upload README.md
#Audio bitrate check and convert #INSTALL LAME
pip3 install pydub #https://lame.sourceforge.io/links.php#Binaries
#INSTALL wget
# https://www.gnu.org/software/wget/
git clone https://notabug.org/Justuser/getnetradio.git git clone https://notabug.org/Justuser/getnetradio.git
cd getnetradio cd getnetradio
@@ -68,6 +65,4 @@ git config --global credential.helper cache
python3 -m http.server python3 -m http.server
#Change repo #Change repo
git push --repo=https://gitlab.com/justuser31/getnetradio git push --repo=https://gitlab.com/justuser31/getnetradio
git clone --branch <branchname> <remote-repo-url>
``` ```
-2
View File
@@ -1,5 +1,3 @@
#DEV-MODE
dev=True
#Time in minutes #Time in minutes
time = "10" time = "10"
#Prefix for file save location( $prefix/your.mp3 ) #Prefix for file save location( $prefix/your.mp3 )
+27 -17
View File
@@ -1,5 +1,6 @@
from os import listdir,system as ss from os import listdir,system as ss
from time import sleep from time import sleep
import subprocess
#Theards #Theards
import threading import threading
#Time&Date #Time&Date
@@ -7,17 +8,16 @@ from datetime import date
import time import time
#Config #Config
import config import config
#Check bitrate and convert audio
from pydub import AudioSegment
from pydub.utils import mediainfo
#DEV-MODE#
dev = False
##########
#Import config #Import config
tw = int(config.time) tw = int(config.time)
prefix = config.prefix prefix = config.prefix
rad = config.radio rad = config.radio
dev = bool(config.dev)
###
if dev == False: if dev == False:
wait = tw*60 wait = tw*60
@@ -25,14 +25,14 @@ else:
wait = tw wait = tw
#Check bitrate and upload #Check bitrate and upload
def tg(i,tim,group): def tg(i,tim,prefix,group):
bit = int(mediainfo(i)['bit_rate'])/1000 ss("rm t")
ss("ffprobe "+i+" 2> t")
if bit > 128: bit = int(subprocess.check_output("cat t | grep bitrate | grep Duration | awk -F \" \" '{print $6}'", shell=True))
sound = AudioSegment.from_file(i)
sound.export("tt.mp3", format="mp3", bitrate="128k")
ss("mv tt.mp3 "+i)
if bit != 128:
ss("lame --mp3input -b 128 "+i+" tt")
ss("mv tt "+i)
ss("telegram-upload "+i+" --to "+group+" --caption "+tim) ss("telegram-upload "+i+" --to "+group+" --caption "+tim)
ss("mkdir "+prefix+tim) ss("mkdir "+prefix+tim)
@@ -51,14 +51,24 @@ def upload():
pass pass
else: else:
print("SUCCESS") print("SUCCESS")
tg(i,tim,rad[i][1]) tg(i,tim,prefix,rad[i][1])
#Download function '''
def rad_down(ch): if i == "nashepunks.mp3":
ss("wget "+ch) tg(i,tim,prefix,"https://t.me/getnetradio_nashe0punk")
elif i == "nrj.mp3":
tg(i,tim,prefix,"https://t.me/getnetradio_nrj")
elif i == "retrofm.mp3":
tg(i,tim,prefix,"https://t.me/getnetradio_retrofm")
else:
pass
'''
while True: while True:
#Download function
def rad_down(ch):
ss("wget "+ch)
#Run download #Run download
for i in rad: for i in rad:
th = threading.Thread(target=rad_down, args=(rad[i][0],)) th = threading.Thread(target=rad_down, args=(rad[i][0],))
+1 -1
View File
@@ -2,4 +2,4 @@ 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