Divdude77 / Instagram-Page-Automator

Automate your instagram meme page using this program! This script takes memes from reddit after every specified time interval and automatically posts it to your instagram meme page!
MIT License
28 stars 6 forks source link

couldnt post #2

Closed mamorutakamura closed 2 years ago

mamorutakamura commented 3 years ago

Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 138, in if daysdiff(i[1]) >= 30: IndexError: list index out of range 2021-08-04 17:13:54,621 - INFO - Total requests: 33 this is the error does anyone know how to fix it?

Divdude77 commented 3 years ago

Hey!

Please make sure you have atleast one sample record in the file posted.csv You can download the one I have provided.

Try it and let me know

mamorutakamura commented 3 years ago

i already did download urs the excel file with a sample but it still isnt working

Divdude77 commented 3 years ago

Hmm... Could you type: print(i) after line 137: for i in csv.reader(f): and send the output?

mamorutakamura commented 3 years ago

well i dont know what changed but now im getting this Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 7, in from PIL import Image ModuleNotFoundError: No module named 'PIL'

mamorutakamura commented 3 years ago

and when i try to install PIL from pycharm it wont work

mamorutakamura commented 3 years ago

well fixed the PIL issue but now i get this Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 64, in submitted_memes.append(i[0]) IndexError: list index out of range 2021-08-05 21:09:23,084 - INFO - Total requests: 31

mamorutakamura commented 3 years ago

and after putting the print(i)n as you've asked this is the output Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 65, in submitted_memes.append(i[0]) IndexError: list index out of range 2021-08-05 21:11:29,680 - INFO - Total requests: 31

hope you can help me with it

Divdude77 commented 3 years ago

Hold up, this error says that

submitted_memes.append(i[0])

is on line 65. Did you change the code? Also, the error is still related to the posted.csv file. Could you put print(i) before submitted_memes.append(i[0]) and pls send output

mamorutakamura commented 3 years ago

nope the code is unchanged i just removed the comments at the top thats why the lines changed. and this is the output bro 2021-08-05 23:12:34,437 - INFO - Instabot version: 0.117.0 Started 2021-08-05 23:12:34,444 - INFO - Not yet logged in starting: PRE-LOGIN FLOW! 2021-08-05 23:12:53,560 - INFO - Logged-in successfully as 'memeguack'! 2021-08-05 23:12:53,560 - INFO - LOGIN FLOW! Just logged-in: True ['sample', '2021-06-31'] ['oxn024', '2021-08-04'] [] Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 65, in submitted_memes.append(i[0]) IndexError: list index out of range 2021-08-05 23:13:57,509 - INFO - Total requests: 31

mamorutakamura commented 3 years ago

i really have no idea why i'm getting this error even tho i downloaded the sample csv file that you gave

mamorutakamura commented 3 years ago

i removed the oxn024 from the csv file i legit have no idea how it even got there lol but the output is now C:\Instagram-Page-Automator-main>python memepage.py 2021-08-05 23:16:01,028 - INFO - Instabot version: 0.117.0 Started 2021-08-05 23:16:01,030 - INFO - Not yet logged in starting: PRE-LOGIN FLOW! 2021-08-05 23:16:08,602 - INFO - Logged-in successfully as 'memeguack'! 2021-08-05 23:16:08,602 - INFO - LOGIN FLOW! Just logged-in: True ['sample', '2021-06-31'] ['', ''] FOUND: w:1919 h:2420 r:0.7929752066115703 2021-08-05 23:16:51,976 - ERROR - Photo does not have a compatible photo aspect ratio. 2021-08-05 23:16:51,977 - INFO - Photo 'meme.jpg' is not uploaded. Traceback (most recent call last): File "C:\Instagram-Page-Automator-main\memepage.py", line 130, in if daysdiff(i[1]) >= 30: File "C:\Instagram-Page-Automator-main\memepage.py", line 48, in daysdiff d1 = [int(i) for i in day.split('-')] File "C:\Instagram-Page-Automator-main\memepage.py", line 48, in d1 = [int(i) for i in day.split('-')] ValueError: invalid literal for int() with base 10: '' 2021-08-05 23:16:52,006 - INFO - Total requests: 31

Really sorry for the hassle man but im still very new to coding thank you so much for all the help :)

Divdude77 commented 3 years ago

Hey,

Delete the 2nd record in posted.csv which is just a comma and try again...

mamorutakamura commented 3 years ago

i did and i constantly get this error FOUND: w:720 h:882 r:0.8163265306122449 2021-08-07 13:10:03,777 - INFO - Photo 'meme.jpg' is uploaded. Traceback (most recent call last): File "C:\Projects\Instagram-Page-Automator-main\memepage.py", line 138, in if daysdiff(i[1]) >= 30: File "C:\Projects\Instagram-Page-Automator-main\memepage.py", line 58, in daysdiff d1 = [int(i) for i in day.split('-')] File "C:\Projects\Instagram-Page-Automator-main\memepage.py", line 58, in d1 = [int(i) for i in day.split('-')] ValueError: invalid literal for int() with base 10: '' 2021-08-07 13:10:03,801 - INFO - Total requests: 33

mamorutakamura commented 3 years ago

keep in mind that the csv file is comma delimited btw i dont know if that matters

Divdude77 commented 3 years ago

Yeah the csv file is supposed to be comma delimited. Could you send a screenshot of your .csv file? I ran the code and got no error...

mamorutakamura commented 3 years ago

ofcourse https://imgur.com/a/ELQ9PjI i really have no idea why it isn't working and thank you for all the help man

Divdude77 commented 3 years ago

hmm could you right click on the file and open with notepad? no probs :)

mamorutakamura commented 3 years ago

ofcourse here it is i guess i should delete the 3 commas? haha https://imgur.com/a/zrCVyPR

mamorutakamura commented 3 years ago

i did and i also got this error after removing the 3 commas from the noted pad FOUND: w:1024 h:1536 r:0.6666666666666666 2021-08-07 21:38:43,587 - ERROR - Photo does not have a compatible photo aspect ratio. 2021-08-07 21:38:43,588 - INFO - Photo 'meme.jpg' is not uploaded. Traceback (most recent call last): File "C:\Projects\Instagram-Page-Automator-main\memepage.py", line 138, in if daysdiff(i[1]) >= 30: IndexError: list index out of range 2021-08-07 21:38:43,608 - INFO - Total requests: 31

mamorutakamura commented 3 years ago

the issue is definitely from the csv file i just can't pinpoint where and why

Divdude77 commented 3 years ago

Haha same Could you share the output with print(i) Right after for i in csv.reader(f):

mamorutakamura commented 3 years ago

sure 2021-08-09 11:02:46,851 - WARNING - ('Connection broken: OSError("(10053, \'WSAECONNABORTED\')")', OSError("(10053, 'WSAECONNABORTED')")) FOUND: w:3464 h:3464 r:1.0 2021-08-09 11:03:55,136 - INFO - Photo 'meme.jpg' is uploaded. ['Sample\t8/9/2021'] Traceback (most recent call last): File "C:\Projects\Instagram-Page-Automator-main\memepage.py", line 139, in if daysdiff(i[1]) >= 30: IndexError: list index out of range 2021-08-09 11:03:55,152 - INFO - Total requests: 33

ShrimantaGarain commented 3 years ago

after adding print(i)

edited below code

f = open("posted.csv","r")
currrentdata = []
for i in csv.reader(f):
    print(i)
    if daysdiff(i[1]) >= 30:
        continue
    else:
        currrentdata.append(i)
f.close()
f = open("posted.csv","w")
csv.writer(f).writerows(currrentdata)
f.close()

below terminal output

2021-08-22 01:16:06,929 - INFO - Instabot version: 0.117.0 Started 2021-08-22 01:16:06,930 - INFO - Not yet logged in starting: PRE-LOGIN FLOW! 2021-08-22 01:16:10,845 - INFO - Logged-in successfully as 'kyrusgg'! 2021-08-22 01:16:10,846 - INFO - LOGIN FLOW! Just logged-in: True Traceback (most recent call last): File "c:\Users\shrim\Downloads\Instagram-Page-Automator-main\bot\memepage.py", line 73, in submitted_memes.append(i[0]) IndexError: list index out of range2021-08-22 01:16:24,652 - INFO - Total requests: 31 PS C:\Users\shrim\Downloads\Instagram-Page-Automator-main\bot>

Divdude77 commented 3 years ago

Sorry for the late response,

KyrusGG are you using the posted.csv file with a sample value?

mamorutakamura could you execute this code and send the output: from datetime import date print(date.today()).split('-'))