When i try to get threads by name using the Client's search_for_threads method it hangs on connecting to the socket for ever
Code to reproduce
import atexit
import json
import getpass
import fbchat as fb
def load_cookies(filename):
try:
# Load cookies from file
with open(filename) as f:
return json.load(f)
except FileNotFoundError:
return # No cookies yet
def save_cookies(filename, cookies):
with open(filename, 'w') as f:
json.dump(cookies, f)
def load_session(cookies):
if not cookies:
return
try:
return fb.Session.from_cookies(cookies)
except fb.FacebookError:
return # Failed loading from cookies
cookies = load_cookies('session.json')
session = load_session(cookies)
if not session:
# Session could not be loaded, login instead!
session = fb.Session.login('myemail.com', getpass.getpass())
client = fb.Client(session=session)
threads = list(client.search_for_threads('the_group_to_search', limit=5))
Traceback
When i interrupt with the keyboard after a minute of waiting the last lines i get are
~/.virtualenvs/fbchat/lib/python3.8/site-packages/urllib3/util/connection.py in create_connection(address, timeout, source_address, socket_options)
72 if source_address:
73 sock.bind(source_address)
---> 74 sock.connect(sa)
75 return sock
76
Description of the problem
When i try to get threads by name using the Client's search_for_threads method it hangs on connecting to the socket for ever
Code to reproduce
Traceback
When i interrupt with the keyboard after a minute of waiting the last lines i get are
Environment information
fbchat
version 2.0.0a2