Skip to content

Commit

Permalink
Merge pull request #21 from skysea04/dev
Browse files Browse the repository at this point in the history
UPD: Update booking request header
  • Loading branch information
skysea04 authored Jul 30, 2024
2 parents d825bc5 + 344f05e commit 2dc9ece
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 24 deletions.
44 changes: 22 additions & 22 deletions requirements/live.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
annotated-types==0.6.0
asgiref==3.7.2
annotated-types==0.7.0
asgiref==3.8.1
async-timeout==4.0.3
beautifulsoup4==4.12.3
certifi==2024.2.2
certifi==2024.7.4
charset-normalizer==3.3.2
coloredlogs==15.0.1
ddddocr==1.4.11
ddddocr==1.5.5
Django==4.2
flatbuffers==23.5.26
gunicorn==21.2.0
flatbuffers==24.3.25
gunicorn==22.0.0
humanfriendly==10.0
idna==3.6
idna==3.7
mpmath==1.3.0
numpy==1.26.4
onnxruntime==1.17.0
opencv-python-headless==4.9.0.80
packaging==23.2
phonenumbers==8.13.30
pillow==10.2.0
protobuf==4.25.3
psycopg==3.1.18
pydantic==2.6.1
pydantic_core==2.16.2
onnxruntime==1.18.1
opencv-python-headless==4.10.0.84
packaging==24.1
phonenumbers==8.13.40
pillow==10.4.0
protobuf==5.27.2
psycopg==3.2.1
pydantic==2.8.2
pydantic_core==2.20.1
pytz==2024.1
redis==5.0.1
requests==2.31.0
redis==5.0.8
requests==2.32.3
soupsieve==2.5
sqlparse==0.4.4
sympy==1.12
typing_extensions==4.9.0
urllib3==2.2.1
sqlparse==0.5.1
sympy==1.13.1
typing_extensions==4.12.2
urllib3==2.2.2
3 changes: 2 additions & 1 deletion src/booking/constants/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
HEADERS = {
'Host': 'irs.thsrc.com.tw',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'Content-Type': 'application/x-www-form-urlencoded',
'Accept-Language': 'zh-TW,zh;q=0.9',
'Accept-Encoding': 'gzip, deflate, br',
'sec-ch-ua': '"Not/A)Brand";v="8", "Chromium";v="126", "Google Chrome";v="126"',
}


Expand Down
2 changes: 1 addition & 1 deletion src/booking/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def submit_booking_condition(self, path: str, form_data: Dict) -> Tag:
urls.BASIC.format(path=path),
headers=urls.HEADERS,
params=form_data,
allow_redirects=True
allow_redirects=True,
)
return BeautifulSoup(res.content, features='html.parser')

Expand Down

0 comments on commit 2dc9ece

Please sign in to comment.