def download(self,command,id):
#print command
download=subprocess.Popen(command,shell=True)
#download = subprocess.Popen('echo "hello"',shell=True)
download.wait()
#with youtube_dl.YoutubeDL() as ydl:
# ydl.download(['http://www.bilibili.com/video/av2331280?from=search&seid=831467570734192523'])
print 'download video successfully'
gif_command='ffmpeg -ss 20 -t 20 -i'+' '+str(id)+'.mp4 -s 320x240 -f gif'+' '+str(id)+'.gif'
gif=subprocess.Popen(gif_command,shell=True)
gif.wait()
print 'generate gif successfully'
cp_command='cp'+' '+str(id)+'.gif'+' /home/www/public/media'
cp = subprocess.Popen(cp_command, shell=True)
cp.wait()
print 'copy gif to media successfully'
评论列表
文章目录