Skip to content

Instantly share code, notes, and snippets.

View theychx's full-sized avatar
🐽
Oink! Oink?

theychx

🐽
Oink! Oink?
View GitHub Profile
@theychx
theychx / letters.py
Last active May 20, 2020 22:50 — forked from vampjaz/letters.py
Print out large ASCII block letters using python
# Original font: http://www.stuffaboutcode.com/2013/08/raspberry-pi-minecraft-twitter.html
LETTERS = {
"a": ["###", "# #", "###", "# #", "# #"],
"b": ["###", "# #", "###", "# #", "###"],
"c": ["###", "# ", "# ", "# ", "###"],
"d": ["## ", "# #", "# #", "# #", "## "],
"e": ["###", "# ", "###", "# ", "###"],
"f": ["###", "# ", "###", "# ", "# "],
"g": ["###", "# #", "###", " #", "###"],
"h": ["# #", "# #", "###", "# #", "# #"],
"""
Controller to interface with the YouTube-app.
Use the media controller to play, pause etc.
"""
import threading
from casttube import YouTubeSession
from . import BaseController
from ..error import UnsupportedNamespace
from ..config import APP_YOUTUBE
@theychx
theychx / ytdl_totalsize.py
Last active October 2, 2023 08:31
Script that uses youtube-dl to calculate total size of all videos in a playlist (also works with single videos). Now at this repo: https://github.com/theychx/totalsize
#! /usr/bin/env python3
import math
import sys
import youtube_dl
BEST_FORMAT = "bestvideo+bestaudio/best"
@theychx
theychx / cc-play.py
Last active May 28, 2018 08:50
Script that pushes url to a Chromecast, and then remains in foreground until playback has completed. Requires PyChromecast>=0.8.0.
#! /usr/bin/env python3
import os
import signal
import sys
import tempfile
import threading
import pychromecast
#! /usr/bin/env python3
import sys
from urllib.parse import urlparse
from urllib.request import urlopen
import codecs
import json
ITUNES_URL = 'https://itunes.apple.com/lookup?id='