diff --git a/twoot.py b/twoot.py index 036b385..579c682 100755 --- a/twoot.py +++ b/twoot.py @@ -169,12 +169,14 @@ Dowload page with full thread of tweets and extract all replied to tweet referen Only used by `get_timeline()`. :param session: Existing HTTP session with Nitter instance :param headers: HTTP headers to use -:param url: url of the thread page to download +:param nitter url: url of the nitter instance to use +:param thread_url: url of the first tweet in thread :return: List of tweets from the thread """ -def _get_rest_of_thread(session, headers, url): +def _get_rest_of_thread(session, headers, nitter_url, thread_url): logging.debug("Downloading tweets in thread from separate page") # Download page with thread + url = nitter_url + thread_url try: thread_page = session.get(url, headers=headers, timeout=HTTPS_REQ_TIMEOUT) except requests.exceptions.ConnectionError: @@ -278,7 +280,7 @@ def get_timeline(nitter_url): thread_link_tag = item.find('a', class_='tweet-link') if thread_link_tag is not None: thread_url = thread_link_tag.get('href') - timeline.extend(_get_rest_of_thread(session, headers, nitter_url + thread_url)) + timeline.extend(_get_rest_of_thread(session, headers, nitter_url, thread_url)) else: # Ignore other classes continue