Compare commits
46 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 26f9c15cfd | |||
| 44e1960a5e | |||
| 00d7d0c582 | |||
| 8b372a4ed4 | |||
| 883307b9d4 | |||
| 0c47043168 | |||
| b40b367280 | |||
| 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#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)
|
||||
telegram-upload README.md
|
||||
|
||||
#Audio bitrate check and convert
|
||||
pip3 install pydub
|
||||
|
||||
#INSTALL wget
|
||||
# https://www.gnu.org/software/wget/
|
||||
#INSTALL LAME
|
||||
#https://lame.sourceforge.io/links.php#Binaries
|
||||
|
||||
git clone https://notabug.org/Justuser/getnetradio.git
|
||||
cd getnetradio
|
||||
@@ -68,6 +65,4 @@ git config --global credential.helper cache
|
||||
python3 -m http.server
|
||||
#Change repo
|
||||
git push --repo=https://gitlab.com/justuser31/getnetradio
|
||||
|
||||
git clone --branch <branchname> <remote-repo-url>
|
||||
```
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#DEV-MODE
|
||||
dev=True
|
||||
#Time in minutes
|
||||
time = "10"
|
||||
#Prefix for file save location( $prefix/your.mp3 )
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from os import listdir,system as ss
|
||||
from time import sleep
|
||||
import subprocess
|
||||
#Theards
|
||||
import threading
|
||||
#Time&Date
|
||||
@@ -7,17 +8,16 @@ from datetime import date
|
||||
import time
|
||||
#Config
|
||||
import config
|
||||
#Check bitrate and convert audio
|
||||
from pydub import AudioSegment
|
||||
from pydub.utils import mediainfo
|
||||
|
||||
|
||||
#DEV-MODE#
|
||||
dev = False
|
||||
##########
|
||||
|
||||
#Import config
|
||||
tw = int(config.time)
|
||||
prefix = config.prefix
|
||||
rad = config.radio
|
||||
dev = bool(config.dev)
|
||||
###
|
||||
|
||||
if dev == False:
|
||||
wait = tw*60
|
||||
@@ -25,14 +25,14 @@ else:
|
||||
wait = tw
|
||||
|
||||
#Check bitrate and upload
|
||||
def tg(i,tim,group):
|
||||
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)
|
||||
def tg(i,tim,prefix,group):
|
||||
ss("rm t")
|
||||
ss("ffprobe "+i+" 2> t")
|
||||
bit = int(subprocess.check_output("cat t | grep bitrate | grep Duration | awk -F \" \" '{print $6}'", shell=True))
|
||||
|
||||
if bit != 128:
|
||||
ss("lame --mp3input -b 128 "+i+" tt")
|
||||
ss("mv tt "+i)
|
||||
|
||||
ss("telegram-upload "+i+" --to "+group+" --caption "+tim)
|
||||
ss("mkdir "+prefix+tim)
|
||||
@@ -51,14 +51,24 @@ def upload():
|
||||
pass
|
||||
else:
|
||||
print("SUCCESS")
|
||||
tg(i,tim,rad[i][1])
|
||||
tg(i,tim,prefix,rad[i][1])
|
||||
'''
|
||||
if i == "nashepunks.mp3":
|
||||
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:
|
||||
#Download function
|
||||
def rad_down(ch):
|
||||
ss("wget "+ch)
|
||||
|
||||
|
||||
while True:
|
||||
|
||||
#Run download
|
||||
for i in rad:
|
||||
th = threading.Thread(target=rad_down, args=(rad[i][0],))
|
||||
|
||||
Reference in New Issue
Block a user