Standalone script to download a YouTube video's audio and cut meme clips from a timestamp list.
The input format is one item per line:
MM:SS Clip Name
Each clip starts at the timestamp and ends at the next timestamp (last one goes to the end of the source audio).
run.pymain pipelinetimestamps.txtsample timestamp listrequirements.txtPython dependencies.gitignore
yt-dlpandffmpeginstalled on PATH- Python 3.10+
Install Python deps:
python -m pip install -r requirements.txtpython run.py "<youtube-url>" timestamps.txt \
--workdir /tmp/meme_sound_projectKeep generated files:
python run.py "<youtube-url>" timestamps.txt --workdir /tmp/meme_sound_projectCleanup automatically:
python run.py "<youtube-url>" timestamps.txt --workdir /tmp/meme_sound_project --cleanupUpload to Google Drive folder MEME_sounds (service account JSON required):
python run.py "<youtube-url>" timestamps.txt \
--service-account /path/to/service-account.jsonThe script prints a small JSON summary:
{
"expected": 217,
"produced": 217,
"missing_count": 0,
"missing": [],
"output_dir": "/tmp/meme_sound_project/clips"
}- If YouTube throttles one extractor mode, the script retries using a fallback.
- Google API authentication is optional; without credentials upload is skipped.