Skip to content

Releases

0.3.15

Choose a tag to compare

@dotvav dotvav released this 15 Sep 05:03

What's Changed

  • feat(client): add automatic session reset and exponential retry on network drops (BoringSSL/curl 35, timeout, and closed keep-alive sockets).
  • wrapped all HTTP reading and posting methods in HFRClient (get_topic_page, get_latest_topic_messages, get_post_by_id, get_quote_chain, list_mps, get_mp_page, post_reply, post_mp_reply, get_post_form_tokens, search_wiki_smilies,
    get_smiley_keywords) with transparent retry logic and socket pool refreshes.
  • added configurable max_retries (default: 3) and initial_backoff (default: 0.5s) parameters to HFRClient.

Full Changelog: v0.3.14...v0.3.15

0.3.14

Choose a tag to compare

@dotvav dotvav released this 14 Sep 09:29

Full Changelog: v0.3.13...v0.3.14

What's Changed

  • Preserve Quoted Authors: Extracted the author username from ... a écrit : within citation tables () during HTML to BBCode conversion.
  • Pluggable user_resolver:
    • Introduced the UserResolver type (dict[str, int] or Callable[[str], Optional[int]]).
    • Propagated user_resolver throughout the conversion pipeline: bb.html_to_bb(), Message.from_lxml(), Topic.
      parse_page_html(), Topic.load_page(), and HFRClient.
  • Automatic Page-Level Directory: Topic.parse_page_html() automatically extracts a {pseudo: user_id} mapping from all
    visible messages on the current page to resolve local intra-page citations without requiring external lookups.
  • Enhanced BBCode Output:
    • Emits [quotemsg=msg_id,ref,user_id] when a valid non-zero user_id is resolved.
    • Falls back to [quote=Pseudo]...[/quote] when user_id is missing but the author name is known, avoiding anonymous or
      dummy user_id=0 tags.

0.3.13

Choose a tag to compare

@dotvav dotvav released this 14 Sep 08:53

🐛 Bug Fixes & Resilience

  • client: add reset_session() and automatic socket retry on idle connection drops in HFRClient
    (#e7997c1)
    • Recreates curl_cffi sessions on dropped keep-alive TCP connections while preserving all active authentication
      cookies (md_user, md_passs, md_id).
    • Automatically recovers and retries once on connection/SSL exceptions during is_logged_in().
    • Resets session before submitting credentials in login() to ensure fresh socket negotiation.
    • Adds transparent connection error recovery in get_post_form_tokens().

🧪 Tests

  • Add unit tests for reset_session() and transparent is_logged_in() socket renewal.

Full Changelog: v0.3.12...v0.3.13

0.3.12

Choose a tag to compare

@dotvav dotvav released this 12 Sep 11:53
  • Add HFRClient.user_id property resolving authenticated user ID from md_id session cookies, cookie files, or
    transparent HTML parsing fallback in cf6526e
  • Add extract_user_id_from_html() helper extracting numeric user IDs from MesDiscussions forum header links
    (reinit=1&user=..., marquer=1&user=...), profile anchors (/hfr/profil-<id>.htm), and hidden form fields in
    cf6526e
  • Add automatic session cookie validation and stale file purging in HFRClient.load_cookies() on username mismatch in
    cf6526e

Full Changelog: v0.3.11...v0.3.12

0.3.11

Choose a tag to compare

@dotvav dotvav released this 12 Sep 07:06
  • Fix topic form token retrieval (get_post_form_tokens) to target the topic's last page (max_page) and extract current
    numrep on multi-page threads.
  • Handle and automatically confirm intermediate HFR confirmation/preview screens (« Un ou plusieurs messages ont été
    postés pendant que vous rédigiez votre réponse »
    ) in post_reply().

Full Changelog: v0.3.10...v0.3.11

0.3.10

Choose a tag to compare

@dotvav dotvav released this 10 Sep 11:08
  • Strip user signature (span.signature), edit notices (div.edited), and clear divs from Message.text
  • Extract and attach signature and author_title (custom quote under pseudo) as dedicated properties on Message
  • Update Message.to_dict() and from_dict() serialization with signature and author_title

Full Changelog: v0.3.9...v0.3.10

0.3.9

Choose a tag to compare

@dotvav dotvav released this 09 Sep 15:33

What's Changed

  • Fix pagination parsing for MesDiscussions URL-rewritten links (sujet_<post>_<page>.htm) and textual page headers in Topic.parse_page_html
  • Support default sequential message ref calculation offset based on page index when DOM action anchors are absent

Full Changelog: v0.3.8...v0.3.9

0.3.8

Choose a tag to compare

@dotvav dotvav released this 09 Sep 13:23

🐛 Bug Fixes & Improvements

  • Align [quotemsg] syntax to MesDiscussions native 3-parameter specification:
    • HFR quotes use the format [quotemsg=message_id,ref,user_id].
    • The second parameter is the absolute sequential message index within the thread (ref), not user_id.
    • The third parameter is the author's numerical profile identifier (user_id).
  • Dynamic ref extraction:
    • Message.from_lxml now dynamically computes the absolute thread index from addflag.php or citer- toolbar anchors using (page - 1) * 40 + ref_page.
    • Added ref: int = 1 attribute to Message class and serialization helpers.
  • BBCode formatting updates:
    • Updated bb.format_quote(message_id, text, ref=1, user_id=0) and Message.quote() to generate compliant citations.

Full Changelog: v0.3.7...v0.3.8

0.3.7

Choose a tag to compare

@dotvav dotvav released this 09 Sep 12:58

🐛 Bug Fixes & Improvements

  • Remove &print=1 parameter from thread and MP loading URLs:
    • MesDiscussions (HFR) printer-friendly view (&print=1) strips the .toolbar container and member profile anchor tags (links matching /hfr/profil-.htm), causing Message.from_lxml to default user_id to 0.
    • Reverted to standard forum thread URLs in Topic.load_page() and HFRClient.get_mp_page(), restoring authentic 40-messages-per-page pagination and full DOM extraction.
  • Robust user_id DOM Extraction:
    • Broadened XPath matching in Message.from_lxml to accurately capture author user_id across all message layout variations.
    • Ensures BBCode citation generators produce fully linked [quotemsg=message_id,user_id,0] tags.

0.3.6

Choose a tag to compare

@dotvav dotvav released this 09 Sep 09:36

Features & Improvements

  • Native user_id Extraction in Message:

  • Message.from_lxml now automatically parses the numeric author user_id from /hfr/profil-<id>.htm anchor links in the message toolbar.

  • Added user_id field to Message with full serialization support in to_dict() and from_dict().

  • Updated Message.quote() to default to self.user_id, generating authentic MesDiscussions [quotemsg=message_id,user_id,0] BBCode tags.

  • Direct Post Lookup & Quote Helpers:

  • Added HFRClient.get_post_by_id(cat, subcat, post, msg_id) to fetch a specific post and its surrounding page directly using the numreponse query parameter.

  • Added bb.extract_parent_quote_ids(bbcode_text) utility to extract all referenced post IDs from [quotemsg=ID,...] tags.

Testing & Quality

  • Added tests/test_message.py covering HTML DOM parsing, user_id extraction, and BBCode quote formatting.

Full Changelog: v0.3.4...v0.3.6