[videoob] Use wget instead of avconv
This commit is contained in:
parent
a02d34827d
commit
9e40e5b9df
1 changed files with 10 additions and 11 deletions
|
|
@ -97,17 +97,10 @@ class Videoob(ReplApplication):
|
||||||
if not check_exec('mimms'):
|
if not check_exec('mimms'):
|
||||||
return 1
|
return 1
|
||||||
args = ('mimms', '-r', video.url, dest)
|
args = ('mimms', '-r', video.url, dest)
|
||||||
elif video.url.endswith('m3u8'):
|
elif u'm3u8' == video.ext:
|
||||||
if not check_exec('avconv'):
|
_dest, _ = os.path.splitext(dest)
|
||||||
return 1
|
dest = u'%s.%s' % (_dest, 'mp4')
|
||||||
|
args = ('wget',) + tuple(line for line in self.read_url(video.url) if not line.startswith('#')) + ('-O', dest)
|
||||||
r = requests.get(video.url, stream=True)
|
|
||||||
buf = r.iter_lines()
|
|
||||||
r.close()
|
|
||||||
for item in buf:
|
|
||||||
pass
|
|
||||||
|
|
||||||
args = ('avconv', '-i', item, '-codec', 'copy', dest)
|
|
||||||
else:
|
else:
|
||||||
if check_exec('wget'):
|
if check_exec('wget'):
|
||||||
args = ('wget', '-c', video.url, '-O', dest)
|
args = ('wget', '-c', video.url, '-O', dest)
|
||||||
|
|
@ -118,6 +111,12 @@ class Videoob(ReplApplication):
|
||||||
|
|
||||||
os.spawnlp(os.P_WAIT, args[0], *args)
|
os.spawnlp(os.P_WAIT, args[0], *args)
|
||||||
|
|
||||||
|
def read_url(self, url):
|
||||||
|
r = requests.get(url, stream=True)
|
||||||
|
buf = r.iter_lines()
|
||||||
|
r.close()
|
||||||
|
return buf
|
||||||
|
|
||||||
def complete_download(self, text, line, *ignored):
|
def complete_download(self, text, line, *ignored):
|
||||||
args = line.split(' ')
|
args = line.split(' ')
|
||||||
if len(args) == 2:
|
if len(args) == 2:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue