projects
/
vpproxy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
WebM transcoding added
[vpproxy.git]
/
plugins
/
m3u_plugin.py
diff --git
a/plugins/m3u_plugin.py
b/plugins/m3u_plugin.py
index 4104e43240ea63e8d6e81fc5b8332d2834e66850..2263dfe930007cbe2bcfe58fbf3121fba8362c98 100644
(file)
--- a/
plugins/m3u_plugin.py
+++ b/
plugins/m3u_plugin.py
@@
-17,7
+17,7
@@
import os
class M3u(VPProxyPlugin):
class M3u(VPProxyPlugin):
- handlers = ('m3u', )
+ handlers = ('m3u',
'm3ut'
)
logger = logging.getLogger('plugin_m3u')
playlist = None
logger = logging.getLogger('plugin_m3u')
playlist = None
@@
-28,6
+28,15
@@
class M3u(VPProxyPlugin):
self.splitted_path=connection.path.split('/')
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
if len(self.splitted_path)>3:
connection.dieWithError()
return
@@
-61,7
+70,7
@@
class M3u(VPProxyPlugin):
try:
playlist=parseM3U(m3u_file)
except:
try:
playlist=parseM3U(m3u_file)
except:
- connection.dieWithError()
+ connection.dieWithError(
404
)
return
if not playlist:
return
if not playlist:
@@
-76,7
+85,7
@@
class M3u(VPProxyPlugin):
channel['url']=record.path.decode('utf-8')
playlistgen.addItem(channel)
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)
exported = exported.encode('utf-8')
connection.wfile.write(exported)