Skip to content

Commit

Permalink
Merge pull request #40 from jbalcorn/apikey
Browse files Browse the repository at this point in the history
Fix the API Key issue
  • Loading branch information
mmmmmtasty authored Jan 29, 2022
2 parents 163d4ac + 0f49b4d commit 74d442c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions SportScanner.bundle/Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,21 @@
import certifi
import requests
import ConfigParser
import base64

try:
import thesportsdb
except ImportError:
sportsdb = ''
try:
sportsdb = ''.join(map(str,[chr(ord(a) ^ ord(b)) for a,b in zip (base64.b64decode(thesportsdb.sportsdbkey1),base64.b64decode(thesportsdb.sportsdbkey2))]))
except AttributeError:
sportsdb = ''

config = ConfigParser.SafeConfigParser()
config.add_section('thesportsdb.com')
config.set('thesportsdb.com','apikey','8123456712556')
configread = config.read('SportsScanner.ini')
config.set('thesportsdb.com','apikey',sportsdb)
_ = config.read('SportsScanner.ini')

netLock = Thread.Lock()

Expand Down Expand Up @@ -236,7 +246,7 @@ def UpdateEpisodes():
episode_media = media.seasons[s].episodes[e]

@task
def UpdateEpisode(episode=episode, league_metadata=league_metadata, episode_media=episode_media, metadata=metadata):
def UpdateEpisode(e=e, episode=episode, league_metadata=league_metadata, episode_media=episode_media, metadata=metadata):
Log("SS: Matching episode number {0}: {1}".format(e, episode_media.title))
matched_episode = None
# First try and match the filename exactly as it is
Expand Down
3 changes: 3 additions & 0 deletions SportScanner.bundle/Contents/Code/thesportsdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sportsdbkey1 = 'AAsAAQIFBQ=='
sportsdbkey2 = 'MTIzNDU2Nw=='

0 comments on commit 74d442c

Please sign in to comment.