def like_post(client: ApiClient, media_id: str) -> bool: """Like a post. Args: client: your `ApiClient` media_id: the post to like Returns: `True` if success else `False` """ like = ps.Like(media_id=media_id) resp = client.post_like(like) logger.info(f"liked post {media_id}") return is_resp_ok(resp)
def like_post(client: ApiClient, media_id: str) -> bool: like = ps.Like(media_id=media_id) resp = client.post_like(like) logger.info(f"liked post {media_id}") return is_resp_ok(resp)
import os from instauto.api.client import ApiClient from instauto.api.actions import post as ps if __name__ == '__main__': if os.path.isfile('./.instauto.save'): client = ApiClient.initiate_from_file('./.instauto.save') else: client = ApiClient(username=os.environ.get("INSTAUTO_USER") or "your_username", password=os.environ.get("INSTAUTO_PASS") or "your_password") client.log_in() client.save_to_disk('./.instauto.save') like = ps.Like(media_id="1734612737423614055_6400760974") client.post_like(like)
def like_post(client: ApiClient, media_id: str) -> bool: like = ps.Like(media_id=media_id) resp = client.post_like(like) return is_resp_ok(resp)