Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import time
- start = time.strftime('%M')
- r = requests.get(stream_url, stream=True) #not putting url here but it's defined
- with open('6am-630am.mp3', 'wb') as f:
- try:
- while int(time.strftime('%M')) < 30: #do this till it's 6:30
- for block in r.iter_content(1024):
- f.write(block)
- except KeyboardInterrupt:
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement