1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 11:58:47 +00: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

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

@ -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])