Skip to content

Commit 4eda5c1

Browse files
melroy89polyrabbit
andauthored
Update http.py & requirements.txt (#27)
* Update http.py Remove external parameter (not used anymore). * Update requirements.txt Upgrade to v1.2.1 --------- Co-authored-by: Changxin Miao <[email protected]>
1 parent a34138c commit 4eda5c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

page_content_extractor/http.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def init_poolmanager(self, *args, **kwargs):
5151
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
5252

5353
# Some sites just refuses bot connection
54-
ua = UserAgent(use_external_data=True, browsers=['chrome'], fallback='Twitterbot/1.0')
55-
ua_str = ua.data_browsers['chrome'][0] # Use the latest, in case of "unsupported browser" error
54+
ua = UserAgent(browsers=['chrome'], fallback='Twitterbot/1.0')
55+
ua_str = ua.random
5656
logger.info(f'Use user-agent {ua_str}')
5757

5858
session = requests.Session()

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ mock==5.1.0
1111
werkzeug==2.3.7
1212
feedwerk==1.1.0
1313
Pillow==10.0.0
14-
fake-useragent==1.1.3 # 1.2.0 is a breaking change, and doesnot work properly
14+
fake-useragent==1.2.1
1515
olefile
1616
openai==0.28.0
1717
torch==2.0.1
@@ -22,4 +22,4 @@ python_slugify==8.0.1
2222
sqlalchemy==2.0.20
2323
psycopg2==2.9.7
2424
humanize==4.8.0
25-
llama-cpp-python==0.1.84
25+
llama-cpp-python==0.1.84

0 commit comments

Comments
 (0)