yurilaaziz / neo-instabot

Neo-Instabot is a free project. Forked from instabot.py. It uses the Instagram Web/Mobile API.
Other
37 stars 22 forks source link

json decoder error #28

Open guestofhonor3000 opened 4 years ago

guestofhonor3000 commented 4 years ago

Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])

Select one:

Environment

Include more details about the environment

Operating System? (include version)

include the output of 'uname -a'

Linux instanceig 5.3.0-1029-gcp #31~18.04.1-Ubuntu SMP Mon Jun 22 15:24:52 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Python Version Requirement

Exact Python Version?

Include here the response of 'python --version' or 'python3 --version'

Python 3.6.9

Pip Version?

Include here the response of 'pip --version' or 'pip3 --version'

pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)

Instabot Version?

Include here the response of 'instabot-py --version'

Installed version 0.6.0

How you use the instabot

Description of your issue

Include the contents of the error.log here (if applicable). < REPLACE THIS TEXT

Config

Ensure that you specify the configuration file in the command line.
Ensure that the default file instabot.config.yml contains only common settings if you use multiple accounts.
Include the contents of your config here (instabot-py -c config.yml --dump) (REMOVE YOUR USERNAME AND PASSWORD!) (if applicable). < REPLACE THIS TEXT

Traceback (most recent call last): File "/home/puscasu_and/.local/bin/neo-instabot", line 11, in sys.exit(main()) File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/main.py", line 330, in main bot = InstaBot(config=config) File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/bot.py", line 198, in init self.login() File "/home/puscasu_and/.local/lib/python3.6/site-packages/instabot/bot.py", line 301, in login loginResponse = login.json() File "/home/puscasu_and/.local/lib/python3.6/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.6/json/init.py", line 354, in loads return _default_decoder.decode(s) File "/usr/lib/python3.6/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

marcelofox commented 4 years ago

It seems that Instagram changed their login request method..

In the past it was a json containing user and password..

Now it's a form_data and the password goes in a variable "enc_password". It looks like it had some kind of a encryption on it: enc_password: #PWD_INSTAGRAM_BROWSER:10:1595532093:ASxQAHEUCEkXhA/kAjPsp3blL5vYRG+HaY+9MSPe4ISIvHlrbUDLo7s5I50eDVf1+ioOVp1aPuBSY7QWlowgYP+Wr0PcWmkNlpO58qHj/PonaYV5xiX6lOW01x5ZXqAyVS00WWOPT/tRjpS4ACY=

:(

v0lumehi commented 4 years ago

There appears to be a change in the sent authentication request. Instagram is now using the password string in the "enc_password" key. The encryption is evp_aes_256_gcm. Someone has to write a method to generate the enc_password string

marcelofox commented 4 years ago

I'm trying to implements the encryptation algorithm. I'm struggling with the AES GMC python implementation .. cause if you see how instagram implemented their encryption , it's something like this:

A.subtle.encrypt(p, t, h.buffer);

Where:

p = { "additionalData":"1596161418", "name":AES-GMC", "tagLen":16 }

t= Instance of CriptoKey

h= byte array of your password.

In Python the package Crypto.Cipher has and implementation of AES-GMC.. but there's no way to pass the additionalData do the encrypt_and_digest method.

Checking the javascript documentation : https://developer.mozilla.org/en-US/docs/Web/API/AesGcmParams

additionalData Optional A BufferSource. This contains additional data that will not be encrypted but will be authenticated along with the encrypted data. If additionalData is given here then the same data must be given in the corresponding call to decrypt(): if the data given to the decrypt() call does not match the original data, the decryption will throw an exception. This gives you a way to authenticate associated data without having to encrypt it.

Even though it's not used in the encryption, it's used with the autentication of the data .. so I'm trying to find a implementation in Python that provides additionalData as part of the encryption.

sohartma commented 4 years ago

Having the same login error... Tried different bots with different accounts. It's always the same:

loginResponse = login.json() File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

kevinours commented 4 years ago

just got the same error. is it fixable ?

stefanoregis commented 4 years ago

same error here, any solution?