Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to save account progress, skipping data update b"invalid literal for int() with base 10: '23\\nfollowers'" #6786

Open
smokehubde opened this issue Jan 25, 2024 · 6 comments

Comments

@smokehubde
Copy link

I Need help :(

[Session lasted 1.53 minutes]
INFO [2024-01-25 02:55:44] [smokehub_performance] Session ended!
INFO [2024-01-25 02:56:34] [smokehub_performance] Session started!
INFO [2024-01-25 02:56:41] [smokehub_performance] - Cookie file for user 'smokehub_performance' loaded...
WARNING [2024-01-25 02:56:54] [smokehub_performance] - Issue with cookie for user 'xxxxx'. Creating new cookie...
INFO [2024-01-25 02:56:54] [smokehub_performance] - Deleting browser cookies...
WARNING [2024-01-25 02:57:04] [smokehub_performance] Login A/B test detected! Trying another string...
WARNING [2024-01-25 02:57:09] [smokehub_performance] Could not pass the login A/B test. Trying last string...
INFO [2024-01-25 02:57:46] [smokehub_performance] Logged in successfully!
INFO [2024-01-25 02:57:46] [smokehub_performance] Saving account progress...
WARNING [2024-01-25 02:57:49] [smokehub_performance] Unable to save account progress, skipping data update
b"invalid literal for int() with base 10: '23\nfollowers'"
INFO [2024-01-25 02:57:52] [smokehub_performance] Sessional Live Report:
|> No any statistics to show

[Session lasted 1.41 minutes]

@bagusbadar
Copy link

im currently stuck on this too

@mehdimim
Copy link

Me too

@mauriciotomim
Copy link

Same issue here: b"invalid literal for int() with base 10: '508\\nfollowers'"

@thegreatref
Copy link

Same problem

@thegreatref
Copy link

thegreatref commented Apr 11, 2024

The function is in this path
"C:\Users<Computer>\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\instapy\util.py"

Replace the function with this

def getUserData(
query,
browser,
basequery="no-longer-needed",
):
shared_data = get_shared_data(browser)

# Ensure shared_data is not None before accessing its attributes
if shared_data is not None:
    entry_data = shared_data.get("entry_data")
    if entry_data:
        profile_page = entry_data.get("ProfilePage")
        if profile_page:
            data = profile_page[0]
        else:
            data = get_additional_data(browser)
    else:
        data = get_additional_data(browser)
else:
    data = get_additional_data(browser)

if data:
    if query.find(".") == -1:
        data = data.get(query)
    else:
        subobjects = query.split(".")
        for subobject in subobjects:
            data = data.get(subobject)
else:
    data = None

return data

@jglatts
Copy link

jglatts commented Apr 11, 2024

For a quick-and-dirty fix, wrap the statement in a try\except block:

  try:
      session = InstaPy(username=username, password=password)
      session.login()
  except AttributeError as e:
      print(e)

Also, the Instagrapi is a working alternative to this library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants