From 93f45badbf04b1bf9c2e78803e0633f495ed714d Mon Sep 17 00:00:00 2001 From: Ritiek Malhotra Date: Thu, 3 Aug 2017 10:27:24 +0000 Subject: [PATCH] Download ffmpeg binary instead of compiling --- test/ffmeg_bin.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/ffmeg_bin.py diff --git a/test/ffmeg_bin.py b/test/ffmeg_bin.py new file mode 100644 index 0000000..f5daab3 --- /dev/null +++ b/test/ffmeg_bin.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +from bs4 import BeautifulSoup +import requests +import os +import sys + +file_id = sys.argv[1] +home = os.path.expanduser("~") +ffmpeg_bin_path = os.path.join(home, 'bin', 'ffmpeg') + +response = requests.get('http://s000.tinyupload.com/?file_id=' + file_id) +soup = BeautifulSoup(response.text, 'html.parser') + +for x in soup.find_all('a'): + if x['href'].startswith('download.php'): + full_link = 'http://s000.tinyupload.com/' + x['href'] + print(full_link) + ffmpeg_bin = requests.get(full_link, stream=True) + with open(ffmpeg_bin_path, 'wb') as handle: + for block in ffmpeg_bin.iter_content(1024): + handle.write(block)