|
2 | 2 |
|
3 | 3 | Post comment, viewing, like and unlike comments
|
4 | 4 |
|
5 |
| -| Method | Return | Description |
6 |
| -| ---------------------------------------------------------- | ------------------ | -------------------------- |
7 |
| -| media_comment(media_id: str, message: str) | Comment | Add new comment to media |
8 |
| -| media_comments(media_id: str, amount: int = 0) | List\[Comment] | Get a list comments for media (amount=0 - fetch all comments) |
9 |
| -| comment_like(comment_pk: int) | bool | Like a comment |
10 |
| -| comment_unlike(comment_pk: int) | bool | Unlike a comment |
11 |
| -| comment_bulk_delete(media_id: str, comment_pks: List[int]) | bool | Delete a comment |
| 5 | +| Method | Return | Description |
| 6 | +| --------------------------------------------------------------------------------------- | ------------------ | -------------------------- |
| 7 | +| media_comment(media_id: str, message: str, replied_to_comment_id: Optional[int] = None) | Comment | Add new comment to media |
| 8 | +| media_comments(media_id: str, amount: int = 0) | List\[Comment] | Get a list comments for media (amount=0 - all comments) |
| 9 | +| comment_like(comment_pk: int) | bool | Like a comment |
| 10 | +| comment_unlike(comment_pk: int) | bool | Unlike a comment |
| 11 | +| comment_bulk_delete(media_id: str, comment_pks: List[int]) | bool | Delete a comment |
12 | 12 |
|
13 | 13 |
|
14 | 14 | Example:
|
@@ -36,6 +36,21 @@ Example:
|
36 | 36 | 'has_liked': None,
|
37 | 37 | 'like_count': None}
|
38 | 38 |
|
| 39 | +>>> comment = cl.media_comment(media_id, "Test comment 2", replied_to_comment_id=comment.pk) |
| 40 | +>>> comment.dict() |
| 41 | +{'pk': 17926777897585109, |
| 42 | + 'text': 'Test comment 2', |
| 43 | + 'user': {'pk': 1903424587, |
| 44 | + 'username': 'adw0rd', |
| 45 | + 'full_name': 'Mikhail Andreev', |
| 46 | + 'profile_pic_url': HttpUrl('https://scontent-hel3-1.cdninstagram.com/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg?tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd', scheme='https', host='scontent-hel3-1.cdninstagram.com', tld='com', host_type='domain', path='/v/t51.2885-19/s150x150/156689363_269505058076642_6448820957073669709_n.jpg', query='tp=1&_nc_ht=scontent-hel3-1.cdninstagram.com&_nc_ohc=EtzrL0pAdg8AX9pE_wN&edm=ABQSlwABAAAA&ccb=7-4&oh=e04d45b7651140e7fef61b1f67f1f408&oe=60C65AD1&_nc_sid=b2b2bd'), |
| 47 | + 'stories': []}, |
| 48 | + 'created_at_utc': datetime.datetime(2021, 5, 15, 14, 50, 3, tzinfo=datetime.timezone.utc), |
| 49 | + 'content_type': 'comment', |
| 50 | + 'status': 'Active', |
| 51 | + 'has_liked': None, |
| 52 | + 'like_count': None} |
| 53 | + |
39 | 54 | >>> comments = cl.media_comments(media_id)
|
40 | 55 | >>> comments[0].dict()
|
41 | 56 | {'pk': 17926777897585108,
|
|
0 commit comments