fix(config): Define all fallback in configuration.default.ini.
This commit is contained in:
@ -396,7 +396,7 @@ class AutoPlaylist(OneshotPlaylist):
|
||||
self.mode = "autoplay"
|
||||
|
||||
def refresh(self):
|
||||
dicts = var.music_db.query_random_music(var.config.getint("bot", "autoplay_length", fallback=5),
|
||||
dicts = var.music_db.query_random_music(var.config.getint("bot", "autoplay_length"),
|
||||
Condition().and_not_sub_condition(
|
||||
Condition().and_like('tags', "%don't autoplay,%")))
|
||||
|
||||
|
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))
|
||||
|
@ -15,16 +15,16 @@ def get_playlist_info(url, start_index=0, user=""):
|
||||
'verbose': var.config.getboolean('debug', 'youtube_dl')
|
||||
}
|
||||
|
||||
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')
|
||||
for i in range(attempts):
|
||||
items = []
|
||||
try:
|
||||
|
Reference in New Issue
Block a user