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

str

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

captchamonitor.utils.config module

class Config(init: Optional[dict] = None)[source]

Bases: object

Behaves like a real python dictionary and also reads config variables from the environment

Based on: https://gist.github.com/turicas/1510860

keys() KeysView[str][source]
values() ValuesView[Any][source]

captchamonitor.utils.consensus_parser module

captchamonitor.utils.container_manager module

captchamonitor.utils.database module

captchamonitor.utils.domain_attributes module

captchamonitor.utils.exceptions module

exception CollectorConnectionError[source]

Bases: captchamonitor.utils.exceptions.Error

exception CollectorDownloadError[source]

Bases: captchamonitor.utils.exceptions.Error

exception ConfigInitError[source]

Bases: captchamonitor.utils.exceptions.Error

exception ConsensusParserFileNotFoundError[source]

Bases: captchamonitor.utils.exceptions.Error

exception ConsensusParserInvalidDocument[source]

Bases: captchamonitor.utils.exceptions.Error

exception DatabaseInitError[source]

Bases: captchamonitor.utils.exceptions.Error

exception Error[source]

Bases: Exception

Base class for other exceptions

exception FetcherConnectionInitError[source]

Bases: captchamonitor.utils.exceptions.Error

exception FetcherNotFound[source]

Bases: captchamonitor.utils.exceptions.Error

exception FetcherURLFetchError[source]

Bases: captchamonitor.utils.exceptions.Error

exception HarExportExtensionError[source]

Bases: captchamonitor.utils.exceptions.Error

exception MissingProxy[source]

Bases: captchamonitor.utils.exceptions.Error

exception NoSuchDomain[source]

Bases: captchamonitor.utils.exceptions.Error

exception OnionooConnectionError[source]

Bases: captchamonitor.utils.exceptions.Error

exception OnionooMissingRelayError[source]

Bases: captchamonitor.utils.exceptions.Error

exception StemConnectionInitError[source]

Bases: captchamonitor.utils.exceptions.Error

exception StemDescriptorUnavailableError[source]

Bases: captchamonitor.utils.exceptions.Error

exception TorBrowserProfileLocationError[source]

Bases: captchamonitor.utils.exceptions.Error

exception TorLauncherInitError[source]

Bases: captchamonitor.utils.exceptions.Error

exception WebsiteParserFetchError[source]

Bases: captchamonitor.utils.exceptions.Error

exception WebsiteParserParseError[source]

Bases: captchamonitor.utils.exceptions.Error

exception WorkerInitError[source]

Bases: captchamonitor.utils.exceptions.Error

captchamonitor.utils.models module

captchamonitor.utils.onionoo module

captchamonitor.utils.proxy_parser module

class ProxyParser[source]

Bases: object

Parses the list of proxies

get_proxy_details_spys() None[source]

Get the information regarding the proxies from http://spys.me/proxy.txt.

captchamonitor.utils.small_scripts module

captchamonitor.utils.tor_launcher module

captchamonitor.utils.website_parser module

Module contents