MCPcopy Create free account
hub / github.com/Freedium-cfd/web / resolve_url

Method resolve_url

medium-parser/medium_parser/core.py:90–101  ·  view source on GitHub ↗
(self, url: str)

Source from the content-addressed store, hash-verified

88 return post_id
89
90 async def resolve_url(self, url: str) -> str:
91 sanitized_url = correct_url(url)
92 if not is_valid_url(url) or not await is_valid_medium_url(sanitized_url):
93 raise InvalidURL(f"Invalid Medium URL: {sanitized_url}")
94
95 post_id = await resolve_medium_url(sanitized_url, self.timeout)
96 if not post_id:
97 raise InvalidMediumPostURL(
98 f"Could not find Medium post ID for URL: {sanitized_url}"
99 )
100
101 return post_id
102
103 async def delete_from_cache(self, post_id: str):
104 self.cache.delete(post_id)

Callers 1

resolveMethod · 0.95

Calls 6

correct_urlFunction · 0.85
is_valid_urlFunction · 0.85
is_valid_medium_urlFunction · 0.85
InvalidURLClass · 0.85
resolve_medium_urlFunction · 0.85

Tested by

no test coverage detected