InstaLooter
InstaLooter copied to clipboard
CRITICAL 'edge_media_to_comment'
I've been using instalooter on the mac for quite a while, but haven't been able to get it to work at all for the past few months. I typically invoke this way:
instalooter user uname uname -v -N -m -T {username}_{date}_{id}
(where "uname" is the user)
This has been generating this error in v. 2.3.3:
019-03-26 01:05:38 Workstation instalooter.cli[9070] CRITICAL 'edge_media_to_comment'
I've tried many troubleshooting steps, such as manually de-reinstalling instalooter, deps, pip, and python, with no luck. I gather this error has something to do with metadata retrieval. Sometimes, invoking without options helps. Othertimes, no matter what I do, instalooter fails with the edge_media error.
After updating to 2.3.4, instalooter doesn't work at all.
Workstation:instalooter user$ instalooter login
Username: uname
Password:
Error occurred during loading data. Trying to use cache server http://d2g6u4gh6d9rq0.cloudfront.net/browsers/fake_useragent_0.1.10.json
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/fake_useragent/utils.py", line 67, in get
context=context,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1282, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error timed out>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/fake_useragent/utils.py", line 166, in load
verify_ssl=verify_ssl,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/fake_useragent/utils.py", line 122, in get_browser_versions
verify_ssl=verify_ssl,
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/fake_useragent/utils.py", line 84, in get
raise FakeUserAgentError('Maximum amount of retries reached')
fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached
2019-03-26 00:18:35 Workstation instalooter.cli[7220] CRITICAL Maximum amount of retries reached
I've been having exactly the same problem on Ubuntu for a few weeks now.
Got rid of it replacing
'commentscount': media['edge_media_to_comment']['count']
with
commentscount': 0
in _utils.py. Nothing else helped, including downgrading and suchlike. Not a viable solution of course, but works in my case.
@haltefest thanks for the tip. For me, this file was located at ~/.local/lib/python3.6/site-packages/instalooter/_utils.py
(installed locally, not globally)
@irontoby You're welcome; do not forget to patch again after updates (unless this is resolved some time).
This should be fixed in the next release.
This should be fixed in the next release.
Thank you @althonos , very much appreciated!
Now there's edge_media_to_parent_comment
, which also contains count
, but it's count of only top-level comments.
If old behavior had to be preserved, comments should be counted by descending edge_media_to_parent_comment
-> edges
-> (each item in list) -> node
-> edge_threaded_comments
-> count
This issue is still open...
Same problem here with Ubuntu 18.04.2 LTS and instalooter version instalooter-2.3.4
same here