_____ _____ _____ _____
/\ \ |\ \ /\ \ /\ \
/::\ \ |:\____\ /::\ \ /::\____\
/::::\ \ |::| | /::::\ \ /:::/ /
/::::::\ \ |::| | /::::::\ \ /:::/ /
/:::/\:::\ \ |::| | /:::/\:::\ \ /:::/ /
/:::/__\:::\ \ |::| | /:::/ \:::\ \ /:::/____/
/::::\ \:::\ \ |::| | /:::/ \:::\ \ /::::\ \
/::::::\ \:::\ \ |::|___|______ /:::/ / \:::\ \ /::::::\ \ _____
/:::/\:::\ \:::\____\ /::::::::\ \ /:::/ / \:::\ \ /:::/\:::\ \ /\ \
/:::/ \:::\ \:::| | /::::::::::\____\/:::/____/ \:::\____\/:::/ \:::\ /::\____\
\::/ \:::\ /:::|____| /:::/~~~~/~~ \:::\ \ \::/ /\::/ \:::\ /:::/ /
\/_____/\:::\/:::/ / /:::/ / \:::\ \ \/____/ \/____/ \:::\/:::/ /
\::::::/ / /:::/ / \:::\ \ \::::::/ /
\::::/ / /:::/ / \:::\ \ \::::/ /
\::/____/ \::/ / \:::\ \ /:::/ /
~~ \/____/ \:::\ \ /:::/ /
\:::\ \ /:::/ /
\:::\____\ /:::/ /
\::/ / \::/ /
\/____/ \/____/
Download pych:
$ pip install pych
First import:
>>> from pych.catalog import Catalog
Get threads list:
>>> catalog = Catalog('b')
>>> catalog.threads
[<Thread board="b" #200000001 "Тема треда">...]
Get thread info:
>>> thread = catalog.threads.pop() # Get last thread
>>> thread.subject
'%%Тема треда%%'
Get thread post:
>>> thread.posts
[<Post #201306703>, <Post #201306882>, <Post #201308883>]
>>> OP = thread.posts[0]
>>> OP.comment
'Даже у него есть тян'
Get post files:
>>> OP.files
Threads catalog class. Accepts the name of the board.
type: str
The board short name.
type: Threads[]
Threads list in specified board. (Lazy property, loads only when called.)
Attachment file in post.
type: str
Cropped attachment display name.
type: str
Full attachment display name.
type: int
Height of attachment in pixels.
type: str
MD5 hash sum of attachment.
type: str
Server file name.
type: int
...
type: str
Full URL to file.
type: int
Size of attachment in bytes.
type: str
Full URL to attachment thumbnail.
type: int
The attachment thumbnail height.
type: int
The attachment thumbnail width.
type: int
The attachment type.
- jpg
- png
- webm
- mp4/mov
type: int
The attachment file width.
Download and save file to specified destination.
type: str
Post board name.
type: int
...
type: int
...
type: str
Post text with markdown tags.
type: str
Datetime posted.
type: str
Post author email.
type: int
...
type: File[]
List of File instances.
type: int
...
type: str
Post author name.
type: int
Global post id.
type: int
Post id regarding thread.
type: int
Flag OP.
type: str
Parent thread post.
type: int
...
type: str
Thread post subject.
type: int
Timestamp when posted.
type: str
...
type: str
Thread board name.
type: str
Thread OP text with markdown.
type: int
...
type: str
Thread OP id.
type: int
Count of posts inside thread.
type: float
Score of the thread.
type: str
Thread subject.
type: int
Thread created timestamp.
type: int
Count of views of thread.
type: str
Thread full URL.
type: Post[]
Get thread posts list.
returns: Dict[str, str]
Get boards. Returns dict where key
is a board id and value
is a board name.
For example: { "b": "Бред" }
.