You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-26 21:53:54 +01:00
transition to udp
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import os
|
import os, socket
|
||||||
import random
|
import random
|
||||||
import subprocess
|
import subprocess
|
||||||
import time, datetime
|
import time, datetime
|
||||||
@@ -46,13 +46,13 @@ def update_rds(track_name):
|
|||||||
print("Unknown", e)
|
print("Unknown", e)
|
||||||
prt = rds_base.format(rds_default_name)
|
prt = rds_base.format(rds_default_name)
|
||||||
|
|
||||||
f = open(rds_path, "w")
|
f = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
f.write(f"TEXT={prt}\r\n")
|
f.sendto(f"TEXT={prt}\r\n".encode(), ("127.0.0.1", 5000))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
f.write(f"RTP={rds_default_rtp_data},{len(str(name_table[track_name]))-1}\r\n")
|
f.sendto(f"RTP={rds_default_rtp_data},{len(str(name_table[track_name]))-1}\r\n".encode(), ("127.0.0.1", 5000))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
f.write(f"RTP={rds_default_rtp_data},{len(rds_default_name)-1}\r\n")
|
f.sendto(f"RTP={rds_default_rtp_data},{len(rds_default_name)-1}\r\n".encode(), ("127.0.0.1", 5000))
|
||||||
f.close()
|
f.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error updating RDS: {e}")
|
print(f"Error updating RDS: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user