Config: use None
if no proxy specified
This commit is contained in:
parent
21dbc8659d
commit
1e1fe6dd16
2 changed files with 4 additions and 2 deletions
|
@ -21,7 +21,7 @@ class Config:
|
|||
)
|
||||
|
||||
# Proxy URL for yt_proxied downloader (can be used for geo-restricted content)
|
||||
self.yt_proxy = os.getenv('YT_PROXY') or 'http://127.0.0.1:1080'
|
||||
self.yt_proxy = os.getenv('YT_PROXY') or None
|
||||
|
||||
self.save_lyrics = _parse_bool(os.getenv('SAVE_LYRICS'), True)
|
||||
self.save_cover = _parse_bool(os.getenv('SAVE_COVER'), True)
|
||||
|
|
|
@ -22,7 +22,9 @@ class _CreateYDL:
|
|||
@staticmethod
|
||||
def yt_proxied() -> YoutubeDL:
|
||||
ydl = _CreateYDL.youtube()
|
||||
ydl.params['proxy'] = config.get().yt_proxy
|
||||
proxy = config.get().yt_proxy
|
||||
if proxy is not None:
|
||||
ydl.params['proxy'] = proxy
|
||||
return ydl
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Add table
Reference in a new issue