Skip to content

armgit / Scout

Public Imported from GitHub
0

Free lead generation tool. Scrape Instagram, Twitch, TikTok, and LinkedIn profiles. Extract emails from bios, verify via SMTP, export to CSV.

v1.2.0: centralize shared utils, normalize scrapers, add missing features

marcus9b80f4f029f3
diff --git a/.gitignore b/.gitignore
index 88ab9ed..33c9131 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,9 +21,8 @@ Thumbs.db
exports/
*.csv
-.claude/
-
.vscode/
.idea/
+.claude/
*.swp
*.swo
diff --git a/app/__init__.py b/app/__init__.py
index 0748fef..e231b0e 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -2,4 +2,4 @@
Scout - Social media lead generation tool.
"""
-__version__ = "1.1.0"
+__version__ = "1.2.0"
diff --git a/app/scrapers/__init__.py b/app/scrapers/__init__.py
index b05dfd6..296e3e3 100644
--- a/app/scrapers/__init__.py
+++ b/app/scrapers/__init__.py
@@ -8,6 +8,8 @@ Supported platforms:
- GitHub
- YouTube
- Twitch
+ - Linktree (+ Stan, etc.)
+ - Pinterest
"""
from .instagram import scrape_profile_no_login as scrape_instagram
@@ -16,6 +18,8 @@ from .linkedin import scrape_linkedin_profile as scrape_linkedin
from .github import scrape_profile as scrape_github
from .youtube import scrape_channel as scrape_youtube
from .twitch import scrape_profile as scrape_twitch
+from .linktree import scrape_linktree, scrape_all as scrape_linkbio
+from .pinterest import scrape_profile as scrape_pinterest
__all__ = [
"scrape_instagram",
@@ -24,4 +28,7 @@ __all__ = [
"scrape_github",
"scrape_youtube",
"scrape_twitch",
+ "scrape_linktree",
+ "scrape_linkbio",
+ "scrape_pinterest",
]
diff --git a/app/scrapers/github.py b/app/scrapers/github.py
index a4cee59..f74ea8e 100644
--- a/app/scrapers/github.py
+++ b/app/scrapers/github.py
@@ -12,6 +12,7 @@ import logging
import re
from app.scrapers.stealth import get_requests_proxies, random_user_agent
+from app.scrapers.utils import extract_email
logger = logging.getLogger(__name__)
@@ -43,6 +44,17 @@ def scrape_profile(username: str) -> Optional[Dict]:
data = r.json()
bio = data.get('bio') or ''
+ if not any([
+ data.get('name'),
+ data.get('bio'),
+ data.get('email'),
+ data.get('blog'),
+ data.get('company'),
+ data.get('twitter_username'),
+ ]):
+ logger.info(f"GitHub user @{username} has no profile data")
+ return None
+
return {
'username': data.get('login', username),
'full_name': data.get('name') or '',
@@ -68,9 +80,4 @@ def scrape_profile(username: str) -> Optional[Dict]:
return None
-def _extract_email(text: str) -> str:
- if not text:
- return ''
- pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
- matches = re.findall(pattern, text)
- return matches[0] if matches else ''
+_extract_email = extract_email
diff --git a/app/scrapers/instagram.py b/app/scrapers/instagram.py
index b058ad2..7a3afe5 100644
--- a/app/scrapers/instagram.py
+++ b/app/scrapers/instagram.py
@@ -17,6 +17,7 @@ import logging
import re
from app.scrapers.stealth import get_requests_proxies
+from app.scrapers.utils import extract_email, extract_phone, parse_abbreviated_number
logger = logging.getLogger(__name__)
@@ -261,44 +262,6 @@ def _extract_profile_from_html(html: str, username: str) -> Optional[Dict]:
}
-def _parse_abbreviated_number(s: str) -> int:
- """Parse abbreviated numbers like 11M, 7.5K, 1.2B into integers."""
- s = s.strip().replace(',', '')
- multipliers = {'K': 1_000, 'M': 1_000_000, 'B': 1_000_000_000}
-
- for suffix, mult in multipliers.items():
- if s.upper().endswith(suffix):
- try:
- return int(float(s[:-1]) * mult)
- except (ValueError, IndexError):
- return 0
-
- try:
- return int(float(s))
- except ValueError:
- return 0
-
-
-def _extract_email(text: str) -> str:
- if not text:
- return ''
- pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
- matches = re.findall(pattern, text)
- return matches[0] if matches else ''
-
-
-def _extract_phone(text: str) -> str:
- if not text:
- return ''
- patterns = [
- r'\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}',
- r'\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}',
- r'\d{3}[-.\s]?\d{3}[-.\s]?\d{4}',
- ]
- for pattern in patterns:
- matches = re.findall(pattern, text)
- if matches:
- phone = re.sub(r'[^\d+]', '', matches[0])
- if len(phone) >= 10:
- return phone
- return ''
+_parse_abbreviated_number = parse_abbreviated_number
+_extract_email = extract_email
+_extract_phone = extract_phone
diff --git a/app/scrapers/linkedin.py b/app/scrapers/linkedin.py
index ba7342e..08b907e 100644
--- a/app/scrapers/linkedin.py
+++ b/app/scrapers/linkedin.py
@@ -8,6 +8,7 @@ from typing import Dict, Any, Optional
import httpx
from app.scrapers.stealth import random_user_agent, get_httpx_proxy
+from app.scrapers.utils import extract_email
logger = logging.getLogger(__name__)
@@ -72,17 +73,17 @@ def _get_session():
return client, csrf
-def scrape_linkedin_profile(username: str) -> Dict[str, Any]:
+def scrape_linkedin_profile(username: str) -> Optional[Dict]:
+ """Scrape LinkedIn profile. Returns profile dict or None."""
cookie = _get_li_cookie()
if not cookie:
- return {
- 'status': 'error',
- 'message': 'LINKEDIN_COOKIE not set in .env. See README for setup instructions.',
- }
+ logger.error("LINKEDIN_COOKIE not set in .env")
+ return None
client, csrf = _get_session()
if not client or not csrf:
- return {'status': 'error', 'message': 'Failed to initialize LinkedIn session. Cookie may be expired.'}
+ logger.error("Failed to initialize LinkedIn session. Cookie may be expired.")
+ return None
logger.info(f"Scraping LinkedIn profile: {username}")
@@ -99,20 +100,24 @@ def scrape_linkedin_profile(username: str) -> Dict[str, Any]:
resp = client.get(url, headers=headers)
except httpx.RequestError as e:
logger.error(f"Request error for {username}: {e}")
- return {'status': 'error', 'message': str(e)}
+ return None
if resp.status_code == 403:
- return {'status': 'error', 'message': f'Profile {username} is restricted or not accessible.'}
+ logger.error(f"Profile {username} is restricted or not accessible")
+ return None
if resp.status_code == 401:
_session_cache.update({'client': None, 'csrf': None})
- return {'status': 'error', 'message': 'LinkedIn cookie expired. Re-export your li_at cookie.'}
+ logger.error("LinkedIn cookie expired. Re-export your li_at cookie.")
+ return None
if resp.status_code != 200:
- return {'status': 'error', 'message': f'HTTP {resp.status_code} for {username}'}
+ logger.error(f"HTTP {resp.status_code} for {username}")
+ return None
try:
data = resp.json()
except json.JSONDecodeError:
- return {'status': 'error', 'message': f'Invalid response for {username}'}
+ logger.error(f"Invalid response for {username}")
+ return None
profile_data = None
for item in data.get('included', []):
@@ -121,7 +126,8 @@ def scrape_linkedin_profile(username: str) -> Dict[str, Any]:
break
if not profile_data:
- return {'status': 'error', 'message': f'No profile data found for {username}'}
+ logger.error(f"No profile data found for {username}")
+ return None
summary = profile_data.get('summary', '')
if not summary:
@@ -144,22 +150,9 @@ def scrape_linkedin_profile(username: str) -> Dict[str, Any]:
'is_premium': profile_data.get('premium', False),
'is_influencer': profile_data.get('influencer', False),
'website': websites[0] if websites else '',
- 'email': _extract_email(summary),
- 'scraped_at': datetime.utcnow().isoformat(),
+ 'email': extract_email(summary),
}
logger.info(f"Scraped {username}: {profile['full_name']} | {profile['headline'][:50]}")
- return {
- 'status': 'success',
- 'message': f'Scraped {username} successfully',
- 'profile': profile,
- }
-
-
-def _extract_email(text: str) -> str:
- if not text:
- return ''
- pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
- matches = re.findall(pattern, text)
- return matches[0] if matches else ''
+ return profile
diff --git a/app/scrapers/linktree.py b/app/scrapers/linktree.py
new file mode 100644
index 0000000..96ade01
--- /dev/null
+++ b/app/scrapers/linktree.py
@@ -0,0 +1,281 @@
+"""
+Link-in-Bio Scraper
+
+Fetches profile data from link-in-bio services:
+- Linktree
+- Stan.store
+- Linkr.bio
+- Bio.link
+
+Extracts all links, social profiles, and contact info.
+No authentication required.
+"""
+
+import requests
+from typing import Dict, Optional, List
+import logging
+import re
+import json
+
+from app.scrapers.stealth import random_user_agent
+from app.scrapers.utils import extract_email as _shared_extract_email
+
+logger = logging.getLogger(__name__)
+
+PLATFORMS = {
+ 'linktree': 'https://linktr.ee/{username}',
+ 'stan': 'https://stan.store/{username}',
+ 'linkr': 'https://linkr.bio/{username}',
+ 'biolink': 'https://bio.link/{username}',
+}
+
+
+def scrape_linktree(username: str) -> Optional[Dict]:
+ """Scrape Linktree profile."""
+ return _scrape_profile(username, 'linktree')
+
+
+def scrape_stan(username: str) -> Optional[Dict]:
+ """Scrape Stan.store profile."""
+ return _scrape_profile(username, 'stan')
+
+
+def scrape_linkr(username: str) -> Optional[Dict]:
+ """Scrape Linkr.bio profile."""
+ return _scrape_profile(username, 'linkr')
+
+
+def scrape_biolink(username: str) -> Optional[Dict]:
+ """Scrape Bio.link profile."""
+ return _scrape_profile(username, 'biolink')
+
+
+def scrape_all(username: str) -> Optional[Dict]:
+ """Try all link-in-bio platforms for a username."""
+ for platform in PLATFORMS.keys():
+ result = _scrape_profile(username, platform)
+ if result:
+ return result
+ return None
+
+
+def _scrape_profile(username: str, platform: str) -> Optional[Dict]:
+ """
+ Fetch link-in-bio profile data.
+
+ Args:
+ username: Profile username
+ platform: Platform name (linktree, stan, linkr, biolink)
+ """
+ username = username.lstrip('@').strip().lower()
+
+ if platform not in PLATFORMS:
+ logger.error(f"Unknown platform: {platform}")
+ return None
+
+ url = PLATFORMS[platform].format(username=username)
+
+ headers = {
+ 'User-Agent': random_user_agent(),
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
+ 'Accept-Language': 'en-US,en;q=0.9',
+ }
+
+ try:
+ r = requests.get(url, headers=headers, timeout=20)
+
+ if r.status_code == 404:
+ logger.debug(f"{platform} user {username} not found")
+ return None
+
+ if r.status_code != 200:
+ logger.error(f"{platform} error {r.status_code} for {username}")
+ return None
+
+ html = r.text
+
+ if platform == 'linktree':
+ return _parse_linktree(html, username)
+ elif platform == 'stan':
+ return _parse_stan(html, username)
+ else:
+ return _parse_generic(html, username, platform)
+
+ except requests.exceptions.Timeout:
+ logger.error(f"Timeout fetching {platform} profile {username}")
+ return None
+ except requests.exceptions.RequestException as e:
+ logger.error(f"Error fetching {platform} profile {username}: {e}")
+ return None
+
+
+def _parse_linktree(html: str, username: str) -> Optional[Dict]:
+ """Parse Linktree page."""
+
+ data_match = re.search(r'<script id="__NEXT_DATA__"[^>]*>(.*?)</script>', html, re.DOTALL)
+ if not data_match:
+ return _parse_generic(html, username, 'linktree')
+
+ try:
+ data = json.loads(data_match.group(1))
+ account = data.get('props', {}).get('pageProps', {}).get('account', {})
+
+ if not account:
+ return None
+
+ links = []
+ for link in account.get('links', []):
+ if link.get('url'):
+ links.append({
+ 'title': link.get('title', ''),
+ 'url': link.get('url', ''),
+ })
+
+ bio = account.get('description', '')
+
+ return {
+ 'username': username,
+ 'full_name': account.get('pageTitle', ''),
+ 'bio': bio,
+ 'email': _extract_email_from_links(links) or _extract_email(bio),
+ 'follower_count': 0,
+ 'website': _extract_website(links),
+ 'links': links,
+ 'link_count': len(links),
+ 'socials': _extract_socials(links),
+ 'platform': 'linktree',
+ 'profile_url': f'https://linktr.ee/{username}',
+ }
+
+ except json.JSONDecodeError:
+ return _parse_generic(html, username, 'linktree')
+
+
+def _parse_stan(html: str, username: str) -> Optional[Dict]:
+ """Parse Stan.store page."""
+
+ links = []
+ link_matches = re.findall(r'href="(https?://[^"]+)"', html)
+ for url in link_matches:
+ if 'stan.store' not in url and url.startswith('http'):
+ links.append({'title': '', 'url': url})
+
+ name_match = re.search(r'"name":"([^"]+)"', html)
+ full_name = name_match.group(1) if name_match else ''
+
+ bio_match = re.search(r'"description":"([^"]*)"', html)
+ bio = bio_match.group(1) if bio_match else ''
+
+ if not full_name and not links:
+ return None
+
+ return {
+ 'username': username,
+ 'full_name': full_name,
+ 'bio': bio,
+ 'email': _extract_email_from_links(links) or _extract_email(bio),
+ 'follower_count': 0,
+ 'website': _extract_website(links),
+ 'links': links[:20],
+ 'link_count': len(links),
+ 'socials': _extract_socials(links),
+ 'platform': 'stan',
+ 'profile_url': f'https://stan.store/{username}',
+ }
+
+
+def _parse_generic(html: str, username: str, platform: str) -> Optional[Dict]:
+ """Generic parser for link-in-bio pages."""
+
+ links = []
+ link_matches = re.findall(r'href="(https?://[^"]+)"', html)
+
+ seen = set()
+ for url in link_matches:
+ if url not in seen and not any(skip in url for skip in ['favicon', 'static', 'assets', '.css', '.js']):
+ links.append({'title': '', 'url': url})
+ seen.add(url)
+
+ title_match = re.search(r'<title>([^<]+)</title>', html)
+ full_name = title_match.group(1).strip() if title_match else ''
+
+ bio = ''
+ meta_desc = re.search(r'<meta[^>]*name="description"[^>]*content="([^"]*)"', html)
+ if meta_desc:
+ bio = meta_desc.group(1)
+
+ if not links:
+ return None
+
+ base_url = PLATFORMS.get(platform, '').format(username=username)
+
+ return {
+ 'username': username,
+ 'full_name': full_name,
+ 'bio': bio,
+ 'email': _extract_email_from_links(links) or _extract_email(bio),
+ 'follower_count': 0,
+ 'website': _extract_website(links),
+ 'links': links[:20],
+ 'link_count': len(links),
+ 'socials': _extract_socials(links),
+ 'platform': platform,
+ 'profile_url': base_url,
+ }
+
+
+def _extract_socials(links: List[Dict]) -> Dict[str, str]:
+ """Extract social media links from link list."""
+ socials = {}
+
+ patterns = {
+ 'instagram': r'instagram\.com/([^/?]+)',
+ 'twitter': r'(?:twitter|x)\.com/([^/?]+)',
+ 'tiktok': r'tiktok\.com/@?([^/?]+)',
+ 'youtube': r'youtube\.com/(?:@|c/|channel/)?([^/?]+)',
+ 'twitch': r'twitch\.tv/([^/?]+)',
+ 'github': r'github\.com/([^/?]+)',
+ 'linkedin': r'linkedin\.com/in/([^/?]+)',
+ 'discord': r'discord\.(?:gg|com/invite)/([^/?]+)',
+ 'spotify': r'open\.spotify\.com/(?:artist|user)/([^/?]+)',
+ 'soundcloud': r'soundcloud\.com/([^/?]+)',
+ }
+
+ for link in links:
+ url = link.get('url', '')
+ for platform, pattern in patterns.items():
+ if platform not in socials:
+ match = re.search(pattern, url, re.IGNORECASE)
+ if match:
+ socials[platform] = match.group(1)
+
+ return socials
+
+
+def _extract_website(links: List[Dict]) -> str:
+ """Extract a personal website URL from links, skipping social media."""
+ social_domains = [
+ 'instagram.com', 'twitter.com', 'x.com', 'tiktok.com',
+ 'youtube.com', 'twitch.tv', 'github.com', 'linkedin.com',
+ 'discord.gg', 'discord.com', 'spotify.com', 'soundcloud.com',
+ 'facebook.com', 'pinterest.com', 'snapchat.com', 'reddit.com',
+ 'stan.store', 'linktr.ee', 'linkr.bio', 'bio.link',
+ ]
+ for link in links:
+ url = link.get('url', '')
+ if url.startswith('http') and not url.startswith('mailto:'):
+ if not any(domain in url.lower() for domain in social_domains):
+ return url
+ return ''
+
+
+def _extract_email_from_links(links: List[Dict]) -> str:
+ """Extract email from mailto links."""
+ for link in links:
+ url = link.get('url', '')
+ if url.startswith('mailto:'):
+ return url.replace('mailto:', '').split('?')[0]
+ return ''
+
+
+_extract_email = _shared_extract_email
diff --git a/app/scrapers/pinterest.py b/app/scrapers/pinterest.py
new file mode 100644
index 0000000..2ffb735
--- /dev/null
+++ b/app/scrapers/pinterest.py
@@ -0,0 +1,175 @@
+"""
+Pinterest Profile Scraper
+
+Fetches public Pinterest profile information by extracting JSON from HTML.
+Extracts username, display name, bio, follower count, and website.
+No authentication required.
+"""
+
+import requests
+from typing import Dict, Optional
+import logging
+import re
+import json
+
+from app.scrapers.stealth import random_user_agent, get_requests_proxies
+from app.scrapers.utils import extract_email
+
+logger = logging.getLogger(__name__)
+
+
+def scrape_profile(username: str) -> Optional[Dict]:
+ """
+ Fetch Pinterest profile data.
+
+ Args:
+ username: Pinterest username
+ """
+ username = username.strip().lower()
+
+ url = f'https://www.pinterest.com/{username}/'
+
+ headers = {
+ 'User-Agent': random_user_agent(),
+ 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
+ 'Accept-Language': 'en-US,en;q=0.9',
+ }
+
+ try:
+ r = requests.get(url, headers=headers, timeout=20, proxies=get_requests_proxies())
+
+ if r.status_code == 404:
+ logger.error(f"Pinterest user {username} not found")
+ return None
+
+ if r.status_code != 200:
+ logger.error(f"Pinterest error {r.status_code} for {username}")
+ return None
+
+ html = r.text
+
+ if 'User not found' in html or "This page isn't available" in html:
+ logger.error(f"Pinterest user {username} not found")
+ return None
+
+ return _extract_profile_data(html, username)
+
+ except requests.exceptions.Timeout:
+ logger.error(f"Timeout fetching Pinterest profile {username}")
+ return None
+ except requests.exceptions.RequestException as e:
+ logger.error(f"Error fetching Pinterest profile {username}: {e}")
+ return None
+
+
+def _extract_profile_data(html: str, username: str) -> Optional[Dict]:
+ """Extract profile data from Pinterest HTML."""
+
+ results = {}
+
+ pws_match = re.search(r'<script[^>]*id="__PWS_DATA__"[^>]*>(.*?)</script>', html, re.DOTALL)
+ if pws_match:
+ try:
+ pws_data = json.loads(pws_match.group(1))
+ user_data = _find_user_in_pws(pws_data, username)
+ if user_data:
+ results.update(user_data)
+ except json.JSONDecodeError:
+ pass
+
+ if 'full_name' not in results:
+ name_match = re.search(r'"full_name":"([^"]+)"', html)
+ if name_match:
+ results['full_name'] = _decode_unicode(name_match.group(1))
+
+ if 'follower_count' not in results:
+ followers_match = re.search(r'"follower_count":(\d+)', html)
+ if followers_match:
+ results['follower_count'] = int(followers_match.group(1))
+
+ if 'following_count' not in results:
+ following_match = re.search(r'"following_count":(\d+)', html)
+ if following_match:
+ results['following_count'] = int(following_match.group(1))
+
+ if 'bio' not in results:
+ bio_match = re.search(r'"about":"([^"]*)"', html)
+ if bio_match:
+ results['bio'] = _decode_unicode(bio_match.group(1))
+
+ if 'website' not in results:
+ website_match = re.search(r'"website_url":"([^"]+)"', html)
+ if website_match:
+ results['website'] = website_match.group(1).replace('\\/', '/')
+
+ pin_match = re.search(r'"pin_count":(\d+)', html)
+ if pin_match:
+ results['pin_count'] = int(pin_match.group(1))
+
+ board_match = re.search(r'"board_count":(\d+)', html)
+ if board_match:
+ results['board_count'] = int(board_match.group(1))
+
+ verified_match = re.search(r'"is_verified_merchant":true', html)
+ results['verified'] = bool(verified_match)
+
+ if 'full_name' not in results and 'follower_count' not in results:
+ return None
+
+ bio = results.get('bio', '')
+
+ return {
+ 'username': username,
+ 'full_name': results.get('full_name', ''),
+ 'bio': bio,
+ 'email': _extract_email(bio),
+ 'website': results.get('website', ''),
+ 'follower_count': results.get('follower_count', 0),
+ 'following_count': results.get('following_count', 0),
+ 'pin_count': results.get('pin_count', 0),
+ 'board_count': results.get('board_count', 0),
+ 'verified': results.get('verified', False),
+ 'platform': 'pinterest',
+ 'profile_url': f'https://pinterest.com/{username}/',
+ }
+
+
+def _find_user_in_pws(data: dict, username: str, depth: int = 0) -> Optional[Dict]:
+ """Recursively search for user data in PWS JSON."""
+ if depth > 15:
+ return None
+
+ if isinstance(data, dict):
+ if data.get('username', '').lower() == username.lower() and 'follower_count' in data:
+ return {
+ 'full_name': data.get('full_name', ''),
+ 'bio': data.get('about', ''),
+ 'follower_count': data.get('follower_count', 0),
+ 'following_count': data.get('following_count', 0),
+ 'website': data.get('website_url', ''),
+ 'pin_count': data.get('pin_count', 0),
+ 'board_count': data.get('board_count', 0),
+ }
+
+ for value in data.values():
+ result = _find_user_in_pws(value, username, depth + 1)
+ if result:
+ return result
+
+ elif isinstance(data, list):
+ for item in data:
+ result = _find_user_in_pws(item, username, depth + 1)
+ if result:
+ return result
+
+ return None
+
+
+def _decode_unicode(text: str) -> str:
+ try:
+ return text.encode('utf-8').decode('unicode_escape')
+ except (UnicodeDecodeError, UnicodeEncodeError):
+ return text
+
+
+_extract_email = extract_email
diff --git a/app/scrapers/tiktok.py b/app/scrapers/tiktok.py
index 13eeee4..1bb2386 100644
--- a/app/scrapers/tiktok.py
+++ b/app/scrapers/tiktok.py
@@ -2,11 +2,12 @@ import json
import logging
import re
from datetime import datetime
-from typing import Dict, Any
+from typing import Dict, Optional
import httpx
from app.scrapers.stealth import random_user_agent, get_httpx_proxy
+from app.scrapers.utils import extract_email
logger = logging.getLogger(__name__)
@@ -35,7 +36,8 @@ def _build_headers() -> dict:
}
-def scrape_tiktok_profile(username: str) -> Dict[str, Any]:
+def scrape_tiktok_profile(username: str) -> Optional[Dict]:
+ """Scrape TikTok profile. Returns profile dict or None."""
url = f'https://www.tiktok.com/@{username}'
logger.info(f"Scraping TikTok profile: {url}")
@@ -45,10 +47,10 @@ def scrape_tiktok_profile(username: str) -> Dict[str, Any]:
resp.raise_for_status()
except httpx.HTTPStatusError as e:
logger.error(f"HTTP error for @{username}: {e.response.status_code}")
- return {'status': 'error', 'message': f'HTTP {e.response.status_code} for @{username}'}
+ return None
except httpx.RequestError as e:
logger.error(f"Request error for @{username}: {e}")
- return {'status': 'error', 'message': str(e)}
+ return None
html = resp.text
@@ -59,16 +61,13 @@ def scrape_tiktok_profile(username: str) -> Dict[str, Any]:
)
if not match:
logger.warning(f"Could not find rehydration data for @{username}")
- return {
- 'status': 'error',
- 'message': f'Could not extract profile data for @{username}. Page may require CAPTCHA or profile does not exist.',
- }
+ return None
try:
data = json.loads(match.group(1))
except json.JSONDecodeError as e:
logger.error(f"JSON parse error for @{username}: {e}")
- return {'status': 'error', 'message': f'Failed to parse profile data for @{username}'}
+ return None
try:
user_detail = data['__DEFAULT_SCOPE__']['webapp.user-detail']
@@ -77,22 +76,22 @@ def scrape_tiktok_profile(username: str) -> Dict[str, Any]:
stats = user_info.get('stats', {})
except (KeyError, TypeError) as e:
logger.error(f"Unexpected JSON structure for @{username}: {e}")
- return {'status': 'error', 'message': f'Unexpected data structure for @{username}'}
+ return None
+
+ bio = user.get('signature', '')
profile = {
'platform': 'tiktok',
'username': user.get('uniqueId', username),
'full_name': user.get('nickname', ''),
- 'bio': user.get('signature', ''),
+ 'bio': bio,
+ 'email': extract_email(bio),
'profile_url': url,
'is_verified': user.get('verified', False),
- 'profile_pic_url': user.get('avatarLarger', ''),
'follower_count': stats.get('followerCount', 0),
'following_count': stats.get('followingCount', 0),
'likes_count': stats.get('heartCount', 0),
'video_count': stats.get('videoCount', 0),
- 'scraped_from': f'@{username}',
- 'scraped_at': datetime.utcnow().isoformat(),
}
logger.info(
@@ -100,8 +99,4 @@ def scrape_tiktok_profile(username: str) -> Dict[str, Any]:
f"{profile['follower_count']} followers | {profile['likes_count']} likes"
)
- return {
- 'status': 'success',
- 'message': f'Scraped @{username} successfully',
- 'profile': profile,
- }
+ return profile
diff --git a/app/scrapers/twitch.py b/app/scrapers/twitch.py
index 9574168..03f5654 100644
--- a/app/scrapers/twitch.py
+++ b/app/scrapers/twitch.py
@@ -11,7 +11,8 @@ from typing import Dict, Optional
import logging
import re
-from app.scrapers.stealth import random_user_agent
+from app.scrapers.stealth import random_user_agent, get_requests_proxies
+from app.scrapers.utils import extract_email
logger = logging.getLogger(__name__)
@@ -58,12 +59,26 @@ def scrape_profile(username: str) -> Optional[Dict]:
""" % username
try:
- r = requests.post(
- 'https://gql.twitch.tv/gql',
- headers=headers,
- json={'query': query},
- timeout=20
- )
+ proxies = get_requests_proxies()
+ try:
+ r = requests.post(
+ 'https://gql.twitch.tv/gql',
+ headers=headers,
+ json={'query': query},
+ timeout=20,
+ proxies=proxies
+ )
+ except (requests.exceptions.ProxyError, requests.exceptions.ConnectionError) as e:
+ if proxies:
+ logger.warning(f"Proxy failed for Twitch, retrying direct: {e}")
+ r = requests.post(
+ 'https://gql.twitch.tv/gql',
+ headers=headers,
+ json={'query': query},
+ timeout=20
+ )
+ else:
+ raise
if r.status_code != 200:
logger.error(f"Twitch API error {r.status_code} for {username}")
@@ -128,9 +143,4 @@ def _format_profile(data: dict, username: str) -> Dict:
}
-def _extract_email(text: str) -> str:
- if not text:
- return ''
- pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
- matches = re.findall(pattern, text)
- return matches[0] if matches else ''
+_extract_email = extract_email
diff --git a/app/scrapers/utils.py b/app/scrapers/utils.py
new file mode 100644
index 0000000..0302a81
--- /dev/null
+++ b/app/scrapers/utils.py
@@ -0,0 +1,53 @@
+"""
+Shared scraper utilities.
+
+Common extraction functions used across all platform scrapers.
+"""
+
+import re
+from typing import List
+
+
+def extract_email(text: str) -> str:
+ """Extract first email address from text."""
+ if not text:
+ return ''
+ pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
+ matches = re.findall(pattern, text)
+ return matches[0] if matches else ''
+
+
+def extract_phone(text: str) -> str:
+ """Extract first phone number (10+ digits) from text."""
+ if not text:
+ return ''
+ patterns = [
+ r'\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}',
+ r'\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}',
+ r'\d{3}[-.\s]?\d{3}[-.\s]?\d{4}',
+ ]
+ for pattern in patterns:
+ matches = re.findall(pattern, text)
+ if matches:
+ phone = re.sub(r'[^\d+]', '', matches[0])
+ if len(phone) >= 10:
+ return phone
+ return ''
+
+
+def parse_abbreviated_number(s: str) -> int:
+ """Parse abbreviated numbers like 11M, 7.5K, 1.2B into integers."""
+ s = s.strip().replace(',', '')
+ multipliers = {'K': 1_000, 'M': 1_000_000, 'B': 1_000_000_000}
+
+ for suffix, mult in multipliers.items():
+ if s.upper().endswith(suffix):
+ try:
+ return int(float(s[:-1]) * mult)
+ except (ValueError, IndexError):
+ return 0
+
+ try:
+ return int(float(s))
+ except ValueError:
+ return 0
diff --git a/app/scrapers/youtube.py b/app/scrapers/youtube.py
index 4e41946..9e0351d 100644
--- a/app/scrapers/youtube.py
+++ b/app/scrapers/youtube.py
@@ -12,6 +12,7 @@ import logging
import re
from app.scrapers.stealth import random_user_agent, get_requests_proxies
+from app.scrapers.utils import extract_email, parse_abbreviated_number
logger = logging.getLogger(__name__)
@@ -127,29 +128,8 @@ def _extract_channel_data(html: str, identifier: str) -> Optional[Dict]:
}
-def _parse_count(s: str) -> int:
- """Parse subscriber counts like 1.5M, 500K, 1B."""
- s = s.strip().replace(',', '')
- multipliers = {'K': 1_000, 'M': 1_000_000, 'B': 1_000_000_000}
-
- for suffix, mult in multipliers.items():
- if s.upper().endswith(suffix):
- try:
- return int(float(s[:-1]) * mult)
- except (ValueError, IndexError):
- return 0
- try:
- return int(float(s))
- except ValueError:
- return 0
-
-
-def _extract_email(text: str) -> str:
- if not text:
- return ''
- pattern = r'\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b'
- matches = re.findall(pattern, text)
- return matches[0] if matches else ''
+_parse_count = parse_abbreviated_number
+_extract_email = extract_email
def _clean_redirect_url(url: str) -> str:
diff --git a/scout.py b/scout.py
index 1a17390..46a885e 100644
--- a/scout.py
+++ b/scout.py
@@ -4,6 +4,7 @@ import sys
import csv
import time
import os
+import logging
from pathlib import Path
if sys.platform == 'win32':
@@ -15,8 +16,15 @@ sys.path.insert(0, str(Path(__file__).parent))
from app import __version__
-if len(sys.argv) > 1:
- arg = sys.argv[1].lower()
+_verbose = '--verbose' in sys.argv or '-V' in sys.argv
+logging.basicConfig(
+ level=logging.DEBUG if _verbose else logging.WARNING,
+ format='%(name)s: %(message)s',
+)
+
+_args = [a for a in sys.argv[1:] if a not in ('--verbose', '-V')]
+if _args:
+ arg = _args[0].lower()
if arg in ('--version', '-v', 'version'):
print(f"Scout v{__version__}")
sys.exit(0)
@@ -28,6 +36,7 @@ if len(sys.argv) > 1:
print("Options:")
print(" --version, -v Show version")
print(" --help, -h Show this help")
+ print(" --verbose, -V Enable debug logging")
print()
print("Run without arguments to start the interactive menu.")
sys.exit(0)
@@ -224,10 +233,12 @@ def show_menu():
table.add_row("4", "GitHub", "profiles")
table.add_row("5", "YouTube", "channels")
table.add_row("6", "Twitch", "streamers")
+ table.add_row("7", "Linktree", "link-in-bio")
+ table.add_row("8", "Pinterest", "profiles")
table.add_row("", "", "")
- table.add_row("7", "Bulk Scrape", "from file")
- table.add_row("8", "Exports", "view files")
- table.add_row("9", "Proxy", "settings")
+ table.add_row("9", "Bulk Scrape", "from file")
+ table.add_row("10", "Exports", "view files")
+ table.add_row("11", "Proxy", "settings")
table.add_row("0", "Exit", "")
console.print(Panel(
@@ -416,10 +427,9 @@ def scrape_tiktok_interactive():
)
try:
- result = scrape_tiktok_profile(username)
+ profile = scrape_tiktok_profile(username)
- if result.get('status') == 'success' and result.get('profile'):
- profile = result['profile']
+ if profile:
profiles.append(profile)
progress.update(task, description=f"[green]✓ @{username}")
@@ -435,6 +445,8 @@ def scrape_tiktok_interactive():
if profile.get('bio'):
bio = profile['bio'][:80] + '...' if len(profile['bio']) > 80 else profile['bio']
info_table.add_row("Bio:", bio)
+ if profile.get('email'):
+ info_table.add_row("Email:", profile['email'])
console.print(info_table)
console.print()
@@ -553,10 +565,9 @@ def scrape_linkedin_interactive():
)
try:
- result = scrape_linkedin_profile(username)
+ profile = scrape_linkedin_profile(username)
- if result.get('status') == 'success' and result.get('profile'):
- profile = result['profile']
+ if profile:
profiles.append(profile)
progress.update(task, description=f"[green]✓ {username}")
@@ -579,8 +590,7 @@ def scrape_linkedin_interactive():
console.print(info_table)
console.print()
else:
- msg = result.get('message', 'Failed')
- progress.update(task, description=f"[red]✗ {username} - {msg[:60]}")
+ progress.update(task, description=f"[red]✗ {username} - Failed")
except Exception as e:
progress.update(task, description=f"[red]✗ {username} - Error")
@@ -987,6 +997,275 @@ def scrape_twitch_interactive():
))
+def scrape_linktree_interactive():
+ from app.scrapers.linktree import scrape_linktree, scrape_all
+
+ console.print()
+ console.print(Panel(
+ f"[bold {ACCENT}]LINK-IN-BIO[/bold {ACCENT}]\n[dim]Linktree, Stan & more[/dim]",
+ border_style=ACCENT_DIM,
+ box=box.HEAVY
+ ))
+ console.print()
+
+ console.print(f"[bold {ACCENT}]Select platform:[/bold {ACCENT}]")
+ console.print("[1] Linktree (linktr.ee)")
+ console.print("[2] Auto-detect (try all)")
+ console.print()
+
+ platform_choice = Prompt.ask("[>] Platform", choices=["1", "2"], default="1")
+
+ scraper_map = {
+ "1": (scrape_linktree, "linktree"),
+ "2": (scrape_all, "linkbio"),
+ }
+ scraper_func, platform_name = scraper_map[platform_choice]
+
+ console.print()
+ console.print("[white]Enter usernames (one per line)[/white]")
+ console.print("[dim]Press Enter on empty line when done[/dim]")
+ console.print()
+
+ usernames = []
+ while True:
+ username = Prompt.ask("Username", default="")
+ if not username:
+ break
+ username = username.strip()
+ if username:
+ usernames.append(username)
+ console.print(f"[green]✓[/green] Added {username}")
+
+ if not usernames:
+ console.print("[yellow]No usernames entered![/yellow]")
+ return
+
+ console.print()
+ console.print(f"[bold white]Scraping {len(usernames)} profiles...[/bold white]")
+ console.print()
+
+ profiles = []
+
+ with Progress(
+ SpinnerColumn(),
+ TextColumn("[progress.description]{task.description}"),
+ console=console
+ ) as progress:
+
+ for i, username in enumerate(usernames, 1):
+ task = progress.add_task(
+ f"[white]Scraping {username}...",
+ total=None
+ )
+
+ try:
+ profile = scraper_func(username)
+
+ if profile:
+ profiles.append(profile)
+ progress.update(task, description=f"[green]✓ {username}")
+
+ info_table = Table(show_header=False, box=None, padding=(0, 2))
+ info_table.add_column(style="dim")
+ info_table.add_column(style="white")
+
+ if profile.get('full_name'):
+ info_table.add_row("Name:", profile['full_name'][:50])
+ if profile.get('link_count'):
+ info_table.add_row("Links:", str(profile['link_count']))
+ if profile.get('bio'):
+ bio = profile['bio'][:80] + '...' if len(profile['bio']) > 80 else profile['bio']
+ info_table.add_row("Bio:", bio)
+ if profile.get('email'):
+ info_table.add_row("Email:", profile['email'])
+ if profile.get('socials'):
+ socials = profile['socials']
+ social_str = ', '.join([f"{k}" for k in list(socials.keys())[:4]])
+ info_table.add_row("Socials:", social_str)
+
+ console.print(info_table)
+ console.print()
+ else:
+ progress.update(task, description=f"[red]✗ {username} - Not found")
+
+ except Exception as e:
+ progress.update(task, description=f"[red]✗ {username} - Error")
+ console.print(f"[dim red]Error: {str(e)[:100]}[/dim red]")
+
+ if i < len(usernames):
+ random_delay(0.5, 1.5)
+
+ console.print()
+
+ if profiles:
+ result_panel = Panel(
+ f"[bold green]Successfully scraped {len(profiles)}/{len(usernames)} profiles[/bold green]",
+ style="green",
+ box=box.DOUBLE
+ )
+ console.print(result_panel)
+ console.print()
+
+ profiles = enrich_profiles(profiles)
+
+ if Confirm.ask("[+] Export to CSV?", default=True):
+ timestamp = time.strftime("%Y%m%d_%H%M%S")
+ filename = f"{platform_name}_export_{timestamp}.csv"
+
+ export_profiles = []
+ for p in profiles:
+ flat = {k: v for k, v in p.items() if k not in ['links', 'socials']}
+ if p.get('socials'):
+ for platform, handle in p['socials'].items():
+ flat[f'social_{platform}'] = handle
+ export_profiles.append(flat)
+
+ with open(filename, 'w', newline='', encoding='utf-8') as f:
+ if export_profiles:
+ all_keys = set()
+ for p in export_profiles:
+ all_keys.update(p.keys())
+ writer = csv.DictWriter(f, fieldnames=sorted(all_keys))
+ writer.writeheader()
+ writer.writerows(export_profiles)
+
+ console.print()
+ console.print(Panel(
+ f"[bold]Exported to:[/bold] [white]{filename}[/white]\n"
+ f"[bold]Total profiles:[/bold] {len(profiles)}",
+ title="[green]✓ Export Complete[/green]",
+ border_style="green"
+ ))
+ else:
+ console.print(Panel(
+ "[yellow]No profiles were scraped successfully[/yellow]",
+ style="yellow"
+ ))
+
+
+def scrape_pinterest_interactive():
+ from app.scrapers.pinterest import scrape_profile
+
+ console.print()
+ console.print(Panel(
+ f"[bold {ACCENT}]PINTEREST[/bold {ACCENT}]\n[dim]No login required[/dim]",
+ border_style=ACCENT_DIM,
+ box=box.HEAVY
+ ))
+ console.print()
+
+ console.print("[white]Enter Pinterest usernames (one per line)[/white]")
+ console.print("[dim]Press Enter on empty line when done[/dim]")
+ console.print()
+
+ usernames = []
+ while True:
+ username = Prompt.ask("Username", default="")
+ if not username:
+ break
+ username = username.strip()
+ if username:
+ usernames.append(username)
+ console.print(f"[green]✓[/green] Added {username}")
+
+ if not usernames:
+ console.print("[yellow]No usernames entered![/yellow]")
+ return
+
+ console.print()
+ console.print(f"[bold white]Scraping {len(usernames)} Pinterest profiles...[/bold white]")
+ console.print()
+
+ profiles = []
+
+ with Progress(
+ SpinnerColumn(),
+ TextColumn("[progress.description]{task.description}"),
+ console=console
+ ) as progress:
+
+ for i, username in enumerate(usernames, 1):
+ task = progress.add_task(
+ f"[white]Scraping {username}...",
+ total=None
+ )
+
+ try:
+ profile = scrape_profile(username)
+
+ if profile:
+ profiles.append(profile)
+ progress.update(task, description=f"[green]✓ {username}")
+
+ info_table = Table(show_header=False, box=None, padding=(0, 2))
+ info_table.add_column(style="dim")
+ info_table.add_column(style="white")
+
+ if profile.get('full_name'):
+ info_table.add_row("Name:", profile['full_name'][:50])
+ if profile.get('follower_count'):
+ info_table.add_row("Followers:", f"{profile['follower_count']:,}")
+ if profile.get('pin_count'):
+ info_table.add_row("Pins:", f"{profile['pin_count']:,}")
+ if profile.get('board_count'):
+ info_table.add_row("Boards:", f"{profile['board_count']:,}")
+ if profile.get('bio'):
+ bio = profile['bio'][:80] + '...' if len(profile['bio']) > 80 else profile['bio']
+ info_table.add_row("Bio:", bio)
+ if profile.get('website'):
+ info_table.add_row("Website:", profile['website'])
+ if profile.get('email'):
+ info_table.add_row("Email:", profile['email'])
+
+ console.print(info_table)
+ console.print()
+ else:
+ progress.update(task, description=f"[red]✗ {username} - Not found")
+
+ except Exception as e:
+ progress.update(task, description=f"[red]✗ {username} - Error")
+ console.print(f"[dim red]Error: {str(e)[:100]}[/dim red]")
+
+ if i < len(usernames):
+ random_delay(1.0, 2.5)
+
+ console.print()
+
+ if profiles:
+ result_panel = Panel(
+ f"[bold green]Successfully scraped {len(profiles)}/{len(usernames)} profiles[/bold green]",
+ style="green",
+ box=box.DOUBLE
+ )
+ console.print(result_panel)
+ console.print()
+
+ profiles = enrich_profiles(profiles)
+
+ if Confirm.ask("[+] Export to CSV?", default=True):
+ timestamp = time.strftime("%Y%m%d_%H%M%S")
+ filename = f"pinterest_export_{timestamp}.csv"
+
+ with open(filename, 'w', newline='', encoding='utf-8') as f:
+ if profiles:
+ writer = csv.DictWriter(f, fieldnames=profiles[0].keys())
+ writer.writeheader()
+ writer.writerows(profiles)
+
+ console.print()
+ console.print(Panel(
+ f"[bold]Exported to:[/bold] [white]{filename}[/white]\n"
+ f"[bold]Total profiles:[/bold] {len(profiles)}",
+ title="[green]✓ Export Complete[/green]",
+ border_style="green"
+ ))
+ else:
+ console.print(Panel(
+ "[yellow]No profiles were scraped successfully[/yellow]",
+ style="yellow"
+ ))
+
+
def scrape_from_file():
console.print()
console.print(Panel(
@@ -1025,19 +1304,25 @@ def scrape_from_file():
console.print(f"[bold {ACCENT}]Select platform:[/bold {ACCENT}]")
console.print("[1] Instagram")
console.print("[2] TikTok")
- console.print("[3] YouTube")
- console.print("[4] GitHub")
- console.print("[5] Twitch")
+ console.print("[3] LinkedIn")
+ console.print("[4] YouTube")
+ console.print("[5] GitHub")
+ console.print("[6] Twitch")
+ console.print("[7] Linktree")
+ console.print("[8] Pinterest")
console.print()
- platform_choice = Prompt.ask("[>] Platform", choices=["1", "2", "3", "4", "5"], default="1")
+ platform_choice = Prompt.ask("[>] Platform", choices=["1", "2", "3", "4", "5", "6", "7", "8"], default="1")
platform_map = {
"1": ("instagram", "Instagram"),
"2": ("tiktok", "TikTok"),
- "3": ("youtube", "YouTube"),
- "4": ("github", "GitHub"),
- "5": ("twitch", "Twitch"),
+ "3": ("linkedin", "LinkedIn"),
+ "4": ("youtube", "YouTube"),
+ "5": ("github", "GitHub"),
+ "6": ("twitch", "Twitch"),
+ "7": ("linktree", "Linktree"),
+ "8": ("pinterest", "Pinterest"),
}
platform_key, platform_name = platform_map[platform_choice]
@@ -1045,12 +1330,22 @@ def scrape_from_file():
from app.scrapers.instagram import scrape_profile_no_login as scraper_func
elif platform_key == "tiktok":
from app.scrapers.tiktok import scrape_tiktok_profile as scraper_func
+ elif platform_key == "linkedin":
+ cookie = os.environ.get('LINKEDIN_COOKIE', '').strip()
+ if not cookie:
+ console.print("[red]✗ LINKEDIN_COOKIE not set in .env. Cannot bulk scrape LinkedIn.[/red]")
+ return
+ from app.scrapers.linkedin import scrape_linkedin_profile as scraper_func
elif platform_key == "youtube":
from app.scrapers.youtube import scrape_channel as scraper_func
elif platform_key == "github":
from app.scrapers.github import scrape_profile as scraper_func
elif platform_key == "twitch":
from app.scrapers.twitch import scrape_profile as scraper_func
+ elif platform_key == "linktree":
+ from app.scrapers.linktree import scrape_linktree as scraper_func
+ elif platform_key == "pinterest":
+ from app.scrapers.pinterest import scrape_profile as scraper_func
console.print()
console.print(f"[white]Scraping {len(usernames)} {platform_name} profiles...[/white]")
@@ -1152,9 +1447,13 @@ def proxy_settings():
status_table = Table(show_header=False, box=None, padding=(0, 2))
status_table.add_column(style="dim")
status_table.add_column(style="white")
+ proxy_file = os.environ.get('SCOUT_PROXY_FILE', '')
+
status_table.add_row("Status:", f"[green]{ps}[/green]" if ps != 'none' else "[red]off[/red]")
if current_proxy:
status_table.add_row("Proxy URL:", current_proxy[:60])
+ if proxy_file:
+ status_table.add_row("Proxy File:", proxy_file[:60])
status_table.add_row("Free Proxy:", "[green]on[/green]" if free_enabled else "[dim]off[/dim]")
console.print(status_table)
console.print()
@@ -1163,14 +1462,15 @@ def proxy_settings():
options.add_column("Option", style="bold yellow", width=8)
options.add_column("Description", style="white")
options.add_row("1", "Set proxy URL")
- options.add_row("2", "Toggle free proxy on/off")
- options.add_row("3", "Test proxy connection")
- options.add_row("4", "Remove proxy")
- options.add_row("5", "Back to menu")
+ options.add_row("2", "Set proxy file (rotating list)")
+ options.add_row("3", "Toggle free proxy on/off")
+ options.add_row("4", "Test proxy connection")
+ options.add_row("5", "Remove proxy")
+ options.add_row("6", "Back to menu")
console.print(options)
console.print()
- choice = Prompt.ask("[bold yellow]Choose[/bold yellow]", choices=["1", "2", "3", "4", "5"], default="5")
+ choice = Prompt.ask("[bold yellow]Choose[/bold yellow]", choices=["1", "2", "3", "4", "5", "6"], default="6")
if choice == '1':
url = Prompt.ask("[>] Enter proxy URL (e.g. http://user:pass@host:port)")
@@ -1179,6 +1479,15 @@ def proxy_settings():
console.print(f"[green]✓ Proxy set to {url.strip()[:60]}[/green]")
elif choice == '2':
+ filepath = Prompt.ask("[>] Enter path to proxy list file (one proxy per line)")
+ if filepath.strip():
+ if os.path.exists(filepath.strip()):
+ _update_env('SCOUT_PROXY_FILE', filepath.strip())
+ console.print(f"[green]✓ Proxy file set to {filepath.strip()[:60]}[/green]")
+ else:
+ console.print(f"[red]✗ File not found: {filepath.strip()}[/red]")
+
+ elif choice == '3':
if free_enabled:
_update_env('SCOUT_FREE_PROXY', 'false')
console.print("[yellow]✓ Free proxy disabled[/yellow]")
@@ -1186,7 +1495,7 @@ def proxy_settings():
_update_env('SCOUT_FREE_PROXY', 'true')
console.print("[green]✓ Free proxy enabled[/green]")
- elif choice == '3':
+ elif choice == '4':
console.print("[white]Testing proxy connection...[/white]")
from app.scrapers.stealth import get_proxy
px = get_proxy()
@@ -1225,10 +1534,12 @@ def proxy_settings():
else:
console.print("[red]All free proxies failed. Use a paid proxy for reliability.[/red]")
- elif choice == '4':
+ elif choice == '5':
_update_env('SCOUT_PROXY', '')
_update_env('SCOUT_FREE_PROXY', 'false')
+ _update_env('SCOUT_PROXY_FILE', '')
os.environ.pop('SCOUT_PROXY', None)
+ os.environ.pop('SCOUT_PROXY_FILE', None)
console.print("[yellow]✓ Proxy removed[/yellow]")
@@ -1284,8 +1595,8 @@ def main():
try:
choice = Prompt.ask(
- f"[bold {ACCENT}]>[/bold {ACCENT}] [{ACCENT}]0-10[/{ACCENT}]",
- choices=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"],
+ f"[bold {ACCENT}]>[/bold {ACCENT}] [{ACCENT}]0-11[/{ACCENT}]",
+ choices=["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"],
default="1",
show_choices=False
)
@@ -1309,12 +1620,18 @@ def main():
scrape_twitch_interactive()
elif choice == '7':
- scrape_from_file()
+ scrape_linktree_interactive()
elif choice == '8':
- view_exports()
+ scrape_pinterest_interactive()
elif choice == '9':
+ scrape_from_file()
+
+ elif choice == '10':
+ view_exports()
+
+ elif choice == '11':
proxy_settings()
elif choice == '0':