Skip to content

Instantly share code, notes, and snippets.

@taonico
Created July 29, 2012 12:39
Show Gist options
  • Save taonico/3198466 to your computer and use it in GitHub Desktop.
Save taonico/3198466 to your computer and use it in GitHub Desktop.
NicoRtmpdumpParameter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
class NicoRtmpdumpParameter:
def __init__(self, filename, rtmp_url, stream_id, ticket, contents):
self.filename = filename
self.rtmp_url = rtmp_url
self.stream_id = stream_id
self.ticket = ticket
self.contents = contents
def get_o(self):
if self.filename == "":
return " "
else:
return " -o " + self.filename
def get_vr(self, rtmp_url, stream_id):
return " -vr " + rtmp_url + "/" + stream_id
def get_C(self, rtmp_ticket):
return " -C S:" + rtmp_ticket
def get_N(self, stream_contents_list_contents_contents):
return " -N " + stream_contents_list_contents_contents[5:]
def getNicoRtmpdumpParameter(self):
return self.get_vr(self.rtmp_url, self.stream_id) + self.get_C(self.ticket) + self.get_N(self.contents) + self.get_o()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment