Skip to content

Commit

Permalink
feat(api): allow changing host and port via env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
manbearwiz committed Dec 5, 2018
1 parent da0b64a commit 59bcfe6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions youtube-dl-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
'YDL_EXTRACT_AUDIO_QUALITY': '192',
'YDL_RECODE_VIDEO_FORMAT': None,
'YDL_OUTPUT_TEMPLATE': '/youtube-dl/%(title)s [%(id)s].%(ext)s',
'YDL_ARCHIVE_FILE': None
'YDL_ARCHIVE_FILE': None,
'YDL_SERVER_HOST': '0.0.0.0',
'YDL_SERVER_PORT': 8080,
}


Expand Down Expand Up @@ -111,6 +113,8 @@ def download(url, request_options):

print("Started download thread")

app.run(host='0.0.0.0', port=8080, debug=True)
app_vars = ChainMap(os.environ, app_defaults)

app.run(host=app_vars['YDL_SERVER_HOST'], port=app_vars['YDL_SERVER_PORT'], debug=True)
done = True
dl_thread.join()

0 comments on commit 59bcfe6

Please sign in to comment.