Skip to content

Commit 9507e0d

Browse files
Copilotbact
andcommitted
Use library-appropriate User-Agent identifying PyThaiNLP client
Co-authored-by: bact <128572+bact@users.noreply.github.com>
1 parent 7e64495 commit 9507e0d

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

pythainlp/corpus/core.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@
99
import json
1010
import os
1111
import re
12+
import sys
1213

1314
from pythainlp import __version__
1415
from pythainlp.corpus import corpus_db_path, corpus_db_url, corpus_path
1516
from pythainlp.tools import get_full_data_path
1617

1718
_CHECK_MODE = os.getenv("PYTHAINLP_READ_MODE")
1819
_USER_AGENT = (
19-
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
20-
"(KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
20+
f"PyThaiNLP/{__version__} "
21+
f"(Python/{sys.version_info.major}.{sys.version_info.minor}; "
22+
f"{sys.platform})"
2123
)
2224

2325

0 commit comments

Comments
 (0)