+ # Construct regular HTTP download URLs
+ replacements = {
+ 'audio': {
+ 'format_id': 'mp3',
+ 'pattern': r'^nas2\.share/wavrss/',
+ 'repl': 'http://rsspod.rtp.pt/podcasts/',
+ 'vcodec': 'none',
+ },
+ 'video': {
+ 'format_id': 'mp4_h264',
+ 'pattern': r'^nas2\.share/h264/',
+ 'repl': 'http://rsspod.rtp.pt/videocasts/',
+ 'vcodec': 'h264',
+ },
+ }
+ r = replacements[config['type']]
+ if re.match(r['pattern'], config['file']) is not None:
+ formats.append({
+ 'format_id': r['format_id'],
+ 'url': re.sub(r['pattern'], r['repl'], config['file']),
+ 'vcodec': r['vcodec'],
+ })
+
+ self._sort_formats(formats)
+