[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'):
|
||||
return 1
|
||||
args = ('mimms', '-r', video.url, dest)
|
||||
elif video.url.endswith('m3u8'):
|
||||
if not check_exec('avconv'):
|
||||
return 1
|
||||
|
||||
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)
|
||||
elif u'm3u8' == video.ext:
|
||||
_dest, _ = os.path.splitext(dest)
|
||||
dest = u'%s.%s' % (_dest, 'mp4')
|
||||
args = ('wget',) + tuple(line for line in self.read_url(video.url) if not line.startswith('#')) + ('-O', dest)
|
||||
else:
|
||||
if check_exec('wget'):
|
||||
args = ('wget', '-c', video.url, '-O', dest)
|
||||
|
|
@ -118,6 +111,12 @@ class Videoob(ReplApplication):
|
|||
|
||||
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):
|
||||
args = line.split(' ')
|
||||
if len(args) == 2:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue