1
0

Misc
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 35s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 30s

This commit is contained in:
Jon Michael Aanes 2025-02-26 00:12:37 +01:00
parent 1da1258432
commit 78a5af6ff9
5 changed files with 7 additions and 9 deletions

View File

@ -73,7 +73,7 @@ class PsnProfiles(Scraper):
def _scrape_games_overview(self) -> Iterator[dict]:
for page_num in range(1, 1000):
logger.info('Getting Overview (page %d)', page_num)
url = URL_GAMES_OVERVIEW.format(psn_id=secrets.PLAYSTATION_PSN_ID)
url = URL_GAMES_OVERVIEW.format(psn_id=secrets.playstation_psn_id())
response = self.session.get(url, params={'page': page_num})
if 'page' not in response.url:
msg = "Configuration error? psnprofiles.com made an redirection. This is possibly because your profile name wasn't exactly as expected. Please check it"
@ -157,7 +157,7 @@ class PsnProfiles(Scraper):
logger.info('Getting Game Trophies %s', psnprofiles_id)
url = URL_USER_GAME_TROPHIES.format(
psn_id=secrets.PLAYSTATION_PSN_ID,
psn_id=secrets.playstation_psn_id(),
game_id=psnprofiles_id,
)
response = self.session.get(url, expire_after=cache_duration)

View File

@ -27,14 +27,11 @@ class Stepmania(Scraper):
'Europe/Copenhagen',
) # TODO: Parameterize in an intelligent manner
print(STATS_FILE_PATH)
with open(STATS_FILE_PATH) as f:
soup = bs4.BeautifulSoup(f.read(), 'lxml-xml')
# Derp
for score in soup.select('SongScores Song HighScoreList HighScore'):
print(score.parent.parent)
song = score.parent.parent.parent
song_path = Path(song ['Dir'].removesuffix('/'))

View File

@ -15,12 +15,12 @@ try:
import cfscrape
except ImportError:
cfscrape = None
logger.warning('cfscrape not installed: Certain fetchers might not work')
logger.exception('cfscrape not installed: Certain fetchers might not work')
try:
import browsercookie
except ImportError:
logger.warning('browsercookie not installed: Certain fetchers might not work')
logger.exception('browsercookie not installed: Certain fetchers might not work')
browsercookie = None

View File

@ -11,7 +11,8 @@ CRUNCHYROLL_AUTH = secrets.load('CRUNCHYROLL_AUTH')
FFXIV_CHARACTER_ID = secrets.load('FFXIV_CHARACTER_ID')
# Playstation
PLAYSTATION_PSN_ID = secrets.load('PLAYSTATION_PSN_ID')
def playstation_psn_id():
return secrets.load_or_fail('PLAYSTATION_PSN_ID')
# Partisia Blockchain

View File

@ -3,7 +3,7 @@ lxml
requests
requests_cache
browsercookie
cfscrape
cfscrape @ git+https://github.com/landryraccoon/cloudflare-scrape.git
frozendict
python-kucoin
krakenex