π¦ ClawHub
youtube copy of yt
by @inaor
Fetch YouTube video transcripts via APIFY API using residential proxies to bypass bot detection, supporting text and JSON output formats.
TERMINAL
clawhub install some-other-youtubeπ About This Skill
youtube-apify-transcript
Fetch YouTube transcripts via APIFY API (works from cloud IPs, bypasses YouTube bot detection).
Why APIFY?
YouTube blocks transcript requests from cloud IPs (AWS, GCP, etc.). APIFY runs the request through residential proxies, bypassing bot detection reliably.
Free Tier
Cost
Links
Setup
1. Create free APIFY account: https://apify.com/ 2. Get your API token: https://console.apify.com/account/integrations 3. Set environment variable:
# Add to ~/.bashrc or ~/.zshrc
export APIFY_API_TOKEN="apify_api_YOUR_TOKEN_HERE"Or use .env file (never commit this!)
echo 'APIFY_API_TOKEN=apify_api_YOUR_TOKEN_HERE' >> .env
Usage
Basic Usage
# Get transcript as text
python3 scripts/fetch_transcript.py "https://www.youtube.com/watch?v=VIDEO_ID"Short URL also works
python3 scripts/fetch_transcript.py "https://youtu.be/VIDEO_ID"
Options
# Output to file
python3 scripts/fetch_transcript.py "URL" --output transcript.txtJSON format (includes timestamps)
python3 scripts/fetch_transcript.py "URL" --jsonBoth: JSON to file
python3 scripts/fetch_transcript.py "URL" --json --output transcript.jsonSpecify language preference
python3 scripts/fetch_transcript.py "URL" --lang de
Output Formats
Text (default):
Hello and welcome to this video.
Today we're going to talk about...
JSON (--json):
{
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"transcript": [
{"start": 0.0, "duration": 2.5, "text": "Hello and welcome"},
{"start": 2.5, "duration": 3.0, "text": "to this video"}
],
"full_text": "Hello and welcome to this video..."
}
Error Handling
The script handles common errors:
Metadata
metadata:
clawdbot:
emoji: "πΉ"
requires:
env: ["APIFY_API_TOKEN"]
bins: ["python3"]
π‘ Examples
Basic Usage
# Get transcript as text
python3 scripts/fetch_transcript.py "https://www.youtube.com/watch?v=VIDEO_ID"Short URL also works
python3 scripts/fetch_transcript.py "https://youtu.be/VIDEO_ID"
Options
# Output to file
python3 scripts/fetch_transcript.py "URL" --output transcript.txtJSON format (includes timestamps)
python3 scripts/fetch_transcript.py "URL" --jsonBoth: JSON to file
python3 scripts/fetch_transcript.py "URL" --json --output transcript.jsonSpecify language preference
python3 scripts/fetch_transcript.py "URL" --lang de
Output Formats
Text (default):
Hello and welcome to this video.
Today we're going to talk about...
JSON (--json):
{
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"transcript": [
{"start": 0.0, "duration": 2.5, "text": "Hello and welcome"},
{"start": 2.5, "duration": 3.0, "text": "to this video"}
],
"full_text": "Hello and welcome to this video..."
}
βοΈ Configuration
# Output to file
python3 scripts/fetch_transcript.py "URL" --output transcript.txtJSON format (includes timestamps)
python3 scripts/fetch_transcript.py "URL" --jsonBoth: JSON to file
python3 scripts/fetch_transcript.py "URL" --json --output transcript.jsonSpecify language preference
python3 scripts/fetch_transcript.py "URL" --lang de
Output Formats
Text (default):
Hello and welcome to this video.
Today we're going to talk about...
JSON (--json):
{
"video_id": "dQw4w9WgXcQ",
"title": "Video Title",
"transcript": [
{"start": 0.0, "duration": 2.5, "text": "Hello and welcome"},
{"start": 2.5, "duration": 3.0, "text": "to this video"}
],
"full_text": "Hello and welcome to this video..."
}