Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 74878bb6c7 | |||
| c6c81f837c | |||
| 3da9503a4e | |||
| 8f888b66ee | |||
| e4ad207f5d | |||
| 27422e9e63 | |||
| 828abf2fbe | |||
| e168fd1cf1 | |||
| 560c013fc8 | |||
| a6d4743c89 | |||
| 65168509a3 | |||
| b1fb3cb8d1 | |||
| 99889165c5 | |||
| 0c6e6c97f6 | |||
| a93bbc62c7 | |||
| fdb570f748 | |||
| 39f849539c | |||
| b495cd66ad | |||
| 0d1ea3cd0e | |||
| 53b62aa278 | |||
| 4d93102164 | |||
| f1189369a2 | |||
| 93184aacf6 | |||
| 4b63e11ade | |||
| 347d865196 | |||
| 35cf3796e1 | |||
| a5961a369f | |||
| 4edc2cff2e | |||
| 4393824e06 | |||
| c70303aa70 | |||
| 4a3860995e | |||
| adcc3d225d | |||
| 30f0e442f4 | |||
| 45d2beea9e | |||
| 22f0c98175 | |||
| 891122c5d0 | |||
| cef9a66694 | |||
| 26d881c0b2 | |||
| 6a31a54dd8 |
@@ -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/-/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)
|
||||||
|
|
||||||
|
|
||||||
-----
|
-----
|
||||||
@@ -11,25 +11,20 @@ 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
|
|
||||||
pip3 install pydub
|
|
||||||
|
|
||||||
#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
|
||||||
```
|
```
|
||||||
### 1.Usage
|
### 1.Usage
|
||||||
```
|
```
|
||||||
#ALL CONFIGS IN config.py
|
#Config your stations and audio time in run.sh
|
||||||
|
#Config upload audio file to teelegram in up.py
|
||||||
|
--to https://t.me/getnetradio_nashe0punk
|
||||||
|
#Here your link telegram channel
|
||||||
|
|
||||||
#Start(nohup and "&" for work in background)
|
#Start(nohup and "&" for work in background)
|
||||||
nohup python3 main.py &
|
nohup python3 main.py &
|
||||||
#Stop
|
#Stop
|
||||||
./stop.sh
|
./stop.sh
|
||||||
#Or just kill main.py and wget
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -50,9 +45,6 @@ nohup python3 main.py &
|
|||||||
|
|
||||||
> 06.10.2022 - Merge st.sh and up.py, new release.
|
> 06.10.2022 - Merge st.sh and up.py, new release.
|
||||||
|
|
||||||
> 06.10.2022 - Add check bitrate and convert with "lame".
|
|
||||||
|
|
||||||
> 06.10.2022 - New config,more easier.
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
||||||
@@ -68,6 +60,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>
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
#DEV-MODE
|
|
||||||
dev=True
|
|
||||||
#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"]
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -5,39 +5,23 @@ import threading
|
|||||||
#Time&Date
|
#Time&Date
|
||||||
from datetime import date
|
from datetime import date
|
||||||
import time
|
import time
|
||||||
#Config
|
|
||||||
import config
|
|
||||||
#Check bitrate and convert audio
|
|
||||||
from pydub import AudioSegment
|
|
||||||
from pydub.utils import mediainfo
|
|
||||||
|
|
||||||
|
#RADIO STATIONS
|
||||||
#Import config
|
rad = [
|
||||||
tw = int(config.time)
|
"https://nashe1.hostingradio.ru:18000/nashepunks.mp3",
|
||||||
prefix = config.prefix
|
"https://ic7.101.ru:8000/v1_1 -O nrj.mp3".
|
||||||
rad = config.radio
|
"https://emgregion.hostingradio.ru:8064/moscow.retrofm.mp3 -O retrofm.mp3"
|
||||||
dev = bool(config.dev)
|
]
|
||||||
###
|
###
|
||||||
|
|
||||||
if dev == False:
|
#TIME(IN MINUTES)
|
||||||
wait = tw*60
|
tw = 3
|
||||||
else:
|
|
||||||
wait = tw
|
wait = tw
|
||||||
|
###
|
||||||
|
|
||||||
#Check bitrate and upload
|
#Save location
|
||||||
def tg(i,tim,group):
|
prefix = "~/ARCHIVE/"
|
||||||
bit = int(mediainfo(i)['bit_rate'])/1000
|
###
|
||||||
|
|
||||||
if bit > 128:
|
|
||||||
sound = AudioSegment.from_file(i)
|
|
||||||
sound.export("tt.mp3", format="mp3", bitrate="128k")
|
|
||||||
ss("mv tt.mp3 "+i)
|
|
||||||
|
|
||||||
|
|
||||||
ss("telegram-upload "+i+" --to "+group+" --caption "+tim)
|
|
||||||
ss("mkdir "+prefix+tim)
|
|
||||||
ss("mv "+i+" "+prefix+tim+"/")
|
|
||||||
|
|
||||||
|
|
||||||
#Upload in telegram
|
#Upload in telegram
|
||||||
def upload():
|
def upload():
|
||||||
@@ -47,21 +31,29 @@ 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:
|
||||||
if rad.get(i) == None:
|
if i == "nashepunks.mp3":
|
||||||
pass
|
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:
|
else:
|
||||||
print("SUCCESS")
|
pass
|
||||||
tg(i,tim,rad[i][1])
|
|
||||||
#Download function
|
|
||||||
def rad_down(ch):
|
|
||||||
ss("wget "+ch)
|
|
||||||
|
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
#Download function
|
||||||
|
def rad_down(ch):
|
||||||
|
ss("wget "+i)
|
||||||
#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=(i,))
|
||||||
th.start()
|
th.start()
|
||||||
|
|
||||||
#Wait
|
#Wait
|
||||||
@@ -73,5 +65,4 @@ while True:
|
|||||||
#Upload
|
#Upload
|
||||||
upload()
|
upload()
|
||||||
|
|
||||||
if dev == True:
|
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user