Skip to content

fix HLTB integration#9

Open
innateessence wants to merge 6 commits into
maroun2:mainfrom
innateessence:main
Open

fix HLTB integration#9
innateessence wants to merge 6 commits into
maroun2:mainfrom
innateessence:main

Conversation

@innateessence

@innateessence innateessence commented Jul 4, 2026

Copy link
Copy Markdown
  • Fixes HLTB API integration
  • Provides an end-to-end test to easily verify if HLTB integration is broken/failing

Copilot AI review requested due to automatic review settings July 4, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the backend HowLongToBeat (HLTB) integration to use the newer /api/bleed auth/search flow and adds a runnable end-to-end verification script intended to detect when the integration breaks.

Changes:

  • Switched HLTB initialization and search requests from the old finder endpoint to /api/bleed/init + /api/bleed, including dynamic auth fields.
  • Added response decompression handling for gzip responses.
  • Added a networked end-to-end HLTB verification script under tests/ to validate real-world behavior.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
tests/test_hltb_service.py Adds an end-to-end network verification script for the HLTB integration.
py_modules/hltb_service.py Updates the HLTB request/auth flow to the /api/bleed endpoints and adjusts headers/payload/response handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +7

import asyncio
Comment on lines +22 to +24
# Inject the mock decky module into sys.modules before importing hltb_service
import sys
sys.modules['decky'] = mock_decky
Comment thread py_modules/hltb_service.py Outdated
Comment on lines +33 to +35
# Cookie from get-auth example (contains session tokens)
self.base_cookie = "OptanonConsent=isGpcEnabled=1&datestamp=Sat+Jul+04+2026+15%3A29%3A08+GMT-0700+(Pacific+Daylight+Time)&version=202604.2.0&consentId=0811192f-59da-4c3c-aef1-8e5208f252f8&GPPCookiesCount=1&groups=C0001%3A1%2CC0002%3A1%2COSSTA_BG%3A0%2CC0004%3A0&crTime=1783204148972&genVendors=&landingPath=NotLandingPage; OTGPPConsent=DBABLA~BVQVAAAAAACA.YA; usprivacy=1YYY; opt_out=1; zd_core_lialready=true; OptanonAlertBoxClosed=2026-07-04T22:29:08.641Z"

Comment thread py_modules/hltb_service.py Outdated
Comment on lines 141 to 143
"Prefer": "safe",
"Accept-Encoding": "gzip, deflate",
"Referer": f"{self.base_url}/",
Comment thread py_modules/hltb_service.py Outdated
Comment on lines +73 to +75
if auth_token and hp_key and hp_val:
logger.info(f"Got fresh HLTB auth data (key: {hp_key})")
return {
@innateessence

innateessence commented Jul 4, 2026

Copy link
Copy Markdown
Author

vibe coded this with qwen-coder-latest, didn't realize it had a hard-coded cookie, WIP

@innateessence

innateessence commented Jul 5, 2026

Copy link
Copy Markdown
Author

I think I'm done with this PR unless you want me to refactor/refine by hand or you feel something is missing

I'd love if it you would merge it and push a new release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants