This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
using the yt-dlp package | |
""" | |
import json | |
from pprint import pprint | |
import yt_dlp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import yt_dlp | |
url = input("Enter the URL of the video: ") | |
URLS = [] | |
URLS.append(url) | |
ydl_opts = { | |
'format': 'mp3/bestaudio/best', | |
'postprocessors': [{ | |
'key': 'FFmpegExtractAudio', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @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. |
NewerOlder