fastfeedparser 0.5.9__tar.gz → 0.5.10__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.9/src/fastfeedparser.egg-info → fastfeedparser-0.5.10}/PKG-INFO +1 -1
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/setup.cfg +1 -1
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser/main.py +27 -25
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10/src/fastfeedparser.egg-info}/PKG-INFO +1 -1
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/LICENSE +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/README.md +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/pyproject.toml +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser/__init__.py +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser.egg-info/SOURCES.txt +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser.egg-info/dependency_links.txt +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser.egg-info/requires.txt +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser.egg-info/top_level.txt +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/tests/test_encoding.py +0 -0
- {fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/tests/test_integration.py +0 -0
|
@@ -635,6 +635,7 @@ def _raise_for_non_feed_root(
|
|
|
635
635
|
|
|
636
636
|
|
|
637
637
|
_RE_META_REFRESH_URL = re.compile(r'url\s*=\s*["\']?\s*([^"\'>\s]+)', re.IGNORECASE)
|
|
638
|
+
_MAX_META_REDIRECTS = 3
|
|
638
639
|
|
|
639
640
|
|
|
640
641
|
def _extract_meta_refresh_url(content: str | bytes, base_url: str) -> str | None:
|
|
@@ -866,31 +867,32 @@ def parse(
|
|
|
866
867
|
else:
|
|
867
868
|
content = source
|
|
868
869
|
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
870
|
+
parse_kwargs = dict(
|
|
871
|
+
include_content=include_content,
|
|
872
|
+
include_tags=include_tags,
|
|
873
|
+
include_media=include_media,
|
|
874
|
+
include_enclosures=include_enclosures,
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
redirects_left = _MAX_META_REDIRECTS
|
|
878
|
+
while True:
|
|
879
|
+
try:
|
|
880
|
+
return _parse_content(content, **parse_kwargs)
|
|
881
|
+
except ValueError as e:
|
|
882
|
+
if not is_url:
|
|
883
|
+
raise
|
|
884
|
+
assert isinstance(source, str)
|
|
885
|
+
err_msg = str(e)
|
|
886
|
+
if "HTML" not in err_msg and "not a valid RSS/Atom feed" not in err_msg:
|
|
887
|
+
raise
|
|
888
|
+
if redirects_left <= 0:
|
|
889
|
+
raise ValueError("too many meta-refresh redirects") from e
|
|
890
|
+
redirect_url = _extract_meta_refresh_url(content, source)
|
|
891
|
+
if redirect_url is None:
|
|
892
|
+
raise
|
|
893
|
+
content = _fetch_url_content(redirect_url)
|
|
894
|
+
source = redirect_url
|
|
895
|
+
redirects_left -= 1
|
|
894
896
|
|
|
895
897
|
|
|
896
898
|
def _parse_feed_info(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastfeedparser-0.5.9 → fastfeedparser-0.5.10}/src/fastfeedparser.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|