Repository navigation
Releases
0.3.15
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) andinitial_backoff(default: 0.5s) parameters toHFRClient.
Full Changelog: v0.3.14...v0.3.15
0.3.14
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
🐛 Bug Fixes & Resilience
- client: add
reset_session()and automatic socket retry on idle connection drops inHFRClient
(#e7997c1)- Recreates
curl_cffisessions 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().
- Recreates
🧪 Tests
- Add unit tests for
reset_session()and transparentis_logged_in()socket renewal.
Full Changelog: v0.3.12...v0.3.13
0.3.12
- Add
HFRClient.user_idproperty resolving authenticated user ID frommd_idsession 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
- Fix topic form token retrieval (
get_post_form_tokens) to target the topic's last page (max_page) and extract current
numrepon 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 ») inpost_reply().
Full Changelog: v0.3.10...v0.3.11
0.3.10
- Strip user signature (
span.signature), edit notices (div.edited), and clear divs fromMessage.text - Extract and attach
signatureandauthor_title(custom quote under pseudo) as dedicated properties onMessage - Update
Message.to_dict()andfrom_dict()serialization withsignatureandauthor_title
Full Changelog: v0.3.9...v0.3.10
0.3.9
What's Changed
- Fix pagination parsing for MesDiscussions URL-rewritten links (
sujet_<post>_<page>.htm) and textual page headers inTopic.parse_page_html - Support default sequential message
refcalculation offset based on page index when DOM action anchors are absent
Full Changelog: v0.3.8...v0.3.9
0.3.8
🐛 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
🐛 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
Features & Improvements
-
Native
user_idExtraction inMessage: -
Message.from_lxmlnow automatically parses the numeric authoruser_idfrom/hfr/profil-<id>.htmanchor links in the message toolbar. -
Added
user_idfield toMessagewith full serialization support into_dict()andfrom_dict(). -
Updated
Message.quote()to default toself.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 thenumreponsequery 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.pycovering HTML DOM parsing,user_idextraction, and BBCode quote formatting.
Full Changelog: v0.3.4...v0.3.6