feat: add FacebookBot automation class and FastAPI endpoint for posting group comments

This commit is contained in:
Victor Phan
2026-07-23 14:15:37 +07:00
parent 6895ca3e9a
commit 8c7ab71918
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -35,8 +35,9 @@ class FacebookBot:
has_image = self.push_image_to_gallery(local_image_path)
logging.info(f"Khởi động Facebook và vào Group ID: {group_id}...")
# Dùng lệnh ADB shell để mở thẳng Deep Link của Group
self.d.shell(f'am start -a android.intent.action.VIEW -d "fb://group/{group_id}"')
# Dùng lệnh ADB shell để mở thẳng URL của Group (Ép mở bằng app Facebook)
# Dùng https:// thay vì fb:// vì một số Group bị lỗi deep link "Không hiển thị"
self.d.shell(f'am start -a android.intent.action.VIEW -d "https://www.facebook.com/groups/{group_id}" com.facebook.katana')
time.sleep(8) # Đợi load giao diện group
self.dump_ui_for_debug("fb_step1_open_group.xml")