Allow to download in a folder with generated filename
This commit is contained in:
parent
ba8991e625
commit
d2a1985e87
1 changed files with 9 additions and 3 deletions
|
|
@ -106,11 +106,17 @@ class Videoob(ReplApplication):
|
|||
return False
|
||||
return True
|
||||
|
||||
if dest is None:
|
||||
ext = video.ext
|
||||
def video_to_file(_video):
|
||||
ext = _video.ext
|
||||
if not ext:
|
||||
ext = 'avi'
|
||||
dest = '%s.%s' % (re.sub('[?:/]', '-', video.id), ext)
|
||||
return '%s.%s' % (re.sub('[?:/]', '-', _video.id), ext)
|
||||
|
||||
if dest is not None and os.path.isdir(dest):
|
||||
dest += '/%s' % video_to_file(video)
|
||||
|
||||
if dest is None:
|
||||
dest = video_to_file(video)
|
||||
|
||||
if video.url.startswith('rtmp'):
|
||||
if not check_exec('rtmpdump'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue