class M3u(VPProxyPlugin):
- handlers = ('m3u', )
+ handlers = ('m3u', 'm3ut' )
logger = logging.getLogger('plugin_m3u')
playlist = None
self.splitted_path=connection.path.split('/')
+ if self.splitted_path[1]=='m3u':
+ prefix='get'
+ elif self.splitted_path[1]=='m3uw':
+ prefix='webm'
+ elif self.splitted_path[1]=='m3ut':
+ prefix='mp4'
+ else:
+ connection.dieWithError(404)
+
if len(self.splitted_path)>3:
connection.dieWithError()
return
try:
playlist=parseM3U(m3u_file)
except:
- connection.dieWithError()
+ connection.dieWithError(404)
return
if not playlist:
channel['url']=record.path.decode('utf-8')
playlistgen.addItem(channel)
- exported = playlistgen.exportm3u(hostport)
+ exported = playlistgen.exportm3u(hostport,prefix)
exported = exported.encode('utf-8')
connection.wfile.write(exported)