Skip to content

Instantly share code, notes, and snippets.

View pmacMaps's full-sized avatar

Patrick McKinney pmacMaps

  • Commonwealth of Pennsylvania
  • Harrisburg, PA
  • 07:34 (UTC -05:00)
View GitHub Profile
@pmacMaps
pmacMaps / youtube_music_download.py
Created June 11, 2025 15:23
Python functions to extract audio files from YouTube videos
"""
These functions allow you to create mp3 files from YouTube videos. The scripts were created using Vibe coding.
You can view the AI conversation at https://chatgpt.com/share/684995e4-aa14-800b-9ce5-f8c74cd34d9a.
Backup of conversation located at https://github.com/pmacMaps/pmacMaps.github.io/blob/ec99d84c3c3f88eb6bb1a8c93251f95ed38f2cde/assets/documents/Download_Audio_From_YouTube_ChatGPT_Chat_History.pdf
download_playlist_audio: extracts audio from all videos in a playlist
download_audio: extracts audio from a single video
download_audio_segment: extracts audio from a single video using a start and end time stamp
Notes: you will need ffmpeg installed on the machine running this script.
@pmacMaps
pmacMaps / convert_pdf_to_audio_file.py
Created June 18, 2025 14:42
Convert a PDF file into an MP3 file
# Note: logic in app created via Vibe Coding using ChatGPT. You can review conversation at https://chatgpt.com/share/6852cff0-13a0-800b-8b0d-96a655a387cb
# This script converts a pdf of text into a MP3 file. Can be useful to converting long reports into audio files.
from gtts import gTTS
from PyPDF2 import PdfReader
from pydub import AudioSegment
import os
import sys
# === PDF TEXT EXTRACTION ===