fix(config): Define all fallback in configuration.default.ini.
This commit is contained in:
10
media/url.py
10
media/url.py
@ -131,7 +131,7 @@ class URLItem(BaseItem):
|
||||
}
|
||||
succeed = False
|
||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||
attempts = var.config.getint('bot', 'download_attempts', fallback=2)
|
||||
attempts = var.config.getint('bot', 'download_attempts')
|
||||
for i in range(attempts):
|
||||
try:
|
||||
info = ydl.extract_info(self.url, download=False)
|
||||
@ -175,16 +175,16 @@ class URLItem(BaseItem):
|
||||
}]
|
||||
}
|
||||
|
||||
cookie = var.config.get('youtube_dl', 'cookie_file', fallback=None)
|
||||
cookie = var.config.get('youtube_dl', 'cookie_file')
|
||||
if cookie:
|
||||
ydl_opts['cookiefile'] = var.config.get('youtube_dl', 'cookie_file', fallback=None)
|
||||
ydl_opts['cookiefile'] = var.config.get('youtube_dl', 'cookie_file')
|
||||
|
||||
user_agent = var.config.get('youtube_dl', 'user_agent', fallback=None)
|
||||
user_agent = var.config.get('youtube_dl', 'user_agent')
|
||||
if user_agent:
|
||||
youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent')
|
||||
|
||||
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
|
||||
attempts = var.config.getint('bot', 'download_attempts', fallback=2)
|
||||
attempts = var.config.getint('bot', 'download_attempts')
|
||||
download_succeed = False
|
||||
for i in range(attempts):
|
||||
self.log.info("bot: download attempts %d / %d" % (i + 1, attempts))
|
||||
|
Reference in New Issue
Block a user