This file contains 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 | |
from requests import get, post | |
from subprocess import Popen | |
from os import remove | |
from datetime import datetime | |
class Category: | |
HIGHLIGHTS = 71361 | |
CONDENSED = 71377 | |
FULL = 71385 |
This file contains 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 | |
import requests | |
from sys import stderr, stdout, argv | |
from os import environ | |
from os.path import basename | |
host = environ.get("PLEX_HOST", "localhost") | |
token = environ.get("PLEX_TOKEN", "") | |
args = argv[1:] |
This file contains 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 | |
import requests | |
from bs4 import BeautifulSoup as Soup | |
from sys import argv | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0' , | |
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' , | |
'Accept-Language': 'en-US,en;q=0.5', | |
'Content-Type': 'application/x-www-form-urlencoded' , |
This file contains 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
#!/bin/bash | |
PUB_URL="https://example.com/" | |
REMOTE="remote:path/" | |
cat >/tmp/cloud.conf <<EOFF | |
#!/bin/bash | |
apt-get update | |
apt-get install python3-pip ffmpeg -y | |
pip3 install youtube-dl |
This file contains 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
#!/bin/bash | |
function dlyt { | |
i=1 | |
while read p; do | |
mkdir -p "$1/Season $i" | |
cd "$1/Season $i" | |
youtube-dl -ciw -f 22 -o "%(autonumber)s - %(title)s.%(ext)s" "$p" | |
cd "$OLDPWD" | |
i=$((i+1)) | |
done |
This file contains 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 | |
from flask import * | |
app = Flask(__name__) | |
@app.route("/") | |
def index(): | |
buckets = "\n".join(f"scoop bucket add {bucket}" for bucket in request.args.get("buckets","").split(",")) if "buckets" in request.args else "" | |
packages = "\n".join(f"scoop install {package}" for package in request.args.get("pkgs","").split(",")) if "pkgs" in request.args else "" | |
return f"""Set-ExecutionPolicy RemoteSigned -scope CurrentUser |
This file contains 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
#!/bin/bash | |
# hlstranscode $URL | |
cat >/tmp/cloud.conf <<EOFF | |
#!/bin/bash | |
apt-get update -qq | |
apt-get install ffmpeg -y -qq | |
curl https://rclone.org/install.sh | bash 2>/dev/null >/dev/null | |
export ID=\$(curl http://169.254.169.254/metadata/v1/id 2>/dev/null) |
This file contains 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 | |
# let's say you have a bucket on b2 containing videos which you've converted, | |
# using https://github.com/vincentbernat/video2hls, to a HLS file structure | |
# in subdirectories named for the sha1 sum of the original file. | |
# This script would produce an index of files available via HLS by parsing | |
# the output of `b2 ls BUCKET DIRECTORY --json --recursive` (available as | |
# data.json), returning json like | |
# [ | |
# ["d5db29cd03a2ed055086cef9c31c252b4587d6d0", | |
# "filename.mp4"], |
This file contains 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
// We support the GET, POST, HEAD, and OPTIONS methods from any origin, | |
// and allow any header on requests. These headers must be present | |
// on all responses to all CORS preflight requests. In practice, this means | |
// all responses to OPTIONS requests. | |
const corsHeaders = { | |
"Access-Control-Allow-Origin": "*", | |
"Access-Control-Allow-Methods": "GET,HEAD,POST,OPTIONS", | |
"Access-Control-Max-Age": "86400", | |
} |
This file contains 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 | |
import xmltodict | |
import requests | |
def sizeof_fmt(num, suffix='B'): | |
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']: | |
if abs(num) < 1024.0: | |
return "%3.1f%s%s" % (num, unit, suffix) | |
num /= 1024.0 | |
return "%.1f%s%s" % (num, 'Yi', suffix) |