Skip to main content

在 Doctolib 上预订疫苗插槽

项目描述

博士霰弹枪

此脚本可让您在接下来的 7 天内自动在法国和德国的 Doctolib 上预订疫苗插槽。

Python 依赖项

  • 呜呜
  • 云层
  • 日期工具
  • 术语颜色
  • 颜色
  • 播放声音(可选)

如何使用它

此脚本需要 python3。如果没有,请先安装

安装依赖项:

pip install -r requirements.txt

跑:

./doctoshotgun.py <country{fr,de}> <city> <email> [<password>]

更多可选参数:

--debug, -d           show debug information
--pfizer, -z          select only Pfizer vaccine
--moderna, -m         select only Moderna vaccine
--janssen, -j         select only Janssen vaccine
--astrazeneca, -a     select only AstraZeneca vaccine
--only-second, -2     select only second dose
--only-third, -3      select only third dose
--patient PATIENT, -p PATIENT
                      give patient ID
--time-window TIME_WINDOW, -t TIME_WINDOW
                      set how many next days the script look for slots (default = 7)
--center CENTER, -c CENTER
                      filter centers
--zipcode CODE
                      filter centers by zipcode
--center-regex CENTER_REGEX
                      filter centers by regex
--center-exclude CENTER_EXCLUDE, -x CENTER_EXCLUDE
                      exclude centers
--center-exclude-regex CENTER_EXCLUDE_REGEX
                      exclude centers by regex
--include-neighbor-city, -n
                      include neighboring cities
--start-date START_DATE
                      first date on which you want to book the first slot (format should be DD/MM/YYYY)
--end-date END_DATE   last date on which you want to book the first slot (format should be DD/MM/YYYY)
--weekdays-exclude, -e
                      exclude weekdays, e.g. "tuesday Wednesday FRIDAY"
--dry-run             do not really book the slot
--code CODE           2FA code
--confirm             prompt to confirm before booking

使用 Docker

构建镜像:

docker build . -t doctoshotgun

运行容器:

docker run -it doctoshotgun <country{fr,de}> <city> <email> [<password>]

多个城市

您还可以同时在多个城市寻找插槽。城市必须用逗号分隔:

$ ./doctoshotgun.py <country{fr,de}> <city1>,<city2>,<city3> <email> [<password>]

过滤中心

您可以提供您想要专门寻找的中心的名称:

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com \
      --center "Centre de Vaccination Covid 19 - Ville de Paris" \
      --center "Centre de Vaccination du 7eme arrondissement de Paris - Gymnase Camou"

选择患者

对于有多个患者的 doctolib 帐户,您可以在启动脚本后选择患者:

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com PASSWORD
Available patients are:
* [0] Roger Philibert
* [1] Luce Philibert
For which patient do you want to book a slot?

您还可以将患者 ID 作为参数:

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com PASSWORD -p 1
Starting to look for vaccine slots for Luce Philibert in 1 next day(s) starting today...

设置时间窗口

默认情况下,脚本会在现在和第二天 23:59:59 之间查找时段。如果您属于允许在更遥远的未来预订时段的患者类别,您可以扩大时间窗口。例如,如果您想在接下来的 5 天内搜索:

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com -t 5
Password:
Starting to look for vaccine slots for Roger Philibert in 5 next day(s) starting today...
This may take a few minutes/hours, be patient!

看具体日期

默认情况下,脚本会在现在和第二天 23:59:59 之间查找时段。如果您现在无法接种疫苗(例如,最近 3 个月内或外地的新冠病毒)并且您正在寻找遥远的未来的预约,您可以通过一个开始日期:

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com --start-date 17/06/2021
Password:
Starting to look for vaccine slots for Roger Philibert in 7 next day(s) starting 17/06/2021...
This may take a few minutes/hours, be patient!

按疫苗过滤

辉瑞疫苗是法国唯一允许 16 至 18 岁人群使用的疫苗。对于这种情况,您可以使用 -z 选项。

$ ./doctoshotgun.py fr paris roger.philibert@gmail.com PASSWORD -z
Starting to look for vaccine slots for Luce Philibert...
Vaccines: Pfizer
This may take a few minutes/hours, be patient!

也可以使用 -m 选项过滤 Moderna 疫苗,使用 -j 选项过滤 Janssen 疫苗。

发展

运行测试

 $ pip install -r requirements-dev.txt
 $ pytest test_browser.py

项目详情


下载文件

下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。

源分布

doctoshotgun-1.0.1.tar.gz (27.4 kB 查看哈希

已上传 source

内置分布

doctoshotgun-1.0.1-py3-none-any.whl (27.3 kB 查看哈希

已上传 py3