- if v == '1':
- quality = quality_key(k)
- if quality >= 0:
- formats.append({
- 'url': 'http://pl%s.live.panda.tv/live_panda/%s%s%s.flv' % (plflag1, room_key, live_panda, suffix[quality]),
- 'format_id': k,
- 'quality': quality,
- })
+ if v != '1':
+ continue
+ quality = quality_key(k)
+ if quality <= 0:
+ continue
+ for pref, (ext, pl) in enumerate((('m3u8', '-hls'), ('flv', ''))):
+ formats.append({
+ 'url': 'https://pl%s%s.live.panda.tv/live_panda/%s%s%s.%s?sign=%s&ts=%s&rid=%s'
+ % (pl, plflag1, room_key, live_panda, suffix[quality], ext, sign, ts, rid),
+ 'format_id': '%s-%s' % (k, ext),
+ 'quality': quality,
+ 'source_preference': pref,
+ })