Skip to content

Instantly share code, notes, and snippets.

@jam53
jam53 / YouTubeCommentsExporter.py
Created June 18, 2026 08:51
Python script to fetch all YouTube comments from a channel or filter them by a specific user using the YouTube Data API v3.
import googleapiclient.discovery
API_KEY = "" # YouTube Data API v3 API key
TARGET_CHANNEL_ID = "" # The channel you want to search through
EXPORT_ALL = True # Set to `True` to export ALL comments. Set to `False` to filter by a specific author.
COMMENT_AUTHOR_ID = "" # Only used if EXPORT_ALL is `False`, in that case returns comments from this specific user
youtube = googleapiclient.discovery.build("youtube", "v3", developerKey=API_KEY)
next_page_token = None
@jam53
jam53 / DownloadPinterestOriginalSource.py
Created February 22, 2026 10:27
Given a Pinterest link to a pin, this script grabs the source image (or video) from the webpage and downloads it. Provided the Pin ID in the URL consists purely of numbers.
# Prerequisite: pip install requests
# Usage: python DownloadPinterestOriginalSource.py <pin_url> -o <output_dir>
# Example: python DownloadPinterestOriginalSource.py https://www.pinterest.com/pin/41447259074000929/ -o Downloads
# Options:
# -o, --output-dir: Directory to save the image (default: Downloads)
# -h, --help: Show help message and exit
import argparse
import pathlib
import re
@jam53
jam53 / CalculatingYouTubeWatchTime.md
Last active October 5, 2023 18:43
A concise guide that outlines the process of calculating ones total watch time on YouTube

Calculating YouTube watch time

Prerequisites

YouTube watch history

Request a copy of your YouTube watch history over at Google Takeout

  • Click on Deselect all
  • Scroll down and select YouTube and YouTube Music
  • Click on All YouTube data included
  • Make sure to only select history