snbig / instatrack Goto Github PK
View Code? Open in Web Editor NEWConvert Instagram user ID to username & vice versa
License: MIT License
Convert Instagram user ID to username & vice versa
License: MIT License
I tried to explain to the Instaloader devs that it might be useful to have the option to use a userID as input since the ID never changes.
As of right now we still have to convert ids and names completely manually etc.
python InstaTracker.py -i 534895514
comes back with
File "InstaTracker.py", line 138, in
main()
File "InstaTracker.py", line 121, in main
username = useridToUsername(args.id)
File "InstaTracker.py", line 58, in useridToUsername
checkTokens()
File "InstaTracker.py", line 18, in checkTokens
getTokens()
File "InstaTracker.py", line 28, in getTokens
query_hash = re.findall(r'{value:!0});const o="(.*?)"', r)[0]
When nicknames with periods, underscores and other symbols are found in a text document, they are skipped by the script.
I have encounter with this:
Traceback (most recent call last):
File "C:\Users\dell\Desktop\InstaTrack-master\InstaTracker.py", line 136, in <module>
main()
File "C:\Users\dell\Desktop\InstaTrack-master\InstaTracker.py", line 119, in main
username = useridToUsername(args.id)
File "C:\Users\dell\Desktop\InstaTrack-master\InstaTracker.py", line 63, in useridToUsername
j = json.loads(r.text)
File "C:\Python39\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Python39\lib\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)
when I try to convert id to username. (convert username to id is fine)
Is there anybody encounter with this?
Seems something wrong with json.loads
Thanks so much for creating this tool!
Traceback (most recent call last):
File "InstaTracker.py", line 45, in
print(useridToUsername("<>"))
File "InstaTracker.py", line 24, in useridToUsername
rhx_gis = json.loads(re.compile('window._sharedData = ({.*?});', re.DOTALL).search(r1).group(1))['rhx_gis']
KeyError: 'rhx_gis'
C:\Users\cyb3r>python InstaTracker.py -i 7334396907
Traceback (most recent call last):
File "C:\Users\cyb3r\InstaTracker.py", line 130, in
main()
File "C:\Users\cyb3r\InstaTracker.py", line 113, in main
username = useridToUsername(args.id)
File "C:\Users\cyb3r\InstaTracker.py", line 59, in useridToUsername
if json.loads(r).get("status") != 'ok':
File "C:\Users\cyb3r\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\cyb3r\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\cyb3r\AppData\Local\Programs\Python\Python39\lib\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)
Hi,
Could you add an argument so it would be possible to pass a .txt file containing id numbers of instagram users (one in each line) ?
The script would produce a .txt of usernames
Could you please update it seems to be not working?
If you also can update you readme.MD explaining how to use please.
Traceback (most recent call last):
line 136, in <module>
main()
line 126, in main
userid = usernameToUserId(args.username)
line 39, in usernameToUserId
if json.loads(r).get("message") == 'rate limited':
File "C:\Program Files\Python3\lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python3\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python3\lib\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)
Does anyone have a working list of user agents for https://i.instagram.com/api/v1/users/{userid}/info/
API?
What response code and message it gives us when API limit exceed?
python3 InstaTracker.py -i 47682547574
Traceback (most recent call last):
File "/home/ndf10/InstaTrack/InstaTracker.py", line 136, in
main()
File "/home/ndf10/InstaTrack/InstaTracker.py", line 119, in main
username = useridToUsername(args.id)
File "/home/ndf10/InstaTrack/InstaTracker.py", line 63, in useridToUsername
j = json.loads(r.text)
File "/usr/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/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)
@Snbig Thanks for the quick update.
Yep, there’s a limit on instagrap api calls, and I’m not sure what is it.
You can try to call some functions 2000 times without timeout, and you will get a messege from instagram “ an error occured please try again later”.
By the way, could add anothet option to export the results as an excel file? First coloumn with user id, and second one with the username
Originally posted by @rabe398 in #3 (comment)
I get the following error when running useridToUsername; I traced it to this line in getTokens:
query_hash = re.findall(r'{value:!0});(?:var|const|let) .="([0-9a-f]{32})"', r)[0]
Can you made a module to use from other scripts?
$ python --version
Python 3.8.1
$ python InstaTracker.py -u g.mi
[-] Username does not exist
$ python InstaTracker.py -u 'g.mi'
[-] Username does not exist
$ python InstaTracker.py -u so_____y_
[-] Username does not exist
$ python InstaTracker.py -u 'so_____y_'
[-] Username does not exist
$ python InstaTracker.py -u _glam.diva_
[-] Username does not exist
$ python InstaTracker.py -u '_glam.diva_'
[-] Username does not exist
Running $ python3 InstaTracker.py -i <19 character UserID>
gives the error:
Traceback (most recent call last):
File "E:\Instaloader\InstaTracker.py", line 138, in <module>
main()
File "E:\Instaloader\InstaTracker.py", line 121, in main
username = useridToUsername(args.id)
File "E:\Instaloader\InstaTracker.py", line 58, in useridToUsername
checkTokens()
File "E:\Instaloader\InstaTracker.py", line 18, in checkTokens
getTokens()
File "E:\Instaloader\InstaTracker.py", line 28, in getTokens
query_hash = re.findall(r'{value:!0}\);var s=\"(.*?)\"', r)[0]
IndexError: list index out of range
I am running the program on Python3.8.
I am really sorry if I am doing something really stupid. I am not at all comfortabe with Python
Could add another option to export the results as an excel file? First coloumn with user id, and second one with the username
Originally posted by @rabe398 in #3 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.