1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-26 00:38:37 +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 - data:/data
environment: environment:
- PASSWORD=secret-passwd - PASSWORD=secret-passwd
- FORMAT=worst
- OUTTMPL=%(id)s.%(ext)s
restart: always restart: always
redis: redis:

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