GitFive
GitFive copied to clipboard
Error while getting following
$ GitFive user soxoj
Account is PEA : False
Traceback (most recent call last):
File "/Users/account/.local/bin/GitFive", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/gitfive.py", line 15, in main
parse_args()
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/cli.py", line 51, in parse_args
trio.run(username_mod.hunt, args.username, args.json)
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/trio/_core/_run.py", line 1946, in run
raise runner.main_task_outcome.error
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/modules/username_mod.py", line 150, in hunt
runner.target.potential_friends = await close_friends.guess(runner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/close_friends.py", line 43, in guess
new_pea_cache = await pea.analyze(runner, usernames)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/pea.py", line 25, in analyze
async with trio.open_nursery() as nursery:
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/trio/_core/_run.py", line 813, in __aexit__
raise combined_error_from_nursery
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/pea.py", line 39, in is_pea
not await is_followed_or_following_a_lot(runner, username):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/account/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/pea.py", line 54, in is_followed_or_following_a_lot
followers = int(followers.text.replace('k', '00').replace('.', '').split(' ')[0].strip('\n')) if followers else 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
I will kms why do you get all the errors 😭 They maybe changed a few things very recently, I'll try to take a look
Im also getting it 🥺 But not coming from the same file
Account is PEA : False
Traceback (most recent call last):
File "/Users/n/.local/bin/gitfive", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/gitfive.py", line 15, in main
parse_args()
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/cli.py", line 51, in parse_args
trio.run(username_mod.hunt, args.username, args.json)
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/trio/_core/_run.py", line 1946, in run
raise runner.main_task_outcome.error
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/modules/username_mod.py", line 150, in hunt
runner.target.potential_friends = await close_friends.guess(runner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/close_friends.py", line 36, in guess
target["followers"] = await social.get_follows(runner, "followers")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/social.py", line 23, in get_follows
followers = int(followers.text.replace('k', '00').replace('.', '').split(' ')[0].strip('\n')) if followers else 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
Mine is coming from their recent add of the followed by <...> under the informations of someone. If I print the followers variable from here:
https://github.com/mxrch/GitFive/blob/9213e87ae6bb59a5789b64b00f4d5aa80cbd1efd/gitfive/lib/social.py#L22
It prints that before raising the error:
<a class="Link--secondary no-underline no-wrap pl-1" data-analytics-event='{"category":"Mutual Followers","action":"View follows","label":"current_user_id:xxxx;logged_in:true;user:xxxx"}' href="/USERNAME?tab=followers">
Followed by <span class="Truncate-text text-bold">USER I FOLLOW</span>
</a>
Traceback (most recent call last):
File "/Users/n/.local/bin/gitfive", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/gitfive.py", line 15, in main
parse_args()
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/cli.py", line 51, in parse_args
trio.run(username_mod.hunt, args.username, args.json)
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/trio/_core/_run.py", line 1946, in run
raise runner.main_task_outcome.error
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/modules/username_mod.py", line 150, in hunt
runner.target.potential_friends = await close_friends.guess(runner)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/close_friends.py", line 36, in guess
target["followers"] = await social.get_follows(runner, "followers")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/n/.local/pipx/venvs/gitfive/lib/python3.11/site-packages/gitfive/lib/social.py", line 24, in get_follows
followers = int(followers.text.replace('k', '00').replace('.', '').split(' ')[0].strip('\n')) if followers else 0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
I was able to fix it by replacing the line I cited upper by:
followers = body.find(lambda tag: tag.name == "a"
and tag.get("href") == f"/{runner.target.username}?tab={to_scrape}"
and "pl-1" not in tag.get("class", [])
and "data-analytics-event" not in tag.attrs)