def get_hls_playlist(url):
ret = requests.get(url).json()
#import pdb;pdb.set_trace()
def get_hls_playlist(url):
ret = requests.get(url).json()
#import pdb;pdb.set_trace()
video['title'] = vid['name']
video['description'] = vid['lead']
video['url'] = get_hls_playlist("http://premium.tv4play.se/api/web/asset/{}/play.json?protocol=hls&videoFormat=MP4+WVM+SMI".format(vid['href']))
video['title'] = vid['name']
video['description'] = vid['lead']
video['url'] = get_hls_playlist("http://premium.tv4play.se/api/web/asset/{}/play.json?protocol=hls&videoFormat=MP4+WVM+SMI".format(vid['href']))
- basename = video['filename'].split('.ts')[0]
- if os.path.exists(basename+'.mkv'):
- print("Skipping {}".format(basename))
+ if video['filename'].with_suffix('.mkv').exists():
+ print("Skipping {}".format(video['filename'].with_suffix('.mkv')))