MCPcopy
hub / github.com/ssili126/tv / is_url_accessible

Function is_url_accessible

new.py:681–691  ·  view source on GitHub ↗
(session, url, semaphore)

Source from the content-addressed store, hash-verified

679 return modified_urls
680
681async def is_url_accessible(session, url, semaphore):
682 async with semaphore:
683 try:
684 async with session.get(url, timeout=0.5) as response:
685 if response.status == 200:
686 current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
687 print(f"{current_time} {url}")
688 return url
689 except (aiohttp.ClientError, asyncio.TimeoutError):
690 pass
691 return None
692
693async def check_urls(session, urls, semaphore):
694 tasks = []

Callers 1

check_urlsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected