mirror of
https://github.com/arcan1s/ffxivbis.git
synced 2025-04-25 01:37:17 +00:00
ariyala settings
This commit is contained in:
parent
df8fa43344
commit
608854dad7
19
README.md
19
README.md
@ -84,16 +84,25 @@ Service which allows to manage savage loot distribution easy.
|
||||
* `database`: database provide name, string, required. Allowed values: `sqlite`.
|
||||
* `priority`: methods of `Player` class which will be called to sort players for loot priority, space separated list of strings, required.
|
||||
|
||||
* `web` section
|
||||
* `ariyala` section
|
||||
|
||||
Web server related settings.
|
||||
Settings related to ariyala parser.
|
||||
|
||||
* `host`: address to bind, string, required.
|
||||
* `port`: port to bind, int, required.
|
||||
* `ariyala_url`: ariyala base url, string, required.
|
||||
* `request_timeout`: xivapi request timeout, float, optional, default 30.
|
||||
* `xivapi_key`: xivapi developer key, string, optional.
|
||||
* `xivapi_url`: xivapi base url, string, required.
|
||||
|
||||
* `sqlite` section
|
||||
|
||||
Database settings for `sqlite` provider.
|
||||
|
||||
* `database_path`: path to sqlite database, string, required.
|
||||
* `migrations_path`: path to database migrations, string, required.
|
||||
* `migrations_path`: path to database migrations, string, required.
|
||||
|
||||
* `web` section
|
||||
|
||||
Web server related settings.
|
||||
|
||||
* `host`: address to bind, string, required.
|
||||
* `port`: port to bind, int, required.
|
4
package/ini/ffxivbis.ini.d/ariyala.ini
Normal file
4
package/ini/ffxivbis.ini.d/ariyala.ini
Normal file
@ -0,0 +1,4 @@
|
||||
[ariyala]
|
||||
ariyala_url = https://ffxiv.ariyala.com
|
||||
request_timeout = 1
|
||||
xivapi_url = https://xivapi.com
|
@ -20,8 +20,9 @@ class AriyalaParser:
|
||||
|
||||
def __init__(self, config: Configuration) -> None:
|
||||
self.ariyala_url = config.get('ariyala', 'ariyala_url')
|
||||
self.xivapi_key = config.get('ariyala', 'xivapi_key', fallback=None)
|
||||
self.xivapi_url = config.get('ariyala', 'xivapi_url')
|
||||
self.request_timeout = config.getfloat('ariyala', 'request_timeout')
|
||||
self.request_timeout = config.getfloat('ariyala', 'request_timeout', fallback=30)
|
||||
|
||||
def __remap_key(self, key: str) -> Optional[str]:
|
||||
if key == 'mainhand':
|
||||
@ -62,9 +63,12 @@ class AriyalaParser:
|
||||
return result
|
||||
|
||||
def get_is_tome(self, item_id: int) -> bool:
|
||||
params = {'columns': 'IsEquippable'}
|
||||
if self.xivapi_key is not None:
|
||||
params['private_key'] = self.xivapi_key
|
||||
|
||||
response = requests.get('{}/item/{}'.format(self.xivapi_url, item_id),
|
||||
params={'columns': 'IsEquippable'},
|
||||
timeout=self.request_timeout)
|
||||
params=params, timeout=self.request_timeout)
|
||||
response.raise_for_status()
|
||||
data = response.json()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user