Brannydonowt / autoinsta

Python-Based Automated Instagram Accounts. Create and Grow Instagram Accounts Automatically.
MIT License
21 stars 3 forks source link

AttributeError: module 'ctypes' has no attribute 'windll' #3

Closed bugbounted closed 2 years ago

bugbounted commented 2 years ago

Hello again Brannydonowt, after fetch & merge your latest commit 334e4fe to my fork & re-clone it to my ubuntu 22.04 server get error below ::
(venv) root@server-virtual-machine:~/autoinsta# python bot.py Traceback (most recent call last): File "/root/autoinsta/bot.py", line 3, in <module> import instagram File "/root/autoinsta/instagram.py", line 6, in <module> import autoit File "/root/autoinsta/venv/lib/python3.10/site-packages/autoit/__init__.py", line 6, in <module> from .autoit import options, properties, commands File "/root/autoinsta/venv/lib/python3.10/site-packages/autoit/autoit.py", line 28, in <module> AUTO_IT = ctypes.windll.LoadLibrary(dll_path) AttributeError: module 'ctypes' has no attribute 'windll'

& after search to reslove it on stackoverflow find answer below : It seems like you're trying to use a Windows module on a non Windows enviroment, if you check the ctype module it has some conditional classes:

if _os.name == "nt":

class WinDLL(CDLL):
    """This class represents a dll exporting functions using the
    Windows stdcall calling convention.

[...] https://docs.python.org/3/library/ctypes.html short link of answer:https://stackoverflow.com/a/65355716

please change code to compatble with linux os waiting for your response finest regards

Brannydonowt commented 2 years ago

Interesting.

AutoIt is a windows only library AFAIK. It is used for inputting a file path when uploading a video to instagram.

I'll try to figure out if there's a way to do this via selenium instead.

Brannydonowt commented 2 years ago

Since Instagram doesn't use a standard "input" field for adding a file path for upload - I have to make use of system input in order to specify an upload path.

AutoIt would be the quick way to do this on Windows, however that is Windows specific.

Instead, I'll implement a cross-platform robot library and fingers crossed I should be able to just set the clipboard data and paste it in there.

Brannydonowt commented 2 years ago

It looks like I've found a way around this issue - testing and committing now.

Brannydonowt commented 2 years ago

Fixed in latest master.

Now using SendKeys on the hidden input : file, instead of AutoIt.

Docker integration still WIP