fastfeedparser 0.5.6__tar.gz → 0.5.7__tar.gz
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.
- {fastfeedparser-0.5.6/src/fastfeedparser.egg-info → fastfeedparser-0.5.7}/PKG-INFO +1 -1
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/setup.cfg +1 -1
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser/main.py +21 -1
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7/src/fastfeedparser.egg-info}/PKG-INFO +1 -1
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/LICENSE +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/README.md +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/pyproject.toml +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser/__init__.py +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser.egg-info/SOURCES.txt +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser.egg-info/dependency_links.txt +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser.egg-info/requires.txt +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser.egg-info/top_level.txt +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/tests/test_encoding.py +0 -0
- {fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/tests/test_integration.py +0 -0
|
@@ -411,6 +411,13 @@ def _parse_json_feed(
|
|
|
411
411
|
if enclosures:
|
|
412
412
|
entry["enclosures"] = enclosures
|
|
413
413
|
|
|
414
|
+
# Derive feedparser-compatible author fields
|
|
415
|
+
_author = entry.get("author")
|
|
416
|
+
if _author:
|
|
417
|
+
_detail = {"name": _author}
|
|
418
|
+
entry["author_detail"] = _detail
|
|
419
|
+
entry["authors"] = [_detail]
|
|
420
|
+
|
|
414
421
|
# Add links
|
|
415
422
|
entry["links"] = []
|
|
416
423
|
item_url = item.get("url")
|
|
@@ -455,7 +462,14 @@ def _fetch_url_content(url: str) -> str | bytes:
|
|
|
455
462
|
)
|
|
456
463
|
content = brotli.decompress(content)
|
|
457
464
|
content_charset = response.headers.get_content_charset()
|
|
458
|
-
|
|
465
|
+
if content_charset:
|
|
466
|
+
try:
|
|
467
|
+
return content.decode(content_charset)
|
|
468
|
+
except (UnicodeDecodeError, LookupError):
|
|
469
|
+
# Server lied about charset; return raw bytes and let
|
|
470
|
+
# lxml detect encoding from the XML declaration/BOM.
|
|
471
|
+
return content
|
|
472
|
+
return content
|
|
459
473
|
|
|
460
474
|
|
|
461
475
|
def _maybe_parse_json_feed(
|
|
@@ -805,6 +819,12 @@ def _parse_content(
|
|
|
805
819
|
# Ensure that titles and descriptions are always present
|
|
806
820
|
entry["title"] = entry.get("title", "").strip()
|
|
807
821
|
entry["description"] = entry.get("description", "").strip()
|
|
822
|
+
# Derive feedparser-compatible author fields
|
|
823
|
+
_author = entry.get("author")
|
|
824
|
+
if _author:
|
|
825
|
+
_detail = {"name": _author}
|
|
826
|
+
entry["author_detail"] = _detail
|
|
827
|
+
entry["authors"] = [_detail]
|
|
808
828
|
entries.append(entry)
|
|
809
829
|
|
|
810
830
|
return feed
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastfeedparser-0.5.6 → fastfeedparser-0.5.7}/src/fastfeedparser.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|