skip to Main Content

I am building a python script that is trying to stream a screen capture to my Facebook Page and to be able to retrieve all the comments from the Facebook Live stream real time so that I can do some processing in the middle of the stream.

The Facebook App was set up (in development mode) but when I tried to retrieve the comments from my live stream, I am only able to retrieve comments with their name and id (“from”) that are made as the Facebook Page Admin, not comments that are made by other users. I need the user’s id, user’s name and their comments.

I understand that I need to get Facebook App to be live mode in order to retrieve all the comments with their details tagged to it. When I tried to get it, it tells me that I need to get the permission approved. I tried to fill in most of the stuff and try to get the two permission (manage_page for the comments and live video API for the streaming) but I was unable to because I left the platform empty.

Below is the message I got:

You do not have any platforms eligible for review. Please configure a platform on your Settings page.

The problem is when I tried to choose a platform that was shown in the list, python script does not fall in the list of platform.

Does anyone know of a solution or a different way to achieve what I need to retrieve?

2

Answers


  1. Chosen as BEST ANSWER

    In order to get the "from" field when retrieving the comments, you need to have manage_pages permission from your Facebook App that is linked to your Facebook Page. You will need to submit an App review for your Facebook App that usually takes 1-3 days to process. If you are lucky, it will probably take about 6-8 hours. Once it is approved, you can request the permission and get your application to go live.

    Also use the Page Access token in your "access_token" field when invoking the API so that it will allow you to pull the "from" field, which contains the id and name of the user.


  2. Have you tried using PyLivestream?
    It can be used to stream to Facebook Live using FFmpeg (to multiple services simultaneously actually, like Periscope, YouTube etc).

    It adheres to the RTMPS requirement and should be an option for you if I interpret your needs correctly.

    python -m pip install PyLivestream

    Facebook Live

    Facebook Live requires FFmpeg >= 4.2 due to mandatory RTMPS

    1. configure your Facebook Live stream
    2. Put stream ID from https://www.facebook.com/live/create into the file facebook.key
    3. Run Python script for Facebook with chosen input

    Check out the PyPi PyLivestream page for details.

    To be able to retrieve all the comments from the Facebook Live stream

    I’m not sure if this is possible using PyLivestream alone, but the Polls API can be used to represent VideoPoll objects in the Graph API, to create polls on live video broadcasts and get real-time responses from your viewers and can be created with the

    POST /{live-video-id}/polls

    endpoint on a LiveVideo object.
    Upon creation, the API will return a VideoPoll object ID, which you can use to manipulate the poll and query for viewer interactions.

    Guess you’ll have to do a bit of digging to figure out the details,
    but I believe this would be the right way to approach this task.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search