Use tinydownload to download ffmpeg binary

This commit is contained in:
ritiek
2017-08-12 19:33:38 +05:30
parent 7e0fdfbce3
commit 0178307b20
2 changed files with 2 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ install:
- sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo wget zlib1g-dev
- sudo apt-get -y install yasm nasm libmp3lame-dev
- pip install -r requirements.txt
- python test/ffmpeg_bin.py 05861434675432854607
- pip install tinydownload
- tinydownload 05861434675432854607 -o ~/bin/ffmpeg
- chmod 755 ~/bin/ffmpeg
script: python -m pytest test

View File

@@ -1,22 +0,0 @@
#!/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)