captchamonitor.utils package¶
Submodules¶
captchamonitor.utils.collector module¶
- class Collector[source]¶
Bases:
object
Gets the absolute path to the consensus file from cache or downloads it from Collector if it doesn’t exist
Initialize Collector
- download_consensus(consensus_date: datetime.datetime) None [source]¶
Downloads the consensus document for the specified date from CollecTor
- Parameters
consensus_date (datetime) – The date for valid-after timestamp of the consensus document
- Raises
CollectorConnectionError – If cannot connect to Collector
- get_consensus(consensus_date: datetime.datetime) str [source]¶
Gets the absolute path to the consensus file from cache or downloads it if it doesn’t exist
- Parameters
consensus_date (datetime) – The date for valid-after timestamp of the consensus document
- Raises
CollectorDownloadError – If requested configuration wasn’t found locally and downloaded from Collector
- Returns
Absolute path to the consensus file
- Return type
- remove_consensus_file(consensus_date: datetime.datetime) None [source]¶
Finds the consensus document that was published at given date and deletes it
- Parameters
consensus_date (datetime) – the date for valid-after timestamp of the consensus document