1
0
mirror of https://github.com/azlux/botamusique synced 2024-11-23 13:56:17 +00:00

Compare commits

...

11 Commits

Author SHA1 Message Date
Terry Geng
b0ace7b67a refactor(ysearch): Use youtube-dl cookie file instead of redundant cookie config item. 2022-02-01 21:08:15 -05:00
Terry Geng
a0eb5b39c3 fix(config): Define all fallback in configuration.default.ini. 2022-02-01 21:08:15 -05:00
5b632fd88f
Merge pull request #320 from azlux/dependabot/npm_and_yarn/web/path-parse-1.0.7
build(deps): bump path-parse from 1.0.6 to 1.0.7 in /web
2022-02-02 02:09:04 +01:00
4deeb067e6
Merge pull request #318 from azlux/dependabot/npm_and_yarn/web/browserslist-4.19.1
build(deps): bump browserslist from 4.14.7 to 4.19.1 in /web
2022-02-02 01:55:10 +01:00
8918b61da5
Merge pull request #319 from azlux/dependabot/npm_and_yarn/web/glob-parent-5.1.2
build(deps): bump glob-parent from 5.1.1 to 5.1.2 in /web
2022-02-02 01:51:01 +01:00
dependabot[bot]
75c46d7a60
build(deps): bump path-parse from 1.0.6 to 1.0.7 in /web
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 00:48:38 +00:00
dependabot[bot]
14f963a65d
build(deps): bump glob-parent from 5.1.1 to 5.1.2 in /web
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 00:48:14 +00:00
dependabot[bot]
46004e4bc8
build(deps): bump browserslist from 4.14.7 to 4.19.1 in /web
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.14.7 to 4.19.1.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.14.7...4.19.1)

---
updated-dependencies:
- dependency-name: browserslist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 00:48:10 +00:00
286b96ec22
Merge pull request #317 from azlux/dependabot/npm_and_yarn/web/nanoid-3.2.0
build(deps): bump nanoid from 3.1.23 to 3.2.0 in /web
2022-02-02 01:47:01 +01:00
dependabot[bot]
ffce05c609
build(deps): bump nanoid from 3.1.23 to 3.2.0 in /web
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.23 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.23...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 00:45:35 +00:00
dd18ce1da0 Adding jpec conversion #314
using ffmpeg as thumbnails postprocessing tool
2022-02-02 01:37:25 +01:00
9 changed files with 131 additions and 98 deletions

View File

@ -624,7 +624,7 @@ def cmd_help(bot, user, text, command, parameter):
def cmd_stop(bot, user, text, command, parameter): def cmd_stop(bot, user, text, command, parameter):
global log global log
if var.config.getboolean("bot", "clear_when_stop_in_oneshot", fallback=False) \ if var.config.getboolean("bot", "clear_when_stop_in_oneshot") \
and var.playlist.mode == 'one-shot': and var.playlist.mode == 'one-shot':
cmd_clear(bot, user, text, command, parameter) cmd_clear(bot, user, text, command, parameter)
else: else:
@ -1152,7 +1152,7 @@ def cmd_shortlist(bot, user, text, command, parameter):
def cmd_delete_from_library(bot, user, text, command, parameter): def cmd_delete_from_library(bot, user, text, command, parameter):
global song_shortlist, log global song_shortlist, log
if not var.config.getboolean("bot", "delete_allowed", fallback=True): if not var.config.getboolean("bot", "delete_allowed"):
bot.mumble.users[text.actor].send_text_message(tr('not_admin')) bot.mumble.users[text.actor].send_text_message(tr('not_admin'))
return return

View File

@ -49,7 +49,7 @@ language = en_US
logfile = logfile =
max_track_duration = 60 max_track_duration = 60
max_track_playlist = 20 max_track_playlist = 20
music_database_path = music_database_path = music.db
music_folder = music_folder/ music_folder = music_folder/
pip3_path = venv/bin/pip pip3_path = venv/bin/pip
playback_mode = one-shot playback_mode = one-shot
@ -62,9 +62,8 @@ target_version = git
tmp_folder = /tmp/ tmp_folder = /tmp/
tmp_folder_max_size = 10 tmp_folder_max_size = 10
username = botamusique username = botamusique
volume = 0.1 volume = 0.8
when_nobody_in_channel = nothing when_nobody_in_channel = nothing
youtube_query_cookie =
[webinterface] [webinterface]
access_address = http://127.0.0.1:8181 access_address = http://127.0.0.1:8181
@ -84,7 +83,7 @@ web_logfile =
[debug] [debug]
ffmpeg = False ffmpeg = False
mumble_connection = False mumble_connection = False
redirect_ffmpeg_log = True redirect_ffmpeg_log = False
youtube_dl = False youtube_dl = False
[radio] [radio]

View File

@ -163,7 +163,7 @@ def requires_auth(f):
bad_access_count[request.remote_addr] += 1 bad_access_count[request.remote_addr] += 1
log.info(f"web: bad token from ip {request.remote_addr}, " log.info(f"web: bad token from ip {request.remote_addr}, "
f"{bad_access_count[request.remote_addr]} attempts.") f"{bad_access_count[request.remote_addr]} attempts.")
if bad_access_count[request.remote_addr] > var.config.getint("webinterface", "max_attempts", fallback=10): if bad_access_count[request.remote_addr] > var.config.getint("webinterface", "max_attempts"):
banned_ip.append(request.remote_addr) banned_ip.append(request.remote_addr)
log.info(f"web: access banned for {request.remote_addr}") log.info(f"web: access banned for {request.remote_addr}")
else: else:
@ -464,7 +464,7 @@ def post():
var.music_db.manage_special_tags() var.music_db.manage_special_tags()
log.info("web: Local file cache refreshed.") log.info("web: Local file cache refreshed.")
elif action == "stop": elif action == "stop":
if var.config.getboolean("bot", "clear_when_stop_in_oneshot", fallback=False) \ if var.config.getboolean("bot", "clear_when_stop_in_oneshot") \
and var.playlist.mode == 'one-shot': and var.playlist.mode == 'one-shot':
var.bot.clear() var.bot.clear()
else: else:
@ -559,12 +559,12 @@ def library_info():
time.sleep(0.1) time.sleep(0.1)
tags = var.music_db.query_all_tags() tags = var.music_db.query_all_tags()
max_upload_file_size = util.parse_file_size(var.config.get("webinterface", "max_upload_file_size", fallback="30MB")) max_upload_file_size = util.parse_file_size(var.config.get("webinterface", "max_upload_file_size"))
return jsonify(dict( return jsonify(dict(
dirs=get_all_dirs(), dirs=get_all_dirs(),
upload_enabled=var.config.getboolean("webinterface", "upload_enabled", fallback=True) or var.bot.is_admin(user), upload_enabled=var.config.getboolean("webinterface", "upload_enabled") or var.bot.is_admin(user),
delete_allowed=var.config.getboolean("bot", "delete_allowed", fallback=True) or var.bot.is_admin(user), delete_allowed=var.config.getboolean("bot", "delete_allowed") or var.bot.is_admin(user),
tags=tags, tags=tags,
max_upload_file_size=max_upload_file_size max_upload_file_size=max_upload_file_size
)) ))
@ -609,7 +609,7 @@ def library():
return redirect("./", code=302) return redirect("./", code=302)
elif payload['action'] == 'delete': elif payload['action'] == 'delete':
if var.config.getboolean("bot", "delete_allowed", fallback=True): if var.config.getboolean("bot", "delete_allowed"):
items = dicts_to_items(var.music_db.query_music(condition)) items = dicts_to_items(var.music_db.query_music(condition))
for item in items: for item in items:
var.playlist.remove_by_id(item.id) var.playlist.remove_by_id(item.id)
@ -685,7 +685,7 @@ def library():
def upload(): def upload():
global log global log
if not var.config.getboolean("webinterface", "upload_enabled", fallback=True): if not var.config.getboolean("webinterface", "upload_enabled"):
abort(403) abort(403)
file = request.files['file'] file = request.files['file']

View File

@ -396,7 +396,7 @@ class AutoPlaylist(OneshotPlaylist):
self.mode = "autoplay" self.mode = "autoplay"
def refresh(self): 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_not_sub_condition(
Condition().and_like('tags', "%don't autoplay,%"))) Condition().and_like('tags', "%don't autoplay,%")))

View File

@ -131,7 +131,7 @@ class URLItem(BaseItem):
} }
succeed = False succeed = False
with youtube_dl.YoutubeDL(ydl_opts) as ydl: 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): for i in range(attempts):
try: try:
info = ydl.extract_info(self.url, download=False) info = ydl.extract_info(self.url, download=False)
@ -167,19 +167,24 @@ class URLItem(BaseItem):
'noplaylist': True, 'noplaylist': True,
'writethumbnail': True, 'writethumbnail': True,
'updatetime': False, 'updatetime': False,
'verbose': var.config.getboolean('debug', 'youtube_dl') 'verbose': var.config.getboolean('debug', 'youtube_dl'),
'postprocessors': [{
'key': 'FFmpegThumbnailsConvertor',
'format': 'jpg',
'when': 'before_dl'
}]
} }
cookie = var.config.get('youtube_dl', 'cookie_file', fallback=None) cookie = var.config.get('youtube_dl', 'cookie_file')
if cookie: 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: if user_agent:
youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent') youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent')
with youtube_dl.YoutubeDL(ydl_opts) as ydl: 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 download_succeed = False
for i in range(attempts): for i in range(attempts):
self.log.info("bot: download attempts %d / %d" % (i + 1, attempts)) self.log.info("bot: download attempts %d / %d" % (i + 1, attempts))

View File

@ -15,16 +15,16 @@ def get_playlist_info(url, start_index=0, user=""):
'verbose': var.config.getboolean('debug', 'youtube_dl') '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: 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: if user_agent:
youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent') youtube_dl.utils.std_headers['User-Agent'] = var.config.get('youtube_dl', 'user_agent')
with youtube_dl.YoutubeDL(ydl_opts) as ydl: 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): for i in range(attempts):
items = [] items = []
try: try:

View File

@ -40,12 +40,12 @@ class MumbleBot:
signal.signal(signal.SIGINT, self.ctrl_caught) signal.signal(signal.SIGINT, self.ctrl_caught)
self.cmd_handle = {} self.cmd_handle = {}
self.stereo = var.config.getboolean('bot', 'stereo', fallback=True) self.stereo = var.config.getboolean('bot', 'stereo')
if args.channel: if args.channel:
self.channel = args.channel self.channel = args.channel
else: else:
self.channel = var.config.get("server", "channel", fallback=None) self.channel = var.config.get("server", "channel")
var.user = args.user var.user = args.user
var.is_proxified = var.config.getboolean( var.is_proxified = var.config.getboolean(
@ -137,7 +137,7 @@ class MumbleBot:
# ====== Volume ====== # ====== Volume ======
self.volume_helper = util.VolumeHelper() self.volume_helper = util.VolumeHelper()
_volume = var.config.getfloat('bot', 'volume', fallback=0.8) _volume = var.config.getfloat('bot', 'volume')
if var.db.has_option('bot', 'volume'): if var.db.has_option('bot', 'volume'):
_volume = var.db.getfloat('bot', 'volume') _volume = var.db.getfloat('bot', 'volume')
self.volume_helper.set_volume(_volume) self.volume_helper.set_volume(_volume)
@ -148,14 +148,14 @@ class MumbleBot:
self.last_volume_cycle_time = time.time() self.last_volume_cycle_time = time.time()
self._ducking_volume = 0 self._ducking_volume = 0
_ducking_volume = var.config.getfloat("bot", "ducking_volume", fallback=0.50) _ducking_volume = var.config.getfloat("bot", "ducking_volume")
_ducking_volume = var.db.getfloat("bot", "ducking_volume", fallback=_ducking_volume) _ducking_volume = var.db.getfloat("bot", "ducking_volume", fallback=_ducking_volume)
self.volume_helper.set_ducking_volume(_ducking_volume) self.volume_helper.set_ducking_volume(_ducking_volume)
self.ducking_threshold = var.config.getfloat("bot", "ducking_threshold", fallback=5000) self.ducking_threshold = var.config.getfloat("bot", "ducking_threshold")
self.ducking_threshold = var.db.getfloat("bot", "ducking_threshold", fallback=self.ducking_threshold) self.ducking_threshold = var.db.getfloat("bot", "ducking_threshold", fallback=self.ducking_threshold)
if not var.db.has_option("bot", "ducking") and var.config.getboolean("bot", "ducking", fallback=False) \ if not var.db.has_option("bot", "ducking") and var.config.getboolean("bot", "ducking") \
or var.config.getboolean("bot", "ducking"): or var.config.getboolean("bot", "ducking"):
self.is_ducking = True self.is_ducking = True
self.mumble.callbacks.set_callback(pymumble.constants.PYMUMBLE_CLBK_SOUNDRECEIVED, self.mumble.callbacks.set_callback(pymumble.constants.PYMUMBLE_CLBK_SOUNDRECEIVED,
@ -165,7 +165,7 @@ class MumbleBot:
assert var.config.get("bot", "when_nobody_in_channel") in ['pause', 'pause_resume', 'stop', 'nothing', ''], \ assert var.config.get("bot", "when_nobody_in_channel") in ['pause', 'pause_resume', 'stop', 'nothing', ''], \
"Unknown action for when_nobody_in_channel" "Unknown action for when_nobody_in_channel"
if var.config.get("bot", "when_nobody_in_channel", fallback='') in ['pause', 'pause_resume', 'stop']: if var.config.get("bot", "when_nobody_in_channel") in ['pause', 'pause_resume', 'stop']:
user_change_callback = \ user_change_callback = \
lambda user, action: threading.Thread(target=self.users_changed, lambda user, action: threading.Thread(target=self.users_changed,
args=(user, action), daemon=True).start() args=(user, action), daemon=True).start()
@ -177,7 +177,7 @@ class MumbleBot:
self._display_rms = False self._display_rms = False
self._max_rms = 0 self._max_rms = 0
self.redirect_ffmpeg_log = var.config.getboolean('debug', 'redirect_ffmpeg_log', fallback=True) self.redirect_ffmpeg_log = var.config.getboolean('debug', 'redirect_ffmpeg_log')
if var.config.getboolean("bot", "auto_check_update"): if var.config.getboolean("bot", "auto_check_update"):
def check_update(): def check_update():
@ -202,8 +202,8 @@ class MumbleBot:
self.log.info( self.log.info(
"\nSIGINT caught, quitting, {} more to kill".format(2 - self.nb_exit)) "\nSIGINT caught, quitting, {} more to kill".format(2 - self.nb_exit))
if var.config.getboolean('bot', 'save_playlist', fallback=True) \ if var.config.getboolean('bot', 'save_playlist') \
and var.config.get("bot", "save_music_library", fallback=True): and var.config.get("bot", "save_music_library"):
self.log.info("bot: save playlist into database") self.log.info("bot: save playlist into database")
var.playlist.save() var.playlist.save()
@ -235,7 +235,7 @@ class MumbleBot:
self.mumble.users.myself.comment(var.config.get('bot', 'comment')) self.mumble.users.myself.comment(var.config.get('bot', 'comment'))
def set_avatar(self): def set_avatar(self):
avatar_path = var.config.get('bot', 'avatar', fallback=None) avatar_path = var.config.get('bot', 'avatar')
if avatar_path: if avatar_path:
with open(avatar_path, 'rb') as avatar_file: with open(avatar_path, 'rb') as avatar_file:
@ -598,8 +598,8 @@ class MumbleBot:
if self.exit: if self.exit:
self._loop_status = "exited" self._loop_status = "exited"
if var.config.getboolean('bot', 'save_playlist', fallback=True) \ if var.config.getboolean('bot', 'save_playlist') \
and var.config.get("bot", "save_music_library", fallback=True): and var.config.get("bot", "save_music_library"):
self.log.info("bot: save playlist into database") self.log.info("bot: save playlist into database")
var.playlist.save() var.playlist.save()
@ -841,7 +841,7 @@ if __name__ == '__main__':
if logfile: if logfile:
print(f"Redirecting stdout and stderr to log file: {logfile}") print(f"Redirecting stdout and stderr to log file: {logfile}")
handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs handler = logging.handlers.RotatingFileHandler(logfile, mode='a', maxBytes=10240, backupCount=3) # Rotate after 10KB, leave 3 old logs
if var.config.getboolean("bot", "redirect_stderr", fallback=False): if var.config.getboolean("bot", "redirect_stderr"):
sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO, sys.stderr = util.LoggerIOWrapper(bot_logger, logging.INFO,
fallback_io_buffer=sys.stderr.buffer) fallback_io_buffer=sys.stderr.buffer)
else: else:
@ -862,13 +862,13 @@ if __name__ == '__main__':
sanitized_username = "".join([x if x.isalnum() else "_" for x in username]) sanitized_username = "".join([x if x.isalnum() else "_" for x in username])
var.settings_db_path = args.db if args.db is not None else util.solve_filepath( var.settings_db_path = args.db if args.db is not None else util.solve_filepath(
config.get("bot", "database_path", fallback="") or f"settings-{sanitized_username}.db") config.get("bot", "database_path") or f"settings-{sanitized_username}.db")
var.music_db_path = args.music_db if args.music_db is not None else util.solve_filepath( var.music_db_path = args.music_db if args.music_db is not None else util.solve_filepath(
config.get("bot", "music_database_path", fallback="") or "music.db") config.get("bot", "music_database_path"))
var.db = SettingsDatabase(var.settings_db_path) var.db = SettingsDatabase(var.settings_db_path)
if var.config.get("bot", "save_music_library", fallback=True): if var.config.get("bot", "save_music_library"):
var.music_db = MusicDatabase(var.music_db_path) var.music_db = MusicDatabase(var.music_db_path)
else: else:
var.music_db = MusicDatabase(":memory:") var.music_db = MusicDatabase(":memory:")
@ -889,7 +889,7 @@ if __name__ == '__main__':
if args.lang: if args.lang:
lang = args.lang lang = args.lang
else: else:
lang = var.config.get('bot', 'language', fallback='en_US') lang = var.config.get('bot', 'language')
if lang not in supported_languages: if lang not in supported_languages:
raise KeyError(f"Unsupported language {lang}") raise KeyError(f"Unsupported language {lang}")
@ -901,7 +901,7 @@ if __name__ == '__main__':
# ====================== # ======================
var.cache = MusicCache(var.music_db) var.cache = MusicCache(var.music_db)
if var.config.getboolean("bot", "refresh_cache_on_startup", fallback=True): if var.config.getboolean("bot", "refresh_cache_on_startup"):
var.cache.build_dir_cache() var.cache.build_dir_cache()
# ====================== # ======================
@ -911,7 +911,7 @@ if __name__ == '__main__':
if var.db.has_option("playlist", "playback_mode"): if var.db.has_option("playlist", "playback_mode"):
playback_mode = var.db.get('playlist', 'playback_mode') playback_mode = var.db.get('playlist', 'playback_mode')
else: else:
playback_mode = var.config.get('bot', 'playback_mode', fallback="one-shot") playback_mode = var.config.get('bot', 'playback_mode')
if playback_mode in ["one-shot", "repeat", "random", "autoplay"]: if playback_mode in ["one-shot", "repeat", "random", "autoplay"]:
var.playlist = media.playlist.get_playlist(playback_mode) var.playlist = media.playlist.get_playlist(playback_mode)
@ -925,7 +925,7 @@ if __name__ == '__main__':
command.register_all_commands(var.bot) command.register_all_commands(var.bot)
# load playlist # load playlist
if var.config.getboolean('bot', 'save_playlist', fallback=True): if var.config.getboolean('bot', 'save_playlist'):
var.bot_logger.info("bot: load playlist from previous session") var.bot_logger.info("bot: load playlist from previous session")
var.playlist.load() var.playlist.load()

17
util.py
View File

@ -323,7 +323,8 @@ def youtube_search(query):
import json import json
try: try:
cookie = json.loads(var.config.get('bot', 'youtube_query_cookie', fallback='{}')) cookie_file = var.config.get('youtube_dl', 'cookie_file')
cookie = parse_cookie_file(cookie_file) if cookie_file else {}
r = requests.get("https://www.youtube.com/results", cookies=cookie, r = requests.get("https://www.youtube.com/results", cookies=cookie,
params={'search_query': query}, timeout=5) params={'search_query': query}, timeout=5)
result_json_match = re.findall(r">var ytInitialData = (.*?);</script>", r.text) result_json_match = re.findall(r">var ytInitialData = (.*?);</script>", r.text)
@ -573,4 +574,16 @@ def check_extra_config(config, template):
if not template.has_option(key, opt): if not template.has_option(key, opt):
extra.append((key, opt)) extra.append((key, opt))
return extra return extra
def parse_cookie_file(cookiefile):
# https://stackoverflow.com/a/54659484/1584825
cookies = {}
with open (cookiefile, 'r') as fp:
for line in fp:
if not re.match(r'^#', line):
lineFields = line.strip().split('\t')
cookies[lineFields[5]] = lineFields[6]
return cookies

118
web/package-lock.json generated
View File

@ -1987,16 +1987,16 @@
} }
}, },
"node_modules/browserslist": { "node_modules/browserslist": {
"version": "4.14.7", "version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"caniuse-lite": "^1.0.30001157", "caniuse-lite": "^1.0.30001286",
"colorette": "^1.2.1", "electron-to-chromium": "^1.4.17",
"electron-to-chromium": "^1.3.591",
"escalade": "^3.1.1", "escalade": "^3.1.1",
"node-releases": "^1.1.66" "node-releases": "^2.0.1",
"picocolors": "^1.0.0"
}, },
"bin": { "bin": {
"browserslist": "cli.js" "browserslist": "cli.js"
@ -2060,10 +2060,14 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001161", "version": "1.0.30001304",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001161.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz",
"integrity": "sha512-JharrCDxOqPLBULF9/SPa6yMcBRTjZARJ6sc3cuKrPfyIk64JN6kuMINWqA99Xc8uElMFcROliwtz0n9pYej+g==", "integrity": "sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ==",
"dev": true "dev": true,
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
}, },
"node_modules/chalk": { "node_modules/chalk": {
"version": "2.4.2", "version": "2.4.2",
@ -2511,9 +2515,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.3.607", "version": "1.4.60",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.607.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.60.tgz",
"integrity": "sha512-h2SYNaBnlplGS0YyXl8oJWokfcNxVjJANQfMCsQefG6OSuAuNIeW+A8yGT/ci+xRoBb3k2zq1FrOvkgoKBol8g==", "integrity": "sha512-h53hbEiKC6hijelDgxgkgAUC3PKyR7TmIfvjHnBjUGPMg/3sBuTyG6eDormw+lY24uUJvHkUPzB8dpK8b2u3Sw==",
"dev": true "dev": true
}, },
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
@ -3405,9 +3409,9 @@
} }
}, },
"node_modules/glob-parent": { "node_modules/glob-parent": {
"version": "5.1.1", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"is-glob": "^4.0.1" "is-glob": "^4.0.1"
@ -4300,9 +4304,9 @@
"dev": true "dev": true
}, },
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "3.1.23", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
"dev": true, "dev": true,
"bin": { "bin": {
"nanoid": "bin/nanoid.cjs" "nanoid": "bin/nanoid.cjs"
@ -4334,9 +4338,9 @@
} }
}, },
"node_modules/node-releases": { "node_modules/node-releases": {
"version": "1.1.67", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true "dev": true
}, },
"node_modules/normalize-package-data": { "node_modules/normalize-package-data": {
@ -4668,9 +4672,9 @@
} }
}, },
"node_modules/path-parse": { "node_modules/path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"node_modules/path-type": { "node_modules/path-type": {
@ -4682,6 +4686,12 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"node_modules/picomatch": { "node_modules/picomatch": {
"version": "2.2.2", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
@ -7983,16 +7993,16 @@
} }
}, },
"browserslist": { "browserslist": {
"version": "4.14.7", "version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.7.tgz", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-BSVRLCeG3Xt/j/1cCGj1019Wbty0H+Yvu2AOuZSuoaUWn3RatbL33Cxk+Q4jRMRAbOm0p7SLravLjpnT6s0vzQ==", "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"dev": true, "dev": true,
"requires": { "requires": {
"caniuse-lite": "^1.0.30001157", "caniuse-lite": "^1.0.30001286",
"colorette": "^1.2.1", "electron-to-chromium": "^1.4.17",
"electron-to-chromium": "^1.3.591",
"escalade": "^3.1.1", "escalade": "^3.1.1",
"node-releases": "^1.1.66" "node-releases": "^2.0.1",
"picocolors": "^1.0.0"
} }
}, },
"buffer-from": { "buffer-from": {
@ -8034,9 +8044,9 @@
"dev": true "dev": true
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001161", "version": "1.0.30001304",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001161.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001304.tgz",
"integrity": "sha512-JharrCDxOqPLBULF9/SPa6yMcBRTjZARJ6sc3cuKrPfyIk64JN6kuMINWqA99Xc8uElMFcROliwtz0n9pYej+g==", "integrity": "sha512-bdsfZd6K6ap87AGqSHJP/s1V+U6Z5lyrcbBu3ovbCCf8cSYpwTtGrCBObMpJqwxfTbLW6YTIdbb1jEeTelcpYQ==",
"dev": true "dev": true
}, },
"chalk": { "chalk": {
@ -8388,9 +8398,9 @@
} }
}, },
"electron-to-chromium": { "electron-to-chromium": {
"version": "1.3.607", "version": "1.4.60",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.607.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.60.tgz",
"integrity": "sha512-h2SYNaBnlplGS0YyXl8oJWokfcNxVjJANQfMCsQefG6OSuAuNIeW+A8yGT/ci+xRoBb3k2zq1FrOvkgoKBol8g==", "integrity": "sha512-h53hbEiKC6hijelDgxgkgAUC3PKyR7TmIfvjHnBjUGPMg/3sBuTyG6eDormw+lY24uUJvHkUPzB8dpK8b2u3Sw==",
"dev": true "dev": true
}, },
"emoji-regex": { "emoji-regex": {
@ -9074,9 +9084,9 @@
} }
}, },
"glob-parent": { "glob-parent": {
"version": "5.1.1", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true, "dev": true,
"requires": { "requires": {
"is-glob": "^4.0.1" "is-glob": "^4.0.1"
@ -9744,9 +9754,9 @@
"dev": true "dev": true
}, },
"nanoid": { "nanoid": {
"version": "3.1.23", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz",
"integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==", "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==",
"dev": true "dev": true
}, },
"natural-compare": { "natural-compare": {
@ -9772,9 +9782,9 @@
} }
}, },
"node-releases": { "node-releases": {
"version": "1.1.67", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.67.tgz", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz",
"integrity": "sha512-V5QF9noGFl3EymEwUYzO+3NTDpGfQB4ve6Qfnzf3UNydMhjQRVPR1DZTuvWiLzaFJYw2fmDwAfnRNEVb64hSIg==", "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==",
"dev": true "dev": true
}, },
"normalize-package-data": { "normalize-package-data": {
@ -10029,9 +10039,9 @@
"dev": true "dev": true
}, },
"path-parse": { "path-parse": {
"version": "1.0.6", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
"dev": true "dev": true
}, },
"path-type": { "path-type": {
@ -10040,6 +10050,12 @@
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true "dev": true
}, },
"picocolors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
"integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
"dev": true
},
"picomatch": { "picomatch": {
"version": "2.2.2", "version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",