Closed TheLiveitup34 closed 1 day ago
if you are comfortable , can you please share tweet id which caused this error
Yes I'm more than comfortable i built the program to use the code you wrote to archive club penguin tweets for a friend and it may not be available to you due to it going private after closure but we're using a logged in session that has access to the tweets
Tweet id:993640176751538177
Can confirm this issue is still occurring on the latest version
can you please specify version your are using.
Version 2.0.1
to add to note to what he is saying ` def find_objects(obj, key, value, recursive=True, none_value=None): results = []
def find_matching_objects(_obj, _key, _value):
if isinstance(_obj, dict):
if _key in _obj:
found = False
if _value is None:
found = True
results.append(_obj[_key])
elif (isinstance(_value, list) and _obj[_key] in _value) or _obj[_key] == _value:
found = True
results.append(_obj)
if not recursive and found:
return results[0]
for sub_obj in _obj.values():
find_matching_objects(sub_obj, _key, _value)
elif isinstance(_obj, list):
for item in _obj:
find_matching_objects(item, _key, _value)
find_matching_objects(obj, key, value)
if len(results) == 1:
return results[0]
if len(results) == 0:
// returns None here
return none_value
if not recursive:
return results[0]
return results
` your function called in line 268 of twDataTypes.py
def _format_tweet(self): self._check_if_protected() // This returns None Object self._tweet = find_objects(self._raw, "__typename", ["Tweet", "TweetWithVisibilityResults"], recursive=False) // Runs error to call .get on a None value if self._tweet.get('tweet'): self._tweet = self._tweet['tweet']
Please do update to latest version
Can confirm issue is now fixed in version 2.0.2
In short I looked into the find_objects and seen it returns None when no value is found and the error came up of it attempting to call the function of a NoneType.