Apr-14-2020, 03:36 AM
(This post was last modified: Apr-14-2020, 03:37 AM by steve_shambles.)
I'm not sure if this solution is suitable for you
or if you can work it into the way you want your program
to work, but here is an idea.
and do it again for ever.
or if you can work it into the way you want your program
to work, but here is an idea.
import os import random import time import webbrowser as web def make_url(): """Append a random value to urls end.""" rnd = str(random.randrange(1000000)) url_with_rnd = "https://mediaserver3.afa.net:8443/talk.mp3" + "?" + rnd web.open(url_with_rnd) return url_with_rnd while True: URL = make_url() time.sleep(30) os.system("taskkill /F /IM firefox.exe")This will play the stream for 30 seconds, quit the browser and the stream, get a new url
and do it again for ever.