async def createvideo():
img_array = []
l = glob.glob('result/*.png')
r = '(\d{1,3})'
out={int(re.search(r,x).group(0)):x for x in l}
for number in sorted(out.keys()):
filename=out[number]
img = cv2.imread(filename)
height, width, layers = img.shape
size = (width,height)
img_array.append(img)
out = cv2.VideoWriter('project.avi',cv2.VideoWriter_fourcc(*'DIVX'), 15, size)
for i in range(len(img_array)):
out.write(img_array[i])
out.release()
import instaloader
L = instaloader.Instaloader()
a = L.download_videos('https://www.instagram.com/tv/Cf5oKtkqsN6/?igshid=YmMyMTA2M2Y=')