twitwi 0.22.0__py3-none-any.whl → 0.22.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -594,11 +594,13 @@ def normalize_post(
594
594
 
595
595
  # Process quotes
596
596
  if quoted_data and "value" in quoted_data:
597
- if quoted_data["cid"] != post["quoted_cid"]:
597
+ # We're checking on the uri as the cid can be different in some cases,
598
+ # and the uri seems to be unique for each post
599
+ if quoted_data["uri"] != post["quoted_uri"]:
598
600
  raise BlueskyPayloadError(
599
601
  post["url"],
600
- "inconsistent quote cid found between record.embed.record.cid & embed.record.cid: %s %s"
601
- % (post["quoted_cid"], quoted_data),
602
+ "inconsistent quote uri found between record.embed.record.uri & embed.record.uri: %s %s"
603
+ % (post["quoted_uri"], quoted_data),
602
604
  )
603
605
 
604
606
  quoted_data["record"] = quoted_data["value"]
@@ -706,7 +708,12 @@ def normalize_post(
706
708
  repost_data["indexedAt"], locale=locale, source="bluesky"
707
709
  )
708
710
 
709
- post["text"] = text.decode("utf-8")
711
+ try:
712
+ post["text"] = text.decode("utf-8")
713
+ except UnicodeDecodeError as e:
714
+ raise UnicodeDecodeError(
715
+ f"Failed to decode post text: {e}\nPost URL: {post['url']}\nOriginal text bytes: {text}"
716
+ )
710
717
 
711
718
  if collection_source is not None:
712
719
  post["collected_via"] = [collection_source]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: twitwi
3
- Version: 0.22.0
3
+ Version: 0.22.1
4
4
  Summary: A collection of Twitter-related helper functions for python.
5
5
  Home-page: http://github.com/medialab/twitwi
6
6
  Author: Béatrice Mazoyer, Guillaume Plique, Benjamin Ooghe-Tabanou
@@ -11,12 +11,12 @@ twitwi/utils.py,sha256=f02cMx19Sr_GvJQf_0jTIERGLq1oC3znnPQxE__rlFc,3838
11
11
  twitwi/bluesky/__init__.py,sha256=SqeHZUzL2U9UpL3EB33vaowQWaKXSPkvsAkasRqmFpY,694
12
12
  twitwi/bluesky/constants.py,sha256=CPkTIrDwyRWpkFTbaee1oFm_LWGj2WIC7A6xEGqDGB4,573
13
13
  twitwi/bluesky/formatters.py,sha256=L_yROAPcBECifCGiFAGYFJwLq6re8UlJNoZ7R2DXm5g,1025
14
- twitwi/bluesky/normalizers.py,sha256=1tt4q9dKhCLuNhB-Qn8YGSHILvgu-JNIRnfumwkEAe4,28422
14
+ twitwi/bluesky/normalizers.py,sha256=MtS1UW9Chi8zzs8VBfyXxDQaeIrEEXeNy3GBvgG_ivc,28759
15
15
  twitwi/bluesky/types.py,sha256=WUxfyA5fc68qURGh7bxiDlIBFgdbyysRRdvHLoXwWlA,13656
16
16
  twitwi/bluesky/utils.py,sha256=9il8t_qkKCmGQ-MDkF5qahxKV1Qsmwzul_1VzzD-jH4,3943
17
- twitwi-0.22.0.dist-info/licenses/LICENSE.txt,sha256=Ddg_PcGnl0qd2167o2dheCjE_rCZJOoBxjJnJhhOpX4,1099
18
- twitwi-0.22.0.dist-info/METADATA,sha256=QggjTIdvTg15eWBDNuug7rcZINc2Uh6choMNQeeFoNM,21365
19
- twitwi-0.22.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
- twitwi-0.22.0.dist-info/top_level.txt,sha256=TaKyGU7j_EVbP5KI0UD6qjbaKv2Qn0OrkfUQ29a04kg,12
21
- twitwi-0.22.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
22
- twitwi-0.22.0.dist-info/RECORD,,
17
+ twitwi-0.22.1.dist-info/licenses/LICENSE.txt,sha256=Ddg_PcGnl0qd2167o2dheCjE_rCZJOoBxjJnJhhOpX4,1099
18
+ twitwi-0.22.1.dist-info/METADATA,sha256=1B2fgQqdo1CpPDe0g-NWJzqQ5XqZZEkRl1osx1bxht8,21365
19
+ twitwi-0.22.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
20
+ twitwi-0.22.1.dist-info/top_level.txt,sha256=TaKyGU7j_EVbP5KI0UD6qjbaKv2Qn0OrkfUQ29a04kg,12
21
+ twitwi-0.22.1.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
22
+ twitwi-0.22.1.dist-info/RECORD,,