instagram / instagram.py
exact-railcar's picture
Update instagram.py
27aa37f verified
raw
history blame contribute delete
709 Bytes
import aiohttp.web, asyncio, pathlib, uvloop
async def main():
app = aiohttp.web.Application()
app.add_routes([aiohttp.web.static('/', pathlib.Path(__file__).resolve().parent, show_index=True)])
runner = aiohttp.web.AppRunner(app)
await runner.setup()
site = aiohttp.web.TCPSite(runner, port=7860)
await site.start()
while True:
ffmpeg = await asyncio.create_subprocess_exec('ffmpeg', '-stream_loop', '-1', '-re', '-i', 'video.mp4', '-c', 'copy', '-f', 'flv', 'rtmps://edgetee-upload-sjc6-1.xx.fbcdn.net:443/rtmp/18101895649691126?s_bl=1&s_fbp=lax7-1&s_ow=10&s_prp=sjc6-1&s_sw=0&s_tids=1&s_vt=ig&a=Ab348wcvKr_ZK_M__DcyGcw5')
await ffmpeg.wait()
uvloop.run(main())