url_utils
URL detection, content fetching, and metadata caching utilities.
- class url_utils.URLMetadataCache(ttl=None)
Bases:
objectIn-memory TTL cache for URL metadata (default 24 h).
- Parameters:
ttl (int | None)
- DEFAULT_TTL = 86400
- async url_utils.download_image_url(url)
- async url_utils.get_bluesky_content(url)
- async url_utils.get_crypto_prices(pairs)
- async url_utils.get_github_content(url)
- async url_utils.get_giphy_media_url(giphy_url)
- async url_utils.get_nvd_cve_content(url)
- async url_utils.get_reddit_content(url)
Fetch a Reddit post’s content + top comments.
Prefers the authenticated
oauth.reddit.com.json API whenREDDIT_CLIENT_ID/REDDIT_CLIENT_SECRETare configured (richest data, including scores). Without credentials Reddit 403-blocks the .json endpoints from this host, so it falls back to the public, unauthenticated.rssfeed (no scores, best-effort comments) so Reddit links still resolve.
- async url_utils.get_soundcloud_content(url)
- async url_utils.get_spotify_content(url)
- async url_utils.get_stackoverflow_content(url)
- async url_utils.get_tenor_media_url(tenor_url)
- async url_utils.get_tiktok_content(url)
- async url_utils.get_tweet_content(tweet_url)
- url_utils.get_url_cache()
- Return type:
- async url_utils.get_wikipedia_content(url)
- async url_utils.get_youtube_content(url)
- url_utils.parse_ytdlp_dump_json_stdout(stdout)