1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-25 02:04:06 +02:00
This commit is contained in:
kev 2015-07-13 10:31:43 +08:00
parent c6269646f1
commit 4e2c836602
2 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,8 @@ worker:
- data:/data
environment:
- PASSWORD=secret-passwd
- FORMAT=worst
- OUTTMPL=%(id)s.%(ext)s
restart: always
redis:

View File

@ -33,7 +33,9 @@ def download(url):
try:
opts = {
'format': os.getenv('FORMAT', 'best'),
'outtmpl': os.getenv('OUTTMPL', '%(title)s-%(id)s.%(ext)s'),
'progress_hooks': [hook],
'writeinfojson': True,
}
with youtube_dl.YoutubeDL(opts) as ydl:
ydl.download([url])