use correct config fields for amazon api

This commit is contained in:
2019-02-20 11:24:01 +01:00
parent dbc60d2e30
commit 12c02eed22

View File

@@ -15,18 +15,18 @@ from mumo_module import (commaSeperatedIntegers,
# YT
youtube_api_url = "https://www.googleapis.com/youtube/v3/videos?part=contentDetails%2Csnippet%2Cstatistics&id={0}&fields=items(contentDetails(definition%2Cduration)%2Clocalizations%2Csnippet%2Ftitle%2Cstatistics)%2CpageInfo%2FtotalResults&key={1}"
youtube_regex = re.compile(
"(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?([^&=%\?]{11})")
r"(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?.*v=|embed/|v/|.+\?v=)?([^&=%\?]{11})")
# STEAM
steam_regex = re.compile("(http|https)://store.steampowered.com/app/([0-9]+)[/\[]?")
steam_regex = re.compile(r"(http|https)://store.steampowered.com/app/([0-9]+)[/\[]?")
steam_genre_regex = re.compile("Genre:</b>.*?<a.*?>(.+?)</a>")
# AMAZON
amazon_regex = re.compile("ama?zo?n\.(?:de|com)/.*(?:dp|gp/product)/([A-Z0-9]{10})(?:(?:/+)|$)?")
amazon_regex = re.compile(r"ama?zo?n\.(?:de|com)/.*(?:dp|gp/product)/([A-Z0-9]{10})(?:(?:/+)|$)?")
# Commands
move_regex = re.compile("^moveall (.*)$")
tsp_cmd_regex = re.compile("^!(.+?)(?: (.+?))?(?: (.*))?$")
move_regex = re.compile(r"^moveall (.*)$")
tsp_cmd_regex = re.compile(r"^!(.+?)(?: (.+?))?(?: (.*))?$")
# Stuff
headers = {
@@ -50,8 +50,8 @@ class chatparser(MumoModule):
self.murmur = manager.getMurmurModule()
self.youtube_api_key = self.cfg().chatparser.youtube_api_key
self.amazon_access_key = self.cfg().chatparser.amazon_access_key
self.amazon_secret_key = self.cfg().chatparser.youtube_api_key
self.amazon_assoc_tag = self.cfg().chatparser.youtube_api_key
self.amazon_secret_key = self.cfg().chatparser.amazon_secret_key
self.amazon_assoc_tag = self.cfg().chatparser.amazon_assoc_tag
self.amazon_region = self.cfg().chatparser.amazon_region
self.amazon_api = AmazonAPI(self.amazon_access_key, self.amazon_secret_key,