X-Git-Url: https://git.rvb.name/vpproxy.git/blobdiff_plain/1e2c0e679beb33f10c2e551768c17ccd77576b54..68a65fd06255411599601a0b9857be6ef2e8eba2:/plugins/m3u_plugin.py diff --git a/plugins/m3u_plugin.py b/plugins/m3u_plugin.py index 4104e43..cc614f2 100644 --- a/plugins/m3u_plugin.py +++ b/plugins/m3u_plugin.py @@ -17,7 +17,7 @@ import os class M3u(VPProxyPlugin): - handlers = ('m3u', ) + handlers = ('m3u', 'm3ut' ) logger = logging.getLogger('plugin_m3u') playlist = None @@ -28,6 +28,13 @@ class M3u(VPProxyPlugin): self.splitted_path=connection.path.split('/') + if self.splitted_path[1]=='m3u': + prefix='get' + elif self.splitted_path[1]=='m3ut': + prefix='mp4' + else: + connection.dieWithError(404) + if len(self.splitted_path)>3: connection.dieWithError() return @@ -61,7 +68,7 @@ class M3u(VPProxyPlugin): try: playlist=parseM3U(m3u_file) except: - connection.dieWithError() + connection.dieWithError(404) return if not playlist: @@ -76,7 +83,7 @@ class M3u(VPProxyPlugin): 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)