Skip to content

Commit b67ac21

Browse files
committed
fix: correctly extract hex from masked URLs without S/A/D prefix
1 parent 2eca3d2 commit b67ac21

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cs2_inspect/inspect_link.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,16 @@ def _extract_hex(hex_or_url: str) -> str:
5757
if m and re.search(r'[A-Fa-f]', m.group(1)):
5858
return m.group(1)
5959

60+
# Classic/market URL: A<hex> preceded by %20, space, or + (A is a prefix marker, not hex)
6061
m = _INSPECT_URL_RE.search(stripped)
6162
if m:
6263
return m.group(1)
64+
65+
# Pure masked format: csgo_econ_action_preview%20<hexblob> (no S/A/M prefix)
66+
mm = re.search(r'csgo_econ_action_preview(?:%20|\s|\+)([0-9A-Fa-f]{10,})$', stripped, re.IGNORECASE)
67+
if mm:
68+
return mm.group(1)
69+
6370
# Bare hex — remove any whitespace
6471
return re.sub(r"\s+", "", stripped)
6572

0 commit comments

Comments
 (0)