补充无锡医院判断
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
x-env:
|
||||
&template
|
||||
image: fcb_photo_review:1.14.2
|
||||
image: fcb_photo_review:1.14.3
|
||||
restart: always
|
||||
|
||||
x-review:
|
||||
@@ -104,3 +104,11 @@ services:
|
||||
depends_on:
|
||||
- photo_mask_1
|
||||
command: [ 'photo_mask.py' ]
|
||||
|
||||
photo_review_6:
|
||||
<<: *review_template
|
||||
container_name: photo_review_6
|
||||
hostname: photo_review_6
|
||||
depends_on:
|
||||
- photo_mask_2
|
||||
command: [ 'photo_review.py' ]
|
||||
@@ -121,8 +121,9 @@ def get_better_image_from_qrcode(image, image_id, dpi=150):
|
||||
|
||||
pdf_url = f'{jsczt_base_url}/download?idBase={id_base}'
|
||||
return _parse_pdf_url(pdf_url)
|
||||
elif url.startswith('http://dzfp.wxxsh.net'): # 无锡市锡山人民医院
|
||||
pdf_url = html_util.get_wxxsh_pdf_url(url)
|
||||
elif url.startswith('http://dzfp.wxxsh.net') or url.startswith('http://dzpj.wuxi5h.com'):
|
||||
# 无锡市锡山人民医院、无锡市第五人民医院
|
||||
pdf_url = html_util.get_wx_pdf_url(url)
|
||||
if not pdf_url:
|
||||
continue
|
||||
|
||||
|
||||
@@ -44,11 +44,11 @@ def download_pdf(url, local_filename=None):
|
||||
|
||||
|
||||
@retry(stop=stop_after_attempt(3), wait=wait_random(1, 3), reraise=True,
|
||||
after=lambda x: logging.warning('获取无锡锡山人民医院票据失败!'))
|
||||
def get_wxxsh_pdf_url(url):
|
||||
after=lambda x: logging.warning('获取无锡医院票据失败!'))
|
||||
def get_wx_pdf_url(url):
|
||||
response = requests.get(url)
|
||||
if response.status_code != 200:
|
||||
raise Exception(f'请求无锡锡山人民医院票据失败!状态码: {response.status_code}')
|
||||
raise Exception(f'请求无锡医院票据失败!状态码: {response.status_code}')
|
||||
soup = BeautifulSoup(response.text, 'html.parser')
|
||||
pdf_url = soup.find('a', string='点击查看电子票据')
|
||||
if pdf_url:
|
||||
|
||||
Reference in New Issue
Block a user