Coder Social home page Coder Social logo

harrypython / itsagramlive Goto Github PK

View Code? Open in Web Editor NEW
177.0 13.0 51.0 88 KB

It's A Gram Live is a Python script that create a Instagram Live and provide you a rtmp server and stream key to streaming using sofwares like OBS-Studio.

License: GNU General Public License v3.0

Python 100.00%
needs-work help-wanted instagram obs-studio python-script instagram-live

itsagramlive's Introduction

GitHub PyPI GitHub tag (latest by date)

It's A Gram Live

It's A Gram Live is a Python script that create a Instagram Live and provide you a rtmp server and stream key to streaming using sofwares like OBS-Studio or XSplit Broadcaster.

Installation

pip install ItsAGramLive

Usage

from ItsAGramLive import ItsAGramLive

live = ItsAGramLive()

# or if you want to pre-define the username and password without args
# live = ItsAGramLive(
#    username='foo',
#    password='bar'
# )

live.start()
python3 live_broadcast.py -u yourInstagramUsername -p yourPassword -proxy user:password@ip:port

The output will give you the RTMP Server address and the Stream key (automatically copied to your clipboard)

Usage with FFMPEG

Note: It is not possible use commands like chat or wave with this script. The live will be finish when the file finish the streaming.

import argparse  
import subprocess  
from ItsAGramLive import ItsAGramLive  
  
parser = argparse.ArgumentParser(add_help=True)  
parser.add_argument("-u", "--username", type=str, help="username", required=True)  
parser.add_argument("-p", "--password", type=str, help="password", required=True)  
parser.add_argument("-f", "--file", type=str, help="File", required=True)  
args = parser.parse_args()  
  
live = ItsAGramLive(username=args.username, password=args.password)  
  
if live.login():  
    print("You'r logged in")  
  
    if live.create_broadcast():  
  
        if live.start_broadcast():  
            ffmpeg_cmd = "ffmpeg " \  
                         "-rtbufsize 256M " \  
                         "-re " \  
                         "-i '{file}' " \  
                         "-acodec libmp3lame " \  
                         "-ar 44100 " \  
                         "-b:a 128k " \  
                         "-pix_fmt yuv420p " \  
                         "-profile:v baseline " \  
                         "-s 720x1280 " \  
                         "-bufsize 6000k " \  
                         "-vb 400k " \  
                         "-maxrate 1500k " \  
                         "-deinterlace " \  
                         "-vcodec libx264 " \  
                         "-preset veryfast " \  
                         "-g 30 -r 30 " \  
                         "-f flv '{stream_server}{stream_key}'".format(
						                       file=args.file,
                                                                       stream_server=live.stream_server,
                                                                       stream_key=live.stream_key
                                                                       )  
  
            print('CTRL+C to quit.')  
            try:  
                subprocess.call(ffmpeg_cmd, shell=True)  
            except KeyboardInterrupt:  
                pass  
            except Exception as error:  
                print(error)  
                live.end_broadcast()  
  
            live.end_broadcast()
python3 live_broadcast_ffmpeg.py -u yourInstagramUsername -p yourPassword -f /path/to/video/file.mp4

Commands

  • info Show details about the broadcast
  • mute comments Prevent viewers from commenting
  • unmute comments Allow viewers do comments
  • viewers List viewers
  • chat Send a comment
  • pin Send a comment and pin it
  • unpin Remove a pinned comment
  • comments Get the list of comments
  • wave Wave to a viewer
  • stop Terminate broadcast

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU GPLv3

Buy me a coffee

Buy Me A Coffee

Instagram Bot

Check my Instagram Bot: BurbnBot

itsagramlive's People

Contributors

angeloruggieridj avatar aydin47 avatar harrypython avatar jozephbrasil avatar raihanstark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itsagramlive's Issues

comments mute not work

Hi
First of all, thank you very much for this module
but i try to use this function : live.mute_comments() but its not work
may be instagram changed some thing
please help me .
Environment :โ€
python 3.7
ubuntu server 18.04 lts

Error "choose a challenge name"

Hi ! Im trying yo use but it appear an error code. When it say "choose a challenge mode" . I press the two options but its the same error

C:\Users\gotag>C:\Users\gotag\AppData\Local\Programs\Python\Python39\IG\test.py
Let's do it!
You'r logged in
Choose a challenge mode (0 - SMS, 1 - Email): 1
Traceback (most recent call last):
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\IG\test.py", line 10, in
live.start()
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 253, in start
if self.create_broadcast():
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 410, in create_broadcast
if self.send_request(endpoint='live/create/', post=self.generate_signature(data)):
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 217, in send_request
self.get_code_challenge_required(path, choice)
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 125, in get_code_challenge_required
'_csrftoken': self.LastResponse.cookies['csrftoken']}
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\cookies.py", line 328, in getitem
return self._find_no_duplicates(name)
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\cookies.py", line 399, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='csrftoken', domain=None, path=None"

C:\Users\gotag>C:\Users\gotag\AppData\Local\Programs\Python\Python39\IG\test.py
Let's do it!
You'r logged in
Choose a challenge mode (0 - SMS, 1 - Email): 0
Traceback (most recent call last):
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\IG\test.py", line 10, in
live.start()
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 253, in start
if self.create_broadcast():
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 410, in create_broadcast
if self.send_request(endpoint='live/create/', post=self.generate_signature(data)):
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 217, in send_request
self.get_code_challenge_required(path, choice)
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 125, in get_code_challenge_required
'_csrftoken': self.LastResponse.cookies['csrftoken']}
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\cookies.py", line 328, in getitem
return self._find_no_duplicates(name)
File "C:\Users\gotag\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\cookies.py", line 399, in _find_no_duplicates
raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='csrftoken', domain=None, path=None"

C:\Users\gotag>

Syntax error?

Hi
When I run live_broadcast.py, I get the following error

File "path/to/ItsAGramLive.py", line 18
    previewWidth: int = 1080
                ^
SyntaxError: invalid syntax

My live_broadcast.py consists of

from ItsAGramLive import ItsAGramLive

live = ItsAGramLive(
  username='username',
  password='pass'
)

live.start()

Python version is 3.5.2
I'm using Windows 10
Any pointers on what I'm doing wrong?
Thanks

Live To IGTV error

Hello,
Does the live to IGTV works with your script?
I'm facing issue trying to do this with a javascript library (dilame/instagram-private-api#1194), I have a 500 error when I post the live to IGTV.
I compared the requests that the javascript lib has and yours and it looks like the same. I'm thinking that Instagram changed something in their API recently and I wanted to verify it with an other script like yours, but I'm not familiar with python scripts, I tried to use your script but I did not succeed...

Except when ending stream

Describe the bug
Well, got it to work
But after stopping, i get this;

  • Save Live replay to IGTV ? <y/n>
    command> n
  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)

but tried again 60secs later and still shows same except 3 times now?

I do see on my phone that the stream has ended.

Edit: Ctrl-C is only way to kill it

To Reproduce
Send stop command

Environment (please complete the following information):

  • OS: Windows 10
  • Python version: 3.7.4

Settings (please complete the following information):

  • Are you using proxy?
  • Are you using two-factor authentication by text message (SMS)?
  • Are you using two-factor authentication by a third party authentication app (such as Duo Mobile or Google Authenticator)?

Additional context

Originally posted by @GitNees in #36 (comment)

Get Comments not list all comments

About Comments
List comments not showing all the comments. It just show the recent two comments or sometimes don't show any comment.

Environment

  • OS: Ubuntu
  • Python version: 3

Settings:

  • Are you using proxy? No
  • Are you using two-factor authentication by text message (SMS)? NO
  • Are you using two-factor authentication by a third party authentication app (such as Duo Mobile or Google Authenticator)? No

ERROR(400): Can't comment for now.

Describe the bug
After creating a broadcast & going live and trying to use "chat" command I'm getting following error:

command> chat hello
* ERROR(400): Can't comment for now.
<Response [400]>

Expected behavior
Comment appear on my instagram live

Environment (please complete the following information):

  • OS: Windows 10
  • Python version: Python 3.9.5

Settings (please complete the following information):

  • Are you using proxy? - no
  • Are you using two-factor authentication by text message (SMS)? - no
  • Are you using two-factor authentication by a third party authentication app (such as Duo Mobile or Google Authenticator)? - no

Pin message? (question)

Thx for fixing the problems so quickly!

Not sure how you set labels as this is question and not a problem :)

When you stream live with your phone, you can pin messages, this would be very handy if this was also possible with trough command? or is this a limitation in the way streaming is done here?

Crashing if you run comments

Describe the bug
Crashing when using "comments" command.

To Reproduce
Steps to reproduce the behavior:

  1. Start a live request
  2. Run "mute comments"
  3. Run comments
  4. See error - crashing

Expected behavior
Should be notified: you are muted and there is no comments.

Two factor authentication

Hi,
Thank you for your code.
is it possible to add two factor authentication to itsagramlive.
It's maybe easy for personal ig account to turn it off and continue, but for a shared account with two factor authentication I'm stuck.

Fullscreen live

Hello, thanks for the script, it's very usefull :)

It's normal the live appears cropped and not fullscreen like a normal live from the app?

How can do it fullscreen?

Bad password

I just update to last version (1.4.3) and now send me a message for bad password.
I start the same file with same password in all versions, if I return to 1.4.1 version it works fine
the error is the following lines:

Let's do it!
Traceback (most recent call last):
File "c:\python3\IG\test.py", line 11, in
live.start()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 241, in start
if not self.login():
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 131, in login
if self.LastJson['error_type'] == 'bad_password':
KeyError: 'error_type'

OBS Studio native integration

Describe the solution you'd like
It would be great since OBS Studio is used by thousands of people and it is also written in Python, to have a native integration with your tool. Maybe a dock window with username and password fields so we can populate with our Instagram credentials and automatically start the live stream. Since I plan to use multiple Instagram accounts to stream to, would be nice to be able to copy the current RTMP URL and key so we can start streaming using obs-multi-rtmp for example. Also would be great to have checkbox for chat commands and another textbox to send a command. Not sure if it possible to read real-time conversations for the current stream. That would be the ultimate OBS to Instagram solution in my opinion, there is nothing else available at the moment.

Thanks for your great work here @harrypython, I really appreciate what you've done here. Have a great day!

Make Session File

i am try few times to login with special ip in one day and finally instagram block my request
Is it possible to save the session for next login?

View comments

Hi, I really like your project and, if you want I could help you to extend this project!

I've created a function to get the comments of a Live.
The code is shown below:

    def get_comments(self):
        if self.send_request("live/{}/get_comment/".format(self.broadcast_id)):
            for comment in self.LastJson['comments']:
                print(f"{comment['user']['username']} has posted a new comment: {comment['text']}")

tell me exact version of ffmpeg needed

Hi Harry Python :),
please tell me exact version of ffmpeg needed for this project because after deployed to heroku getting error below :

2022-05-29T07:53:39.923130+00:00 app[api]: Enable Logplex by user [email protected]
2022-05-29T07:53:39.923130+00:00 app[api]: Release v2 created by user [email protected]
2022-05-29T07:53:41.372311+00:00 app[api]: Upgrade stack to heroku-20 by user [email protected]
2022-05-29T07:53:41.372311+00:00 app[api]: Release v3 created by user [email protected]
2022-05-29T07:53:42.000000+00:00 app[api]: Build started by user [email protected]
2022-05-29T07:54:23.209677+00:00 app[api]: Release v4 created by user [email protected]
2022-05-29T07:54:23.209677+00:00 app[api]: Deploy by user [email protected]
2022-05-29T07:54:33.000000+00:00 app[api]: Build succeeded
2022-05-29T07:54:54.841774+00:00 app[api]: Scaled to worker@1:Free by user [email protected]
2022-05-29T07:55:01.232638+00:00 heroku[worker.1]: Starting process with command python -m pip install --upgrade pip && python -m pip install -r requirements.txt && python live_broadcast_ffmpeg.py -u postperpet -p UPryZD3SVizGF9x -f ./aa1300c95411bf4df0a0025daa7ac22945115644-480p.mp4
2022-05-29T07:55:01.855244+00:00 heroku[worker.1]: State changed from starting to up
2022-05-29T07:55:02.339890+00:00 app[worker.1]: Requirement already satisfied: pip in ./.heroku/python/lib/python3.9/site-packages (22.0.4)
2022-05-29T07:55:02.435260+00:00 app[worker.1]: Collecting pip
2022-05-29T07:55:02.454850+00:00 app[worker.1]: Downloading pip-22.1.1-py3-none-any.whl (2.1 MB)
2022-05-29T07:55:02.485108+00:00 app[worker.1]: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 2.1/2.1 MB 78.9 MB/s eta 0:00:00
2022-05-29T07:55:02.598523+00:00 app[worker.1]: Installing collected packages: pip
2022-05-29T07:55:02.598737+00:00 app[worker.1]: Attempting uninstall: pip
2022-05-29T07:55:02.599400+00:00 app[worker.1]: Found existing installation: pip 22.0.4
2022-05-29T07:55:02.779296+00:00 app[worker.1]: Uninstalling pip-22.0.4:
2022-05-29T07:55:02.788535+00:00 app[worker.1]: Successfully uninstalled pip-22.0.4
2022-05-29T07:55:03.942493+00:00 app[worker.1]: Successfully installed pip-22.1.1
2022-05-29T07:55:04.477555+00:00 app[worker.1]: Requirement already satisfied: ItsAGramLive in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.3.5)
2022-05-29T07:55:04.478435+00:00 app[worker.1]: Requirement already satisfied: pyperclip>=1.8.0 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.8.2)
2022-05-29T07:55:04.478842+00:00 app[worker.1]: Requirement already satisfied: requests in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (2.27.1)
2022-05-29T07:55:04.479558+00:00 app[worker.1]: Requirement already satisfied: Pillow==8.1.1 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 4)) (8.1.1)
2022-05-29T07:55:04.479938+00:00 app[worker.1]: Requirement already satisfied: moviepy in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (1.0.3)
2022-05-29T07:55:04.480649+00:00 app[worker.1]: Requirement already satisfied: requests-toolbelt>=0.9.1 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 6)) (0.9.1)
2022-05-29T07:55:04.481032+00:00 app[worker.1]: Requirement already satisfied: tqdm in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 7)) (4.64.0)
2022-05-29T07:55:04.481787+00:00 app[worker.1]: Requirement already satisfied: imageio==2.9.0 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 9)) (2.9.0)
2022-05-29T07:55:04.490698+00:00 app[worker.1]: Requirement already satisfied: numpy in ./.heroku/python/lib/python3.9/site-packages (from imageio==2.9.0->-r requirements.txt (line 9)) (1.22.4)
2022-05-29T07:55:04.506109+00:00 app[worker.1]: Requirement already satisfied: idna<4,>=2.5 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (3.3)
2022-05-29T07:55:04.506852+00:00 app[worker.1]: Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (1.26.9)
2022-05-29T07:55:04.507549+00:00 app[worker.1]: Requirement already satisfied: certifi>=2017.4.17 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (2022.5.18.1)
2022-05-29T07:55:04.508912+00:00 app[worker.1]: Requirement already satisfied: charset-normalizer~=2.0.0 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (2.0.12)
2022-05-29T07:55:04.539346+00:00 app[worker.1]: Requirement already satisfied: imageio-ffmpeg>=0.2.0 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (0.4.7)
2022-05-29T07:55:04.540455+00:00 app[worker.1]: Requirement already satisfied: decorator<5.0,>=4.0.2 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (4.4.2)
2022-05-29T07:55:04.541122+00:00 app[worker.1]: Requirement already satisfied: proglog<=1.0.0 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (0.1.10)
2022-05-29T07:55:06.270915+00:00 app[worker.1]: You'r logged in
2022-05-29T07:55:09.145190+00:00 app[worker.1]: CTRL+C to quit.
2022-05-29T07:55:09.149190+00:00 app[worker.1]: ffmpeg version N-62022-g0dcbe1c1aa-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers
2022-05-29T07:55:09.149192+00:00 app[worker.1]: built with gcc 8 (Debian 8.3.0-6)
2022-05-29T07:55:09.149195+00:00 app[worker.1]: configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
2022-05-29T07:55:09.149226+00:00 app[worker.1]: libavutil 57. 25.100 / 57. 25.100
2022-05-29T07:55:09.149227+00:00 app[worker.1]: libavcodec 59. 32.100 / 59. 32.100
2022-05-29T07:55:09.149234+00:00 app[worker.1]: libavformat 59. 24.100 / 59. 24.100
2022-05-29T07:55:09.149236+00:00 app[worker.1]: libavdevice 59. 6.100 / 59. 6.100
2022-05-29T07:55:09.149238+00:00 app[worker.1]: libavfilter 8. 39.100 / 8. 39.100
2022-05-29T07:55:09.149246+00:00 app[worker.1]: libswscale 6. 6.100 / 6. 6.100
2022-05-29T07:55:09.149247+00:00 app[worker.1]: libswresample 4. 6.100 / 4. 6.100
2022-05-29T07:55:09.149249+00:00 app[worker.1]: libpostproc 56. 5.100 / 56. 5.100
2022-05-29T07:55:09.160190+00:00 app[worker.1]: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './aa1300c95411bf4df0a0025daa7ac22945115644-480p.mp4':
2022-05-29T07:55:09.160193+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.160195+00:00 app[worker.1]: major_brand : isom
2022-05-29T07:55:09.160206+00:00 app[worker.1]: minor_version : 512
2022-05-29T07:55:09.160222+00:00 app[worker.1]: compatible_brands: isomiso2avc1mp41
2022-05-29T07:55:09.160231+00:00 app[worker.1]: encoder : Lavf58.29.100
2022-05-29T07:55:09.160257+00:00 app[worker.1]: comment : http://www.aparat.com/Zizi.salimi
2022-05-29T07:55:09.160284+00:00 app[worker.1]: Duration: 00:05:38.83, start: 0.000000, bitrate: 512 kb/s
2022-05-29T07:55:09.160344+00:00 app[worker.1]: Stream #0:00x1: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 854x480 [SAR 1:1 DAR 427:240], 375 kb/s, 30 fps, 30 tbr, 1000k tbn (default)
2022-05-29T07:55:09.160347+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.160356+00:00 app[worker.1]: handler_name : VideoHandler
2022-05-29T07:55:09.160365+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:09.160400+00:00 app[worker.1]: Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
2022-05-29T07:55:09.160401+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.160410+00:00 app[worker.1]: handler_name : SoundHandler
2022-05-29T07:55:09.160420+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:09.572676+00:00 app[worker.1]: Stream mapping:
2022-05-29T07:55:09.572691+00:00 app[worker.1]: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
2022-05-29T07:55:09.572691+00:00 app[worker.1]: Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
2022-05-29T07:55:09.572692+00:00 app[worker.1]: Press [q] to stop, [?] for help
2022-05-29T07:55:09.877362+00:00 app[worker.1]: [libx264 @ 0x602fb00] using SAR=427/135
2022-05-29T07:55:09.879977+00:00 app[worker.1]: [libx264 @ 0x602fb00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
2022-05-29T07:55:09.885490+00:00 app[worker.1]: [libx264 @ 0x602fb00] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
2022-05-29T07:55:09.886343+00:00 app[worker.1]: [libx264 @ 0x602fb00] 264 - core 164 r3094 bfc87b7 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=3 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1500 vbv_bufsize=6000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-05-29T07:55:09.886501+00:00 app[worker.1]: Output #0, flv, to 'rtmps://live-upload.instagram.com:443/rtmp/17872267019657812?s_sw=0&s_vt=ig&a=Abz0oOVCwEaZwV31':
2022-05-29T07:55:09.886504+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.886505+00:00 app[worker.1]: major_brand : isom
2022-05-29T07:55:09.886508+00:00 app[worker.1]: minor_version : 512
2022-05-29T07:55:09.886525+00:00 app[worker.1]: compatible_brands: isomiso2avc1mp41
2022-05-29T07:55:09.886541+00:00 app[worker.1]: comment : http://www.aparat.com/Zizi.salimi
2022-05-29T07:55:09.886556+00:00 app[worker.1]: encoder : Lavf59.24.100
2022-05-29T07:55:09.886640+00:00 app[worker.1]: Stream #0:0(und): Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 720x1280 [SAR 427:135 DAR 427:240], q=2-31, 400 kb/s, 30 fps, 1k tbn (default)
2022-05-29T07:55:09.886642+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.886663+00:00 app[worker.1]: handler_name : VideoHandler
2022-05-29T07:55:09.886674+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:09.886690+00:00 app[worker.1]: encoder : Lavc59.32.100 libx264
2022-05-29T07:55:09.886697+00:00 app[worker.1]: Side data:
2022-05-29T07:55:09.886727+00:00 app[worker.1]: cpb: bitrate max/min/avg: 1500000/0/400000 buffer size: 6000000 vbv_delay: N/A
2022-05-29T07:55:09.886768+00:00 app[worker.1]: Stream #0:1(und): Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp, 128 kb/s (default)
2022-05-29T07:55:09.886769+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:09.886790+00:00 app[worker.1]: handler_name : SoundHandler
2022-05-29T07:55:09.886805+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:09.886820+00:00 app[worker.1]: encoder : Lavc59.32.100 libmp3lame
2022-05-29T07:55:11.707620+00:00 app[worker.1]: frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.18 bitrate= 22.0kbits/s speed=0.609x
2022-05-29T07:55:11.707633+00:00 app[worker.1]: [tls @ 0x6030840] IO error: Broken pipe
2022-05-29T07:55:11.707633+00:00 app[worker.1]: av_interleaved_write_frame(): Broken pipe
2022-05-29T07:55:11.737057+00:00 app[worker.1]: Last message repeated 27 times
2022-05-29T07:55:11.737065+00:00 app[worker.1]: [flv @ 0x6035d00] Failed to update header with correct duration.
2022-05-29T07:55:11.737066+00:00 app[worker.1]: [flv @ 0x6035d00] Failed to update header with correct filesize.
2022-05-29T07:55:11.737068+00:00 app[worker.1]: Error writing trailer of rtmps://live-upload.instagram.com:443/rtmp/17872267019657812?s_sw=0&s_vt=ig&a=Abz0oOVCwEaZwV31: Broken pipe
2022-05-29T07:55:11.737084+00:00 app[worker.1]: frame= 56 fps= 26 q=-1.0 Lsize= 52kB time=00:00:02.11 bitrate= 203.2kbits/s speed=0.978x
2022-05-29T07:55:11.737102+00:00 app[worker.1]: video:76kB audio:33kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2022-05-29T07:55:11.737119+00:00 app[worker.1]: [tls @ 0x6030840] The specified session has been invalidated for some reason.
2022-05-29T07:55:11.738122+00:00 app[worker.1]: Last message repeated 1 times
2022-05-29T07:55:11.738124+00:00 app[worker.1]: Error closing file rtmps://live-upload.instagram.com:443/rtmp/17872267019657812?s_sw=0&s_vt=ig&a=Abz0oOVCwEaZwV31: Input/output error
2022-05-29T07:55:11.740763+00:00 app[worker.1]: [libx264 @ 0x602fb00] frame I:3 Avg QP:31.10 size: 10601
2022-05-29T07:55:11.740764+00:00 app[worker.1]: [libx264 @ 0x602fb00] frame P:53 Avg QP:34.02 size: 850
2022-05-29T07:55:11.740774+00:00 app[worker.1]: [libx264 @ 0x602fb00] mb I I16..4: 90.5% 0.0% 9.5%
2022-05-29T07:55:11.740783+00:00 app[worker.1]: [libx264 @ 0x602fb00] mb P I16..4: 1.8% 0.0% 0.1% P16..4: 4.1% 1.2% 0.3% 0.0% 0.0% skip:92.7%
2022-05-29T07:55:11.740793+00:00 app[worker.1]: [libx264 @ 0x602fb00] final ratefactor: 32.04
2022-05-29T07:55:11.740806+00:00 app[worker.1]: [libx264 @ 0x602fb00] coded y,uvDC,uvAC intra: 11.9% 20.5% 4.4% inter: 0.4% 0.7% 0.0%
2022-05-29T07:55:11.740813+00:00 app[worker.1]: [libx264 @ 0x602fb00] i16 v,h,dc,p: 67% 13% 10% 10%
2022-05-29T07:55:11.740823+00:00 app[worker.1]: [libx264 @ 0x602fb00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 9% 27% 4% 3% 6% 2% 6% 1%
2022-05-29T07:55:11.740831+00:00 app[worker.1]: [libx264 @ 0x602fb00] i8c dc,h,v,p: 69% 5% 24% 2%
2022-05-29T07:55:11.740838+00:00 app[worker.1]: [libx264 @ 0x602fb00] kb/s:329.41
2022-05-29T07:55:11.747407+00:00 app[worker.1]: Conversion failed!
2022-05-29T07:55:12.278739+00:00 heroku[worker.1]: Process exited with status 0
2022-05-29T07:55:12.336907+00:00 heroku[worker.1]: State changed from up to crashed
2022-05-29T07:55:12.349055+00:00 heroku[worker.1]: State changed from crashed to starting
2022-05-29T07:55:18.827481+00:00 heroku[worker.1]: Starting process with command python -m pip install --upgrade pip && python -m pip install -r requirements.txt && python live_broadcast_ffmpeg.py -u postperpet -p UPryZD3SVizGF9x -f ./aa1300c95411bf4df0a0025daa7ac22945115644-480p.mp4
2022-05-29T07:55:19.422142+00:00 heroku[worker.1]: State changed from starting to up
2022-05-29T07:55:20.301726+00:00 app[worker.1]: Requirement already satisfied: pip in ./.heroku/python/lib/python3.9/site-packages (22.0.4)
2022-05-29T07:55:20.480468+00:00 app[worker.1]: Collecting pip
2022-05-29T07:55:20.507247+00:00 app[worker.1]: Downloading pip-22.1.1-py3-none-any.whl (2.1 MB)
2022-05-29T07:55:20.550986+00:00 app[worker.1]: โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” 2.1/2.1 MB 56.0 MB/s eta 0:00:00
2022-05-29T07:55:20.712965+00:00 app[worker.1]: Installing collected packages: pip
2022-05-29T07:55:20.713375+00:00 app[worker.1]: Attempting uninstall: pip
2022-05-29T07:55:20.714493+00:00 app[worker.1]: Found existing installation: pip 22.0.4
2022-05-29T07:55:20.903945+00:00 app[worker.1]: Uninstalling pip-22.0.4:
2022-05-29T07:55:20.914070+00:00 app[worker.1]: Successfully uninstalled pip-22.0.4
2022-05-29T07:55:22.226086+00:00 app[worker.1]: Successfully installed pip-22.1.1
2022-05-29T07:55:22.869585+00:00 app[worker.1]: Requirement already satisfied: ItsAGramLive in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (1.3.5)
2022-05-29T07:55:22.870501+00:00 app[worker.1]: Requirement already satisfied: pyperclip>=1.8.0 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.8.2)
2022-05-29T07:55:22.870908+00:00 app[worker.1]: Requirement already satisfied: requests in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (2.27.1)
2022-05-29T07:55:22.871634+00:00 app[worker.1]: Requirement already satisfied: Pillow==8.1.1 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 4)) (8.1.1)
2022-05-29T07:55:22.872011+00:00 app[worker.1]: Requirement already satisfied: moviepy in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (1.0.3)
2022-05-29T07:55:22.872692+00:00 app[worker.1]: Requirement already satisfied: requests-toolbelt>=0.9.1 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 6)) (0.9.1)
2022-05-29T07:55:22.873106+00:00 app[worker.1]: Requirement already satisfied: tqdm in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 7)) (4.64.0)
2022-05-29T07:55:22.873848+00:00 app[worker.1]: Requirement already satisfied: imageio==2.9.0 in ./.heroku/python/lib/python3.9/site-packages (from -r requirements.txt (line 9)) (2.9.0)
2022-05-29T07:55:22.883231+00:00 app[worker.1]: Requirement already satisfied: numpy in ./.heroku/python/lib/python3.9/site-packages (from imageio==2.9.0->-r requirements.txt (line 9)) (1.22.4)
2022-05-29T07:55:22.898521+00:00 app[worker.1]: Requirement already satisfied: idna<4,>=2.5 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (3.3)
2022-05-29T07:55:22.899607+00:00 app[worker.1]: Requirement already satisfied: urllib3<1.27,>=1.21.1 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (1.26.9)
2022-05-29T07:55:22.900645+00:00 app[worker.1]: Requirement already satisfied: certifi>=2017.4.17 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (2022.5.18.1)
2022-05-29T07:55:22.902081+00:00 app[worker.1]: Requirement already satisfied: charset-normalizer~=2.0.0 in ./.heroku/python/lib/python3.9/site-packages (from requests->-r requirements.txt (line 3)) (2.0.12)
2022-05-29T07:55:22.933368+00:00 app[worker.1]: Requirement already satisfied: decorator<5.0,>=4.0.2 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (4.4.2)
2022-05-29T07:55:22.934372+00:00 app[worker.1]: Requirement already satisfied: proglog<=1.0.0 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (0.1.10)
2022-05-29T07:55:22.935566+00:00 app[worker.1]: Requirement already satisfied: imageio-ffmpeg>=0.2.0 in ./.heroku/python/lib/python3.9/site-packages (from moviepy->-r requirements.txt (line 5)) (0.4.7)
2022-05-29T07:55:24.474433+00:00 app[worker.1]: You'r logged in
2022-05-29T07:55:26.472861+00:00 app[worker.1]: CTRL+C to quit.
2022-05-29T07:55:27.058131+00:00 app[worker.1]: ffmpeg version N-62022-g0dcbe1c1aa-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2022 the FFmpeg developers
2022-05-29T07:55:27.058140+00:00 app[worker.1]: built with gcc 8 (Debian 8.3.0-6)
2022-05-29T07:55:27.058143+00:00 app[worker.1]: configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
2022-05-29T07:55:27.058164+00:00 app[worker.1]: libavutil 57. 25.100 / 57. 25.100
2022-05-29T07:55:27.058168+00:00 app[worker.1]: libavcodec 59. 32.100 / 59. 32.100
2022-05-29T07:55:27.058169+00:00 app[worker.1]: libavformat 59. 24.100 / 59. 24.100
2022-05-29T07:55:27.058169+00:00 app[worker.1]: libavdevice 59. 6.100 / 59. 6.100
2022-05-29T07:55:27.058171+00:00 app[worker.1]: libavfilter 8. 39.100 / 8. 39.100
2022-05-29T07:55:27.058179+00:00 app[worker.1]: libswscale 6. 6.100 / 6. 6.100
2022-05-29T07:55:27.058181+00:00 app[worker.1]: libswresample 4. 6.100 / 4. 6.100
2022-05-29T07:55:27.058188+00:00 app[worker.1]: libpostproc 56. 5.100 / 56. 5.100
2022-05-29T07:55:27.073744+00:00 app[worker.1]: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './aa1300c95411bf4df0a0025daa7ac22945115644-480p.mp4':
2022-05-29T07:55:27.073749+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.073750+00:00 app[worker.1]: major_brand : isom
2022-05-29T07:55:27.073762+00:00 app[worker.1]: minor_version : 512
2022-05-29T07:55:27.073772+00:00 app[worker.1]: compatible_brands: isomiso2avc1mp41
2022-05-29T07:55:27.073789+00:00 app[worker.1]: encoder : Lavf58.29.100
2022-05-29T07:55:27.073800+00:00 app[worker.1]: comment : http://www.aparat.com/Zizi.salimi
2022-05-29T07:55:27.073850+00:00 app[worker.1]: Duration: 00:05:38.83, start: 0.000000, bitrate: 512 kb/s
2022-05-29T07:55:27.073915+00:00 app[worker.1]: Stream #0:00x1: Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 854x480 [SAR 1:1 DAR 427:240], 375 kb/s, 30 fps, 30 tbr, 1000k tbn (default)
2022-05-29T07:55:27.073916+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.073928+00:00 app[worker.1]: handler_name : VideoHandler
2022-05-29T07:55:27.073944+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:27.073981+00:00 app[worker.1]: Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
2022-05-29T07:55:27.073982+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.073992+00:00 app[worker.1]: handler_name : SoundHandler
2022-05-29T07:55:27.074010+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:27.443319+00:00 app[worker.1]: Stream mapping:
2022-05-29T07:55:27.443335+00:00 app[worker.1]: Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
2022-05-29T07:55:27.443336+00:00 app[worker.1]: Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
2022-05-29T07:55:27.443337+00:00 app[worker.1]: Press [q] to stop, [?] for help
2022-05-29T07:55:27.751411+00:00 app[worker.1]: [libx264 @ 0x7477b00] using SAR=427/135
2022-05-29T07:55:27.754328+00:00 app[worker.1]: [libx264 @ 0x7477b00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
2022-05-29T07:55:27.779379+00:00 app[worker.1]: [libx264 @ 0x7477b00] profile Constrained Baseline, level 3.1, 4:2:0, 8-bit
2022-05-29T07:55:27.788338+00:00 app[worker.1]: [libx264 @ 0x7477b00] 264 - core 164 r3094 bfc87b7 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=2 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=30 keyint_min=3 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=abr mbtree=1 bitrate=400 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1500 vbv_bufsize=6000 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
2022-05-29T07:55:27.788451+00:00 app[worker.1]: Output #0, flv, to 'rtmps://live-upload.instagram.com:443/rtmp/17867544620719597?s_sw=0&s_vt=ig&a=Abz3IvwnsqukIPaT':
2022-05-29T07:55:27.788455+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.788459+00:00 app[worker.1]: major_brand : isom
2022-05-29T07:55:27.788475+00:00 app[worker.1]: minor_version : 512
2022-05-29T07:55:27.788487+00:00 app[worker.1]: compatible_brands: isomiso2avc1mp41
2022-05-29T07:55:27.788491+00:00 app[worker.1]: comment : http://www.aparat.com/Zizi.salimi
2022-05-29T07:55:27.788504+00:00 app[worker.1]: encoder : Lavf59.24.100
2022-05-29T07:55:27.788568+00:00 app[worker.1]: Stream #0:0(und): Video: h264 ([7][0][0][0] / 0x0007), yuv420p(tv, progressive), 720x1280 [SAR 427:135 DAR 427:240], q=2-31, 400 kb/s, 30 fps, 1k tbn (default)
2022-05-29T07:55:27.788571+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.788576+00:00 app[worker.1]: handler_name : VideoHandler
2022-05-29T07:55:27.788590+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:27.788604+00:00 app[worker.1]: encoder : Lavc59.32.100 libx264
2022-05-29T07:55:27.788605+00:00 app[worker.1]: Side data:
2022-05-29T07:55:27.788622+00:00 app[worker.1]: cpb: bitrate max/min/avg: 1500000/0/400000 buffer size: 6000000 vbv_delay: N/A
2022-05-29T07:55:27.788657+00:00 app[worker.1]: Stream #0:1(und): Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp, 128 kb/s (default)
2022-05-29T07:55:27.788657+00:00 app[worker.1]: Metadata:
2022-05-29T07:55:27.788671+00:00 app[worker.1]: handler_name : SoundHandler
2022-05-29T07:55:27.788683+00:00 app[worker.1]: vendor_id : [0][0][0][0]
2022-05-29T07:55:27.788696+00:00 app[worker.1]: encoder : Lavc59.32.100 libmp3lame
2022-05-29T07:55:29.582571+00:00 app[worker.1]: frame= 1 fps=0.0 q=0.0 size= 0kB time=00:00:00.18 bitrate= 22.0kbits/s speed=0.602x
2022-05-29T07:55:29.582580+00:00 app[worker.1]: [tls @ 0x7478840] IO error: Broken pipe
2022-05-29T07:55:29.582581+00:00 app[worker.1]: av_interleaved_write_frame(): Broken pipe
2022-05-29T07:55:29.609719+00:00 app[worker.1]: Last message repeated 27 times
2022-05-29T07:55:29.609728+00:00 app[worker.1]: [flv @ 0x747dd00] Failed to update header with correct duration.
2022-05-29T07:55:29.609728+00:00 app[worker.1]: [flv @ 0x747dd00] Failed to update header with correct filesize.
2022-05-29T07:55:29.609731+00:00 app[worker.1]: Error writing trailer of rtmps://live-upload.instagram.com:443/rtmp/17867544620719597?s_sw=0&s_vt=ig&a=Abz3IvwnsqukIPaT: Broken pipe
2022-05-29T07:55:29.609750+00:00 app[worker.1]: frame= 56 fps= 26 q=-1.0 Lsize= 53kB time=00:00:02.11 bitrate= 203.2kbits/s speed=0.977x
2022-05-29T07:55:29.609765+00:00 app[worker.1]: video:76kB audio:33kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
2022-05-29T07:55:29.609781+00:00 app[worker.1]: [tls @ 0x7478840] The specified session has been invalidated for some reason.
2022-05-29T07:55:29.610838+00:00 app[worker.1]: Last message repeated 1 times
2022-05-29T07:55:29.610839+00:00 app[worker.1]: Error closing file rtmps://live-upload.instagram.com:443/rtmp/17867544620719597?s_sw=0&s_vt=ig&a=Abz3IvwnsqukIPaT: Input/output error
2022-05-29T07:55:29.612967+00:00 app[worker.1]: [libx264 @ 0x7477b00] frame I:3 Avg QP:31.10 size: 10600
2022-05-29T07:55:29.612977+00:00 app[worker.1]: [libx264 @ 0x7477b00] frame P:53 Avg QP:33.97 size: 851
2022-05-29T07:55:29.612987+00:00 app[worker.1]: [libx264 @ 0x7477b00] mb I I16..4: 90.5% 0.0% 9.5%
2022-05-29T07:55:29.612998+00:00 app[worker.1]: [libx264 @ 0x7477b00] mb P I16..4: 1.8% 0.0% 0.1% P16..4: 4.0% 1.2% 0.3% 0.0% 0.0% skip:92.7%
2022-05-29T07:55:29.613006+00:00 app[worker.1]: [libx264 @ 0x7477b00] final ratefactor: 32.04
2022-05-29T07:55:29.613017+00:00 app[worker.1]: [libx264 @ 0x7477b00] coded y,uvDC,uvAC intra: 11.7% 20.6% 4.3% inter: 0.4% 0.7% 0.0%
2022-05-29T07:55:29.613027+00:00 app[worker.1]: [libx264 @ 0x7477b00] i16 v,h,dc,p: 67% 13% 10% 10%
2022-05-29T07:55:29.613036+00:00 app[worker.1]: [libx264 @ 0x7477b00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 44% 9% 26% 4% 3% 6% 2% 6% 1%
2022-05-29T07:55:29.613046+00:00 app[worker.1]: [libx264 @ 0x7477b00] i8c dc,h,v,p: 69% 5% 24% 2%
2022-05-29T07:55:29.613054+00:00 app[worker.1]: [libx264 @ 0x7477b00] kb/s:329.61
2022-05-29T07:55:29.620735+00:00 app[worker.1]: Conversion failed!
2022-05-29T07:55:30.105881+00:00 heroku[worker.1]: Process exited with status 0
2022-05-29T07:55:30.152289+00:00 heroku[worker.1]: State changed from up to crashed

2FA login problem

Hi
When set 2FA in instagram. after enter code, get this message "Request return 500 error"

Let's Do It output with or even without user and pass... No checks?

Describe the bug
Let's Do It!

To Reproduce
Steps to reproduce the behavior:
Just start the command with or without user/password... It just outputs Let's Do It and no error. Just goes back to prompt.

Expected behavior
give more info? RTPM output?
Even disabled firewall completely

Environment (please complete the following information):

  • OS:win10
  • Python version: Python 3.7.4

Settings (please complete the following information):

  • Are you using proxy? Nope
  • Are you using two-factor authentication by text message (SMS)? Disabled it as test, same result

Additional context
Nope, Hope a debug flag can help...

portrait live

everything works fine but one problem; streaming live in portrait ๐Ÿ˜ฌ

share to IGTV

Do u think the option "share to IGTV" can be placed too in the end of the transmission after we type stop?

as in >>> "To share a replay of your live video, tap Share to IGTV at the bottom of the screen after you've ended your live video and follow the on-screen instructions"
from >> https://help.instagram.com/562982737951475

thanks , the script is amazing and stable!

ItsAGramLive Support for Headless Server?

Is it possible to pass an option/command to the python script in order to omit Pyperclip since I want to run your project in a headless (Linux) VPS?

    raise PyperclipException(EXCEPT_MSG)
pyperclip.PyperclipException: 
    Pyperclip could not find a copy/paste mechanism for your system.
    For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error 

Could it just print RTMP URL/KEY to standard output?

I'm interested in using your script with FFMPEG support: #4

login error 400

hi
i logged into the test account successfully
but now i want to login to main account for stream but it has error:
`[root@server instalive]# python3 live_broadcast.py
Let's do it!

  • ERROR(400): The username you entered doesn't appear to belong to an account. Please check your username and try again.
    <Response [400]>
    Error 400
    The username you entered doesn't appear to belong to an account. Please check your username and try again.
    `
    is there any way to logout from test account?
    i tested by another accounts but this error appeared for all.
    thanks

ANTIALIAS is deprecated

Describe the bug

when saving to IGTV - shows warning error - DeprecationWarning: ANTIALIAS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.

how can i change this line of code _ im1 = im1.resize(size, Image.ANTIALIAS) _ and use the resampling as it was mentioned ?

Environment

it does save to igtv and plays well

Thanks

live stream a video file

How can I live stream a video file Directly? Not through obs
When I copy & paste stream key to commandline and Re-stream using ffmpeg, I have problem.
Because in Instagram stream key, there are special characters and commandline has problem with it!!!!

thanks

LIVE STREAM ISSUE

wa01 | Metadata:
wa01 | major_brand : mp42
wa01 | minor_version : 0
wa01 | compatible_brands: isommp42
wa01 | encoder : Lavf58.45.100
wa01 | Stream #0:0(und): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p(progressive), 720x1280 [SAR 256:81 DAR 16:9], q=-1--1, 400 kb/s, 30 fps, 1k tbv_delay: N/A
wa01 | Stream #0:1(eng): Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp, 128 kb/s (default)
wa01 | Metadata:wa01 | creation_time : 2021-11-02T10:30:49.000000Z
wa01 | handler_name : ISO Media file produced by Google Inc. Created on: 11/02/2021.
wa01 | encoder : Lavc58.91.100 libmp3lamewa01 | frame= 7 fps=0.0 q=0.0 size= 0kB time=00:00:00.36 bitrate= 9frame= 22 fps= 22 q=0.0 size= 0kB time=00:00:00.86 bitrate= 4.2kbits/s spframe= 37 fps= 24 q=30.0 size= 14kB time=00:00:01.35 bitrate= 87.0kbits/s sframe= 52 fps= 26 q=29.0 size= 33kB time=00:00:01.83 bitrate= 149.0kbits/s sframe= 68 fps= 27 q=26.0 size= 52kB time=00:00:02.32 bitrate= 182.4kbits/s s[tls @ 0x55e0ae69a100] A TLS fatal alert has been received.wa01 | av_interleaved_write_frame(): Input/output error
wa01 | Last message repeated 1 times
wa01 | [flv @ 0x55e0ae6ccb40] Failed to update header with correct duration.
wa01 | [flv @ 0x55e0ae6ccb40] Failed to update header with correct filesize.
wa01 | Error writing trailer of rtmps://live-upload.instagram.com:443/rtmp/18192129808125107?s_sw=0&s_vt=ig&a=AbzfMuHm1EqshXw4: Input/output error
wa01 | frame= 75 fps= 26 q=26.0 Lsize= 61kB time=00:00:02.35 bitrate= 210.9kbits/s speed=0.828x
wa01 | video:34kB audio:37kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
wa01 | [tls @ 0x55e0ae69a100] The specified session has been invalidated for some reason.
wa01 | Last message repeated 1 times
wa01 | [libx264 @ 0x55e0ae6ced80] frame I:3 Avg QP:16.28 size: 5049
wa01 | [libx264 @ 0x55e0ae6ced80] frame P:72 Avg QP:24.59 size: 1592
wa01 | [libx264 @ 0x55e0ae6ced80] mb I I16..4: 96.6% 0.0% 3.4%
wa01 | [libx264 @ 0x55e0ae6ced80] mb P I16..4: 0.6% 0.0% 0.6% P16..4: 1.7% 1.2% 0.5% 0.0% 0.0% skip:95.5%
wa01 | [libx264 @ 0x55e0ae6ced80] final ratefactor: 24.44
wa01 | [libx264 @ 0x55e0ae6ced80] coded y,uvDC,uvAC intra: 12.6% 5.5% 2.2% inter: 1.4% 0.5% 0.0%
wa01 | [libx264 @ 0x55e0ae6ced80] i16 v,h,dc,p: 96% 2% 2% 0%
wa01 | [libx264 @ 0x55e0ae6ced80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 49% 8% 15% 3% 4% 10% 2% 7% 2%
wa01 | [libx264 @ 0x55e0ae6ced80] i8c dc,h,v,p: 93% 2% 5% 1%
wa01 | [libx264 @ 0x55e0ae6ced80] kb/s:415.25
wa01 | Conversion failed!

replace stream_key

hi
i use the nginx rtmp module and i want to stream to instagram by this script
and i use this code but idont know what i replaced by key stream

exec python3 /root/itsagramlive-master/live_broadcast.py;
exec /usr/bin/ffmpeg -re -i rtmp://localhost:1935/live/name -codec copy -f flv rtmp://127.0.0.1:19350/rtmp/{stream_key};
i dont know what i use instead {stream_key} ?
thanks

Can't Bypass "challenge mode" for Account Verification

Today I was trying some tests but then I was presented by the following prompt:

$ python3.6 live_broadcast.py
Let's do it!
Choose a challenge mode (0 - SMS, 1 - Email):

My Instagram account from my PC (web browser) displayed the following:
image

Got the code via email:
image

I was able to paste the code received by both SMS and email but now every time I want to use itsagramlive tool, it keeps displaying the same challenge prompt (like forever). I can't bypass it!

Below is the itsagramlive script I use:

from ItsAGramLive import ItsAGramLive

# live = ItsAGramLive()

live = ItsAGramLive(
    username='foo',
    password='bar'
)

live.start()

ffmpeg 3.3.0 (-deinterlace) command used in live_broadcast_ffmpeg.py is too old

Hi Harry Python,
you used -deinterlace in your ffmpeg command exist in live_broadcast_ffmpeg.py.
I'm trying to deploy it on heroku but heroku used amd64 static builds ubuntu & ffmpeg 3.3.0 doesn't have this build.
please update your ffmpeg command & use yadif insteed of deinterlace , because it's not work on any ffmpeg static builds.
https://www.johnvansickle.com/ffmpeg/old-releases/
you can see in above link , oldest version of ffmpeg amd64 static build is ffmpeg-4.1.4-amd64-static.tar.xz & deinterlace dead line in 3.3.0 or higher versions.
waiting for your response
finest regards

Use ffmpeg for live

The following code is related to the live stream of the file using ffmpeg via LevPasha/Instagram-API-python.
LevPasha/Instagram-API-python is dead!
Can you look at it and add this feature to your beautiful code?
Thanks a lot
Sincerely

`#!/usr/bin/env python

-- coding: utf-8 --
Use text editor to edit the script and type in valid Instagram username/password
import subprocess

from InstagramAPI import InstagramAPI

USERNAME = ''
PASSWORD = ''
FILE_PATH = ''
PUBLISH_TO_LIVE_FEED = False
SEND_NOTIFICATIONS = False

api = InstagramAPI(USERNAME, PASSWORD, debug=False)
assert api.login()

first you have to create a broadcast - you will receive a broadcast id and an upload url here
assert api.createBroadcast()
broadcast_id = api.LastJson['broadcast_id']
upload_url = api.LastJson['upload_url']

we now start a boradcast - it will now appear in the live-feed of users
assert api.startBroadcast(broadcast_id, sendNotification=SEND_NOTIFICATIONS)

ffmpeg_cmd = "ffmpeg -rtbufsize 256M -re -i '{file}' -acodec libmp3lame -ar 44100 -b:a 128k -pix_fmt yuv420p -profile:v baseline -s 720x1280 -bufsize 6000k -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -preset veryfast -g 30 -r 30 -f flv '{stream_url}'".format(
file=FILE_PATH,
stream_url=upload_url,
)

print("Hit Ctrl+C to stop broadcast")
try:
subprocess.call(ffmpeg_cmd, shell=True)
except KeyboardInterrupt:
print('Stop Broadcasting')

assert api.stopBroadcast(broadcast_id)

print('Finished Broadcast')

if PUBLISH_TO_LIVE_FEED:
api.addBroadcastToLive(broadcast_id)
print('Added Broadcast to LiveFeed')
`

Infinity Checkpoint

I got infinity checkpoint, I've clicked "this was me" but when I start to login, it happened again. Please add verify method by phone or email

Web Version

Is your feature request related to a problem? Please describe.
to some people especially non-tech users, it can be hard installing and operating the python script on their machines.

Describe the solution you'd like
I have a plan to make a web version of it with Django Framework, so all users can operate it with just a click and hosted it on somewhere else without need to type a certain command on their terminal every time they want to live ig.

Additional context
It's the same like yellowduck.tv but opensource and built with python.

I need your suggestions
I need your suggestion to make the project possible. like how will the login functionality works on web? are we gonna use requests? or instagram client login like yellowduck.tv?

Thank You

Problem saving replay to story

I use Itsagramlive for about 5 months now and work perfectly until a couple weeks ago.
Now when I finish a live (I use OBS) I type STOP in the command and then press the Y key to save the replay to story, but the CMD show me the following error:

  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
    ....
    ...
    ..
    (It follow with the same error every 60sec)

When I press ctrl + C (to stop the script) it say the following lines:

Traceback (most recent call last):
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 183, in send_request
self.LastJson = json.loads(self.LastResponse.text)
File "c:\Python3\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "c:\Python3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\Python3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\python3\IG\valparaisoprofundo.py", line 11, in
live.start()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 248, in start
self.stop()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 425, in stop
self.add_to_post_live()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 407, in add_to_post_live
if self.send_request(endpoint='live/{}/add_to_post_live/'.format(self.broadcast_id),
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 188, in send_request
time.sleep(60)
KeyboardInterrupt
^C

Theres any fix to this? It start happens a couple weeks ago
I use an HP ProBook 640 G2 (i7 6600U / 12GB RAM DDR4 1333MHz / integrated graphics / Samsung EVO750 SSD) with the latest version of OBS and python3

Possible to use multiple instances of ItsAGram from same IP/machine?

I have 2 bash scripts. One gets the IG stream key from ItsAGram and then passes the key to ffmpeg to start streaming to IG, the other script monitors until the ffmpeg process ends and then automatically input ItsAGram commands to stop and save to IGTV... Of course, all this running on the same machine.

Now, my question is: Is it possible to use more than 2 instances of ItsAGram (2+ different IG logins) from the same machine/IP? Would ItsAGram let me do that? Would be there a suspicious activity detected by IG?

ffmpeg rtmps Resource temporarily unavailable

Describe the bug
When I try to use the ffmpeg example, then ffmpeg always crashes with the following error

[rtmps @ 0x182c130] Cannot open connection tls://live-upload.instagram.com:443
rtmps://live-upload.instagram.com:443/rtmp/XXXXXXXXXX?s_sw=0&s_vt=ig&a=XXXXXXXXXX: Resource temporarily unavailable

I initially tried to run it with fmpeg version 4.1.6-1~deb10u1+rpt2 then I compiled my own newer ffmpeg version 4.4 with --enable-openssl in hopes of fixing it, but sadly nothing.
Could this be a problem in the stream key retrieval of itsagramlive or is maybe still something wrong in my ffmpeg setup?
Maybe the URL path of Instagram live also changed, I really don't know anymore.

I think it is ssl/tls related but I am not sure how to fix it. Maybe some tls library is too old on my system

To Reproduce
Steps to reproduce the behavior:

  1. Run ffmpeg example python script like shown in readme

Expected behavior
The stream to be able to start (ffmpeg running)

Environment (please complete the following information):

  • OS: Raspbian GNU/Linux 10 (buster)
  • Python version: 3.7.3

Settings (please complete the following information):
No proxy and no two factor in this account

Additional context

The Instagram account I am using is fairly new (created today) but I was able to start a stream from my phone

Autorotate stream from 16:9 to 9:16 for IG

Hi I'm streaming to Youtube, Facebook and Instagram with restream and OBS. Stream is in 16:9 aspect ratio. Is there a feature to rotate input stream only for IG so it would be 9:16?

ERROR(400) on login

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [Fedora30]
  • Python version: [python3.7]

Settings (please complete the following information):

  • Are you using proxy? no
  • Are you using two-factor authentication by text message (SMS)? no
  • Are you using two-factor authentication by a third party authentication app (such as Duo Mobile or Google Authenticator)? no

Hello. I tried to get stream key and run :

python3 live_broadcast.py -u xxxxxxx -p xxxxxxx

but result was:

Let's do it!
* ERROR(400): To secure your account, we've reset your password. Tap "Get help signing in" on the login screen and follow the instructions to access your account.
<Response [400]>
Error 400
To secure your account, we've reset your password. Tap "Get help signing in" on the login screen and follow the instructions to access your account.

Problem finishing live

I use Itsagramlive for about 9 months now and work perfectly until a couple days ago.
Now when I finish a live (I use OBS) I type STOP in the command and then press the Y key to save the replay to IGTV or even the N key to not save anything but the CMD show me the following error:

  • Except on SendRequest (wait 60 sec and resend): Expecting value: line 1 column 1 (char 0)
  • ...
  • and repeat the same lines after 60sec

when I press ctrl + C to finish the script it says the following lines

Traceback (most recent call last):
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 190, in send_request
self.LastJson = json.loads(self.LastResponse.text)
File "c:\Python3\lib\json_init_.py", line 357, in loads
return _default_decoder.decode(s)
File "c:\Python3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\Python3\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\python3\IG\test.py", line 11, in
live.start()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 255, in start
self.stop()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 488, in stop
self.delete_post_live()
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 473, in delete_post_live
if self.send_request(endpoint='live/{}/delete_post_live/'.format(self.broadcast_id),
File "c:\Python3\lib\site-packages\ItsAGramLive\ItsAGramLive.py", line 195, in send_request
time.sleep(60)

Theres an update or something to fix this problem?
Im an sound engineer and due to covid I cant work doing live and big concerts like I always do, so this my only job now and you really help me a lot with this script
Thanks for all your hard work!

KeyError: 'logged_in_user' when trying to login

Description
When trying to run live.start() the program returns a KeyError:

logging in...
Traceback (most recent call last):
  File "live_broadcast.py", line 5, in <module>
    live.start()
  File "/home/User/Documents/itsagramlive/ItsAGramLive/ItsAGramLive.py", line 197, in start
    if self.login():
  File "/home/User/Documents/itsagramlive/ItsAGramLive/ItsAGramLive.py", line 106, in login
    self.username_id = self.LastJson["logged_in_user"]["pk"]
KeyError: 'logged_in_user'

Steps to reproduce the behavior:

  1. Checkout the latest version, at the moment 1.2.2
  2. run python3 live_broadcast.py -u yourInstagramUsername -p yourPassword

Expected behavior
Logging in, asking for 2FA Code.

Additional Information
Instagram Account has 2FA with Google Authenticator App enabled
Already tested disabling 2FA

Does it work with Two Factor activated?

Describe the bug
Could it be that it doesnt work when Two Factor is activated?

It always says Let's Do It! but nothing else.

Not sure what else I can say.
But I get no error, just the Let's Do It!, but no keys...

Error on saving post to igtv

Hi
I was testing the new feature of saving post to IGTV and there is an error

  • ERROR(202): Transcode not finished yet.
    <Response [202]>
    Can you please check that ?

Please check the screenshot below
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.