This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
needed to get one song from | |
https://radio.nrk.no/serie/vahkkoloahppa/SAPR04030320 | |
eventually figured out that they stream the audio in .ts | |
chunks. you will need to find the chunk url, for example: | |
https://nrkod98-cdn0-47115-odedge1.dna.contentdelivery.net/47115-odedge1/open/ps/sany/sany01011324/ae83c997-2.smil/sc-gaFEAA/ | |
at the end there will be something like a1_F0000.ts | |
we need to loop through every one. you can either loop | |
until you get a 404, or find the a1 index.m3u8 file (in this case) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import librosa # you need librosa to get this working | |
import datetime | |
def parse_delta(s): | |
date = datetime.datetime.strptime(s, "%H:%M:%S") | |
return datetime.timedelta(hours=date.hour, minutes=date.minute, seconds=date.second) |