New config! More easier.

master
justuser31 2 years ago
parent 883307b9d4
commit 8b372a4ed4

@ -0,0 +1,15 @@
#Time in minutes
time = "10"
#Prefix for file save location( $prefix/your.mp3 )
prefix= "~/ARCHIVE/"
#Your radio
radio = {
#name_of_file.mp3 : ["https://link_to_radio.mp3","https://link_to_telegram"]
#"-O name.mp3" after link to change name(look for example \/ )
"nashepunks.mp3" : ["https://nashe1.hostingradio.ru:18000/nashepunks.mp3","https://t.me/getnetradio_nashe0punk"],
"nrj.mp3" : ["https://ic7.101.ru:8000/v1_1 -O nrj.mp3","https://t.me/getnetradio_nrj"],
"retrofm.mp3" : ["https://emgregion.hostingradio.ru:8064/moscow.retrofm.mp3 -O retrofm.mp3","https://t.me/getnetradio_retrofm"]
}

@ -6,27 +6,23 @@ import threading
#Time&Date
from datetime import date
import time
#Config
import config
#DEV-MODE#
dev = False
##########
#RADIO STATIONS
#SET TELEGRAM IN upload()
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 = 30
#Import config
tw = int(config.time)
prefix = config.prefix
rad = config.radio
if dev == False:
wait = tw*60
else:
wait = tw
#Save location
prefix = "~/ARCHIVE/"
###
#Check bitrate and upload
def tg(i,tim,prefix,group):
@ -51,7 +47,12 @@ def upload():
tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime()))
for i in files:
#HERE SET YOUR TELEGRAM AND MP3
if rad.get(i) == None:
pass
else:
print("SUCCESS")
tg(i,tim,prefix,rad[i][1])
'''
if i == "nashepunks.mp3":
tg(i,tim,prefix,"https://t.me/getnetradio_nashe0punk")
@ -62,15 +63,15 @@ def upload():
tg(i,tim,prefix,"https://t.me/getnetradio_retrofm")
else:
pass
'''
while True:
#Download function
def rad_down(ch):
ss("wget "+i)
ss("wget "+ch)
#Run download
for i in rad:
th = threading.Thread(target=rad_down, args=(i,))
th = threading.Thread(target=rad_down, args=(rad[i][0],))
th.start()
#Wait

Loading…
Cancel
Save