MCPcopy Create free account
hub / github.com/LCBOWER33/StegoScan / get_wikipedia_image

Function get_wikipedia_image

StegoScan.py:342–355  ·  view source on GitHub ↗

Extract direct image URL from a Wikipedia file information page.

(url)

Source from the content-addressed store, hash-verified

340
341
342def get_wikipedia_image(url):
343 """Extract direct image URL from a Wikipedia file information page."""
344 try:
345 response = requests.get(url, timeout=5)
346 response.raise_for_status()
347 soup = BeautifulSoup(response.text, 'html.parser')
348 image_tag = soup.find('div', class_='fullImageLink')
349 if image_tag:
350 image_link = image_tag.find('a')
351 if image_link and 'href' in image_link.attrs:
352 return urljoin(url, image_link['href'])
353 except requests.RequestException as e:
354 prRed(f"Failed to get direct Wikipedia image URL from {url}: {e}")
355 return None
356
357
358def is_valid_url(url):

Callers 1

download_fileFunction · 0.85

Calls 1

prRedFunction · 0.85

Tested by

no test coverage detected