Exemplo n.º 1
0
 def stop(self):
     if self.subsfile is not None and os.path.exists(self.subsfile):
         try:
             os.remove(self.subsfile)
         except Exception:
             pass
     ExternalProcess.stop(self)
Exemplo n.º 2
0
 def stop(self):
   if self.subsfile is not None and os.path.exists(self.subsfile):
     try:
       os.remove(self.subsfile)
     except Exception:
       pass
   ExternalProcess.stop(self)
Exemplo n.º 3
0
    def start(self, args):
        self.cmd = OMX_CMD
        if 'subtitles' in args:
            self.cmd = self.cmd + "--align center --subtitles '" + args[
                'subtitles'] + "' "
        fname = args['outfile']
        #if fname.startswith('http'):
        #  self.cmd = self.cmd + "'" + fname + "'"
        if not self._wait_input(fname):
            self._set_error("Omxplayer timed out waiting for input file")
            self.msg_halted()
            return
        else:
            pid = args['pid']
            tail = "tail -f --pid=" + str(
                pid) + " --bytes=+0 \"" + fname + "\""
            #self.cmd = tail + ' | ' + self.cmd + 'pipe:0'
            self.cmd = tail + ' | ' + 'omxplayer --hw --timeout 60s -o both --no-keys pipe:0 '
            # Wait a bit for input
            cherrypy.log("OMXPROCESS: " + self.cmd)
            #print "self.cmd => " + self.cmd
            #f = open("/tmp/demofile3.txt", "w")
            #f.write(self.cmd)
            #f.close()
            time.sleep(10)

        ExternalProcess.start(self, args)
Exemplo n.º 4
0
 def stop(self):
     if os.path.exists(_CMD_FIFO):
         try:
             os.remove(_CMD_FIFO)
         except Exception:
             pass
     ExternalProcess.stop(self)
Exemplo n.º 5
0
 def stop(self):
   if os.path.exists(_CMD_FIFO):
     try:
       os.remove(_CMD_FIFO)
     except Exception:
       pass
   ExternalProcess.stop(self)
Exemplo n.º 6
0
 def __init__(self, url, quality='best'):
     ExternalProcess.__init__(self)
     cmd = [
         'livestreamer', url, quality, '--http-header',
         'Client-ID=tq6hq1srip0i37ipzuscegt7viex9fh', '--output', OUT_FILE,
         '--player-fifo'
     ]
     self.cmd = cmd
Exemplo n.º 7
0
 def __init__(self, url, quality='best'):
   ExternalProcess.__init__(self)
   cmd = [
     'livestreamer',
     url,
     quality,
     '--output',
     OUT_FILE,
     '--player-fifo'
   ]
   self.cmd = cmd 
Exemplo n.º 8
0
 def __init__(self, url, quality='best'):
   ExternalProcess.__init__(self)
   cmd = [
     'livestreamer',
     url,
     quality,
     '--http-header',
     'Client-ID=tq6hq1srip0i37ipzuscegt7viex9fh',
     '--output',
     OUT_FILE,
     '--player-fifo'
   ]
   self.cmd = cmd 
Exemplo n.º 9
0
 def __init__(self, torrent, idx):
     ExternalProcess.__init__(self)
     cmd = ["node", "--max-old-space-size=128", "/usr/local/bin/peerflix"]
     # Avoid problems with downloading torrent files
     torrent = chanutils.torrent.torrent2magnet(torrent)
     cmd.append(torrent)
     cmd.append("-q")
     cmd.append("-r")
     cmd.append("-p")
     cmd.append(_PEERFLIX_PORT)
     if idx is not None and idx >= 0:
         cmd.append("-i")
         cmd.append(str(idx))
     self.cmd = cmd
Exemplo n.º 10
0
 def __init__(self, torrent, idx):
   ExternalProcess.__init__(self)
   cmd = ["node", "--max-old-space-size=128",
           "/usr/local/bin/peerflix"]
   # Avoid problems with downloading torrent files
   torrent = chanutils.torrent.torrent2magnet(torrent)
   cmd.append(torrent)
   cmd.append("-q")
   cmd.append("-r")
   cmd.append("-p")
   cmd.append(_PEERFLIX_PORT)
   if idx is not None and idx >= 0:
     cmd.append("-i")
     cmd.append(str(idx))
   self.cmd = cmd 
Exemplo n.º 11
0
  def start(self, args):
    self.cmd = OMX_CMD
    if 'subtitles' in args:
      self.cmd = self.cmd + "--align center --subtitles '" + args['subtitles'] + "' "
    fname = args['outfile']
    if fname.startswith('http'):
      self.cmd = self.cmd + "'" + fname + "'"
    elif not self._wait_input(fname):
        self._set_error("Omxplayer timed out waiting for input file")
        self.msg_halted()
        return
    else:
      pid = args['pid']
      tail = "tail -f --pid=" + str(pid) + " --bytes=+0 \"" + fname + "\""
      self.cmd = tail + ' | ' + self.cmd + 'pipe:0'
      # Wait a bit for input
      time.sleep(5)

    ExternalProcess.start(self, args)
Exemplo n.º 12
0
  def start(self, args):
    self.cmd = OMX_CMD
    if 'subtitles' in args:
      self.cmd = self.cmd + "--align center --subtitles '" + args['subtitles'] + "' "
    fname = args['outfile']
    if fname.startswith('http'):
      self.cmd = self.cmd + "'" + fname + "'"
    elif not self._wait_input(fname):
        self._set_error("Omxplayer timed out waiting for input file")
        self.msg_halted()
        return
    else:
      pid = args['pid']
      tail = "tail -f --pid=" + str(pid) + " --bytes=+0 \"" + fname + "\""
      self.cmd = tail + ' | ' + self.cmd + 'pipe:0'
      # Wait a bit for input
      time.sleep(5)

    ExternalProcess.start(self, args)
Exemplo n.º 13
0
 def stop(self):
   try:
     shutil.rmtree('/tmp/torrent-stream')
   except Exception:
     pass
   ExternalProcess.stop(self)
Exemplo n.º 14
0
 def __init__(self):
     ExternalProcess.__init__(self, True)
Exemplo n.º 15
0
 def start(self, args):
     if not os.path.exists(_CMD_FIFO):
         os.system("mkfifo " + _CMD_FIFO)
     ExternalProcess.start(self, args)
Exemplo n.º 16
0
 def __init__(self, url):
   ExternalProcess.__init__(self)
   self.url = url
Exemplo n.º 17
0
 def __init__(self, url):
   ExternalProcess.__init__(self)
   self.url = url
Exemplo n.º 18
0
 def stop(self):
     try:
         shutil.rmtree('/tmp/torrent-stream')
     except Exception:
         pass
     ExternalProcess.stop(self)
Exemplo n.º 19
0
 def __init__(self, message):
     ExternalProcess.__init__(self)
     cmd = ['notify-send', '--expire-time', '10000', message]
     self.cmd = cmd
Exemplo n.º 20
0
 def start(self, args):
   if not os.path.exists(_CMD_FIFO):
     os.system("mkfifo " + _CMD_FIFO)     
   ExternalProcess.start(self, args)
Exemplo n.º 21
0
 def __init__(self, url, quality='best'):
     ExternalProcess.__init__(self)
     cmd = [
         'livestreamer', url, quality, '--output', OUT_FILE, '--player-fifo'
     ]
     self.cmd = cmd
Exemplo n.º 22
0
 def __init__(self, subs):
   ExternalProcess.__init__(self)
   self.subs = subs
   self.subsfile = None
Exemplo n.º 23
0
 def __init__(self):
   ExternalProcess.__init__(self, True)
Exemplo n.º 24
0
 def __init__(self, cmd):
   ExternalProcess.__init__(self)
   cmd.insert(0, 'rtmpdump')
   cmd.append('-o')
   cmd.append(OUT_FILE)
   self.cmd = cmd
Exemplo n.º 25
0
 def __init__(self, subs):
     ExternalProcess.__init__(self)
     self.subs = subs
     self.subsfile = None