Skip to main content

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

Release files for itsagramlive 1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for itsagramlive 1.6
File Size Uploaded
ItsAGramLive-1.6.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for itsagramlive 1.6
File Interpreter ABI Platform
ItsAGramLive-1.6-py3-none-any.whl Python 3 none any Details

Total release size:29.9 kB

Release files / ItsAGramLive-1.6.tar.gz

Download URL ItsAGramLive-1.6.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cd22f66a6ad200fb8406ed3817280c20e17bc36c3b25a2129702ead0b5f28912
BLAKE2b-256 checksum
How to use checksums
bf5cd4c75862737abdcc7ab2e0f868e025a97822b1c329bd6a07756e368172ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.0 importlib_metadata/3.7.3 packaging/20.8 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.10

Release files / ItsAGramLive-1.6-py3-none-any.whl

Download URL ItsAGramLive-1.6-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
443846f60627f7b5f9c4b2c6ba9e0d446da9dfdc0dfdc9c04376876d589cb330
BLAKE2b-256 checksum
How to use checksums
7b559f288aea546306be7994334159fd3574903e511c256867ed13853b72333b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.0 importlib_metadata/3.7.3 packaging/20.8 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.10

Release history Release notifications | RSS feed

This release

1.6 This release

2 release files

1.5.5

2 release files

1.4.5

2 release files

1.4.4

2 release files

1.4.3

2 release files

1.4.1

2 release files

1.4

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page