MCPcopy
hub / github.com/pyload/pyload / find

Method find

module/plugins/hoster/YoutubeCom.py:96–126  ·  view source on GitHub ↗

Check for ffmpeg

(cls)

Source from the content-addressed store, hash-verified

94
95 @classmethod
96 def find(cls):
97 """
98 Check for ffmpeg
99 """
100 if cls.CMD is not None:
101 return True
102
103 try:
104 if os.name == "nt":
105 ffmpeg = os.path.join(pypath, "ffmpeg.exe") if isexecutable(os.path.join(pypath, "ffmpeg.exe")) \
106 else "ffmpeg.exe"
107
108 else:
109 ffmpeg = "ffmpeg"
110
111 cmd = which(ffmpeg) or ffmpeg
112
113 p = Popen([cmd, "-version"],
114 stdout=subprocess.PIPE,
115 stderr=subprocess.PIPE)
116 out, err = (_r.strip() if _r else "" for _r in p.communicate())
117 except OSError:
118 return False
119
120 m = cls._RE_VERSION.search(out)
121 if m is not None:
122 cls.VERSION = m.group(1)
123
124 cls.CMD = cmd
125
126 return True
127
128 @property
129 def found(self):

Callers 6

__init__Method · 0.95
processMethod · 0.45
_parse_irc_msgMethod · 0.45
whitelistMethod · 0.45
blacklistMethod · 0.45
activateMethod · 0.45

Calls 6

isexecutableFunction · 0.85
whichFunction · 0.85
PopenClass · 0.85
joinMethod · 0.80
communicateMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected