Skip to content

Instantly share code, notes, and snippets.

@AlexOcculate
AlexOcculate / gist:97078c77534342efb1ada3105619d33e
Created July 4, 2024 15:02 — forked from pinceladasdaweb/gist:6662290
Get Youtube Video Thumbnail with JavaScript.
var Youtube = (function () {
'use strict';
var video, results;
var getThumb = function (url, size) {
if (url === null) {
return '';
}
size = (size === null) ? 'big' : size;
@AlexOcculate
AlexOcculate / youtube.txt
Created July 4, 2024 14:52 — forked from iredun/youtube.txt
Youtube API get thumbnail image
Each YouTube video has 4 generated images. They are predictably formatted as follows:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg
http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:
http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
# must have miniconda installed
# installation for musicgen
conda create -n audiocraft python=3.9
conda activate audiocraft
brew install ffmpeg (for mac)
winget install ffmpeg (for windows)
git clone https://github.com/facebookresearch/audiocraft.git
cd audiocraft
python -m pip install -r requirements.txt
import ollama
import time
def read_file(file_path):
"""
Reads the content of a file and decodes it using the 'latin-1' encoding.
Args:
file_path (str): The path to the file to be read.
@AlexOcculate
AlexOcculate / truffle-material.md
Created April 18, 2019 17:26 — forked from smarr/truffle-material.md
Truffle: Languages and Material