Skip to content

Instantly share code, notes, and snippets.

View kainabel's full-sized avatar

kainabel kainabel

  • Earth
  • 15:32 (UTC +02:00)
View GitHub Profile
@avrahamappel
avrahamappel / album.conf
Last active April 9, 2025 02:11
yt-dlp configuration for downloading music with metadata and cover art
# Download in m4a format
--format="ba"
--extract-audio
--audio-format m4a
# Continue downloading if the download failed previously
--continue
--no-overwrites
# Set track number, album name, and artist name metadata tags
@tinyapps
tinyapps / ytdlp_nest_comments.py
Last active April 2, 2025 23:10 — forked from pukkandan/ytdlp_nest_comments.py
Convert YouTube comments from an info.json file (acquired via yt-dlp --write-comments) to HTML.
#!/usr/bin/env python3
"""
Forked and modified from pukkandan/ytdlp_nest_comments.py:
https://gist.github.com/pukkandan/ee737fec64822f2552caf3ca4cbf5db7
which included this license and copyright information:
"SPDX-License-Identifier: MIT https://opensource.org/licenses/MIT
Copyright © 2021 [email protected]"
Convert YouTube comments from an info.json file (acquired via
@jabbalaci
jabbalaci / data-of-one-video.py
Created June 6, 2023 19:44
Fetch data of a YouTube video in JSON format
#!/usr/bin/env python3
"""
using the yt-dlp package
"""
import json
from pprint import pprint
import yt_dlp
@samiles
samiles / podcast.py
Last active November 22, 2023 15:49
Make a custom podcast stored in S3 from YouTube audio
"""
This script downloads the audio and thumbnail of a YouTube video, uploads them to Amazon S3, and updates a podcast RSS feed.
The script uses yt-dlp, boto3, feedgen, and other libraries for various tasks.
Args:
video_url (str): URL of the YouTube video to process.
Prints:
Video title
Thumbnail download status
@rajendrakumaryadav
rajendrakumaryadav / audio-extractor.py
Created August 7, 2022 15:13
Extact audio using yt-dlp, pass the urls as comma seperated form.
import yt_dlp
url = input("Enter the URL of the video: ")
URLS = []
URLS.append(url)
ydl_opts = {
'format': 'mp3/bestaudio/best',
'postprocessors': [{
'key': 'FFmpegExtractAudio',
@AmirAref
AmirAref / YoutubeInfo.py
Last active November 22, 2023 16:03
get the info of videos in youtube by links
from yt_dlp import YoutubeDL
from pandas import DataFrame
def extract_info(urls : list):
# check parameter type
if type(urls) == str:
urls = [urls]
# extract info
data = []
with YoutubeDL({'ignoreerrors':True}) as ytdl:
@kl
kl / yt_dlp_save_playlist.py
Last active November 22, 2023 15:43
yt_dlp plugin to create a m3u playlist when downloading a playlist. #ytdlp-plugins
# Plugin that creates an m3u playlist of the downloaded videos in the order
# they are downloaded. The m3u is named after the playlist and put in the
# output directory.
import os
# ⚠ Don't use relative imports
from yt_dlp.postprocessor.common import PostProcessor
# ℹ️ See the docstring of yt_dlp.postprocessor.common.PostProcessor
class SavePlaylistPP(PostProcessor):
@Secozzi
Secozzi / yt.py
Last active November 22, 2023 15:36
A script that hooks onto yt_dlp to create prettier and colorful logs with rich.
from rich.highlighter import RegexHighlighter
from rich.console import Console
from rich.markup import escape
from rich.theme import Theme
from rich.style import Style
from rich.text import Text
import sys
import re
@we-taper
we-taper / ydljson2cue.py
Last active January 12, 2024 16:20
Extract chapters part of the Youtube-dl's json info into a CUE file
#! python3
"""
Extract chapters part of the Youtube-dl's json info into a CUE file.
This file is in the public domain.
Requirements:
pydantic
python>=3.6
@0017031
0017031 / endianness.h
Created October 16, 2020 03:39 — forked from jtbr/endianness.h
cross-platform / cross-compiler standalone endianness conversion
/**
* @file endianness.h
* @brief Convert Endianness of shorts, longs, long longs, regardless of architecture/OS
*
* Defines (without pulling in platform-specific network include headers):
* bswap16, bswap32, bswap64, ntoh16, hton16, ntoh32 hton32, ntoh64, hton64
*
* Should support linux / macos / solaris / windows.
* Supports GCC (on any platform, including embedded), MSVC2015, and clang,
* and should support intel, solaris, and ibm compilers as well.