all repos — FixYouTube-legacy @ 31f04920c1bee2052588a51fe81008cc811b236b

A better way to embed YouTube videos everywhere (inspired by FixTweet).

fixyoutube/constants.py (view raw)

 1MAX_SIZE_MB = 50
 2YT_TTL_MINUTES = 60 * 6
 3DB_URL = "cache.db"
 4
 5UA_REGEX = r"bot|facebook|embed|got|firefox\/92|firefox\/38|curl|wget|go-http|yahoo|generator|whatsapp|preview|link|proxy|vkshare|images|analyzer|index|crawl|spider|python|cfnetwork|node"
 6BASE_URL = "https://www.youtube.com/watch?v="
 7REPO_URL = "https://github.com/BiRabittoh/FixYouTube"
 8PROXY_HEADERS = { "Content-Type": "video/mp4" }
 9YTDL_OPTS = { "format": f"best[ext=mp4][filesize<?{ MAX_SIZE_MB }M][filesize_approx<?{ MAX_SIZE_MB }M][protocol^=http][protocol!*=dash] / (bv*+ba/b)" }
10YTDL_KEYS = [ "id", "title", "description", "uploader", "duration", "height", "width", "url" ]
11URL_KEY = YTDL_KEYS[-1]