| 1 |
|
| 2 |
|
| 3 |
n |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
class Message(): |
| 11 |
"""Enum for message identifiers |
| 12 |
|
| 13 |
Extractors yield their results as message-tuples, where the first element |
| 14 |
is one of the following identifiers. This message-identifier determines |
| 15 |
the type and meaning of the other elements in such a tuple. |
| 16 |
|
| 17 |
- Message.Version: # obsolete |
| 18 |
- Message protocol version (currently always '1') |
| 19 |
- 2nd element specifies the version of all following messages as integer |
| 20 |
|
| 21 |
- Message.Directory: |
| 22 |
- Sets the target directory for all following images |
| 23 |
- 2nd element is unused |
| 24 |
- 3rd element is a dictionary containing general metadata |
| 25 |
|
| 26 |
- Message.Url: |
| 27 |
- Image URL and its metadata |
| 28 |
- 2nd element is the URL as a string |
| 29 |
- 3rd element is a dictionary with image-specific metadata |
| 30 |
|
| 31 |
- Message.Headers: # obsolete |
| 32 |
- HTTP headers to use while downloading |
| 33 |
- 2nd element is a dictionary with header-name and -value pairs |
| 34 |
|
| 35 |
- Message.Cookies: # obsolete |
| 36 |
- Cookies to use while downloading |
| 37 |
- 2nd element is a dictionary with cookie-name and -value pairs |
| 38 |
|
| 39 |
- Message.Queue: |
| 40 |
- (External) URL that should be handled by another extractor |
| 41 |
- 2nd element is the (external) URL as a string |
| 42 |
- 3rd element is a dictionary containing URL-specific metadata |
| 43 |
|
| 44 |
- Message.Urllist: # obsolete |
| 45 |
- Same as Message.Url, but its 2nd element is a list of multiple URLs |
| 46 |
- The additional URLs serve as a fallback if the primary one fails |
| 47 |
""" |
| 48 |
|
| 49 |
|
| 50 |
Directory = 2 |
| 51 |
Url = 3 |
| 52 |
|
| 53 |
|
| 54 |
Queue = 6 |
| 55 |
|
| 56 |
|