mercredi 25 août 2021

ERROR when trying to upload a video on Instagram

Hey first sorry for my bad english!! I am trying to run a code that upload randomly a video that there are in my folder automatically on my instagram profile, but it occurs an error.

This error: Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\imageio\plugins\ffmpeg.py", line 81, in get_exe exe = get_remote_file('ffmpeg/' + FNAME_PER_PLATFORM[plat], File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\imageio\core\fetching.py", line 102, in get_remote_file raise NeedDownloadError() imageio.core.fetching.NeedDownloadError

import random
from instabot import Bot
import os, glob
from pathlib import Path
import shutil


cookie_del = glob.glob("config/*cookie.json")
os.remove(cookie_del[0])


bot = Bot()

sent_videos = []


def upload(path):
     bot.login(username= '', password='')
     bot.upload_video(path, caption='😍 ')
     sent_videos.append(path)


while True:
    group_of_items = os.listdir("C:/Users/user/Desktop/teste/PICS")
    num_selet = 1
    list_of_random = random.sample(group_of_items, num_selet)
    first_random = random.choice(group_of_items)
    path = "C:/Users/user/Desktop/teste/PICS/" + str(first_random)
    if path in sent_videos:
        continue
   else:
      path.endswith('.mp4')
      upload(path)



Aucun commentaire:

Enregistrer un commentaire