New config! More easier.
This commit is contained in:
parent
883307b9d4
commit
8b372a4ed4
15
config.py
Normal file
15
config.py
Normal file
@ -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"]
|
||||||
|
|
||||||
|
}
|
33
main.py
33
main.py
@ -6,27 +6,23 @@ import threading
|
|||||||
#Time&Date
|
#Time&Date
|
||||||
from datetime import date
|
from datetime import date
|
||||||
import time
|
import time
|
||||||
|
#Config
|
||||||
|
import config
|
||||||
|
|
||||||
|
|
||||||
#DEV-MODE#
|
#DEV-MODE#
|
||||||
dev = False
|
dev = False
|
||||||
##########
|
##########
|
||||||
|
|
||||||
#RADIO STATIONS
|
#Import config
|
||||||
#SET TELEGRAM IN upload()
|
tw = int(config.time)
|
||||||
rad = [
|
prefix = config.prefix
|
||||||
"https://nashe1.hostingradio.ru:18000/nashepunks.mp3",
|
rad = config.radio
|
||||||
"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
|
|
||||||
if dev == False:
|
if dev == False:
|
||||||
wait = tw*60
|
wait = tw*60
|
||||||
else:
|
else:
|
||||||
wait = tw
|
wait = tw
|
||||||
#Save location
|
|
||||||
prefix = "~/ARCHIVE/"
|
|
||||||
###
|
|
||||||
|
|
||||||
#Check bitrate and upload
|
#Check bitrate and upload
|
||||||
def tg(i,tim,prefix,group):
|
def tg(i,tim,prefix,group):
|
||||||
@ -51,7 +47,12 @@ def upload():
|
|||||||
tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime()))
|
tim = today.strftime("%d.%m.%Y_"+time.strftime("%H:%M", time.localtime()))
|
||||||
|
|
||||||
for i in files:
|
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":
|
if i == "nashepunks.mp3":
|
||||||
tg(i,tim,prefix,"https://t.me/getnetradio_nashe0punk")
|
tg(i,tim,prefix,"https://t.me/getnetradio_nashe0punk")
|
||||||
|
|
||||||
@ -62,15 +63,15 @@ def upload():
|
|||||||
tg(i,tim,prefix,"https://t.me/getnetradio_retrofm")
|
tg(i,tim,prefix,"https://t.me/getnetradio_retrofm")
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
'''
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
#Download function
|
#Download function
|
||||||
def rad_down(ch):
|
def rad_down(ch):
|
||||||
ss("wget "+i)
|
ss("wget "+ch)
|
||||||
#Run download
|
#Run download
|
||||||
for i in rad:
|
for i in rad:
|
||||||
th = threading.Thread(target=rad_down, args=(i,))
|
th = threading.Thread(target=rad_down, args=(rad[i][0],))
|
||||||
th.start()
|
th.start()
|
||||||
|
|
||||||
#Wait
|
#Wait
|
||||||
|
Loading…
Reference in New Issue
Block a user