Compare commits
52 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4aa6849d09 | |||
| d2fdc6e9e8 | |||
| 0be7f6b74b | |||
| 7e84353f88 | |||
| e41c5b6230 | |||
| 9bf74da3b0 | |||
| 2d0a6047a0 | |||
| 87a30038a8 | |||
| 16989f61bb | |||
| 5362001f4e | |||
| 62845a7c60 | |||
| 05d1e8efd2 | |||
| 5d20302d21 | |||
| a29964c7a0 | |||
| 1bded20483 | |||
| a91be31db7 | |||
| b674fe9988 | |||
| 042eca9e3f | |||
| d0a07f6814 | |||
| 4ff68789cd | |||
| 636a66af11 | |||
| 5ebb457edc | |||
| 33cdae312a | |||
| 52f28c5d68 | |||
| c3054b5fdc | |||
| 620cf3ca1a | |||
| 6c5f1a2e2a | |||
| 1f3f2d5088 | |||
| 253b545a1f | |||
| 0821d84428 | |||
| dcd3606ed6 | |||
| ae1479b0a9 | |||
| 1a60a3b166 | |||
| 2bb97dd50f | |||
| 7646cff907 | |||
| 1ea7f36db1 | |||
| 3a5034af84 | |||
| b491b1ba75 | |||
| 06d4e327ec | |||
| 25a5aed4ad | |||
| ca83fd897e | |||
| e89446419f | |||
| 64c60cf5d5 | |||
| c38d20d811 | |||
| 3bbc0f4767 | |||
| 2c7bc86949 | |||
| cf53935fa5 | |||
| 24bd853d86 | |||
| 91762f5dee | |||
| dffb7ff67b | |||
| 50972a05db | |||
| 51b0348ed8 |
@@ -1,4 +1,4 @@
|
||||
## [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)
|
||||
## [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)
|
||||
|
||||
|
||||
-----
|
||||
@@ -11,8 +11,11 @@ sudo pip3 install -U telegram-upload
|
||||
#Check if all works(If not,READ MESSAGE)
|
||||
telegram-upload README.md
|
||||
|
||||
#INSTALL LAME
|
||||
#https://lame.sourceforge.io/links.php#Binaries
|
||||
#Audio bitrate check and convert
|
||||
pip3 install pydub
|
||||
|
||||
#INSTALL wget
|
||||
# https://www.gnu.org/software/wget/
|
||||
|
||||
git clone https://notabug.org/Justuser/getnetradio.git
|
||||
cd getnetradio
|
||||
@@ -65,4 +68,6 @@ 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,3 +1,5 @@
|
||||
#DEV-MODE
|
||||
dev=True
|
||||
#Time in minutes
|
||||
time = "10"
|
||||
#Prefix for file save location( $prefix/your.mp3 )
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from os import listdir,system as ss
|
||||
from time import sleep
|
||||
import subprocess
|
||||
#Theards
|
||||
import threading
|
||||
#Time&Date
|
||||
@@ -8,16 +7,17 @@ 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,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))
|
||||
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)
|
||||
|
||||
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,24 +51,14 @@ def upload():
|
||||
pass
|
||||
else:
|
||||
print("SUCCESS")
|
||||
tg(i,tim,prefix,rad[i][1])
|
||||
'''
|
||||
if i == "nashepunks.mp3":
|
||||
tg(i,tim,prefix,"https://t.me/getnetradio_nashe0punk")
|
||||
tg(i,tim,rad[i][1])
|
||||
#Download function
|
||||
def rad_down(ch):
|
||||
ss("wget "+ch)
|
||||
|
||||
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)
|
||||
|
||||
#Run download
|
||||
for i in rad:
|
||||
th = threading.Thread(target=rad_down, args=(rad[i][0],))
|
||||
|
||||
Reference in New Issue
Block a user