Handle gviz response prefix
This commit is contained in:
@@ -44,6 +44,8 @@ def read_gviz(sheet: str) -> list[list[str]]:
|
||||
response = requests.get(url, timeout=30)
|
||||
response.raise_for_status()
|
||||
text = response.text.strip()
|
||||
if text.startswith("/*O_o*/"):
|
||||
text = text[len("/*O_o*/") :].strip()
|
||||
if text.endswith(";"):
|
||||
text = text[:-1].rstrip()
|
||||
if not text.startswith(GVIZ_PREFIX) or not text.endswith(")"):
|
||||
|
||||
Reference in New Issue
Block a user