Allows you to import Python modules from the top level of a GitHub repository. Basically, golang's import semantics but in Python fashion.
>>> import githubimport
>>> from MineRobber9000.test_modules import blah
>>> blah.foo()
"bar"
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
if (!$isAdmin) { | |
Write-Host "Please run this script as administrator." | |
exit | |
} | |
if (Get-Command ffmpeg -ErrorAction SilentlyContinue) { | |
Write-Host "ffmpeg is already installed." | |
exit | |
} |
<?php | |
// half-hearted CSS minification | |
$css = preg_replace( | |
array('/\s*(\w)\s*{\s*/','/\s*(\S*:)(\s*)([^;]*)(\s|\n)*;(\n|\s)*/','/\n/','/\s*}\s*/'), | |
array('$1{ ','$1$3;',"",'} '), | |
file_get_contents('linked.css') | |
); | |
// embed as a data: uri | |
$base64css = rtrim(strtr(base64_encode($css), '+/', '-_'), '='); |
import threading | |
import asyncio | |
from queue import Queue as BlockingQueue | |
class TwoSidedQueue: | |
""" | |
Behaves like an `asyncio.Queue`, but `get` and `put` act on different ends. | |
""" | |
def __init__(self, queue_in, queue_out): |
<?php | |
// TelegramWebValidator.php | |
namespace SFPL\Telegram; | |
class WebDataException extends \Exception{}; | |
class WebValidator | |
{ | |
private string $bottoken; | |
private int $time_to_expire = 86400; |
from pyrogram import Client, filters | |
app = Client('CONVERSATION_EXAMPLE') | |
conversations = {} | |
infos = {} | |
def conv_filter(conversation_level): | |
def func(_, __, message): | |
return conversations.get(message.from_user.id) == conversation_level |
# copied from https://github.com/tulir/mautrix-telegram/blob/master/mautrix_telegram/util/parallel_file_transfer.py | |
# Copyright (C) 2021 Tulir Asokan | |
import asyncio | |
import hashlib | |
import inspect | |
import logging | |
import math | |
import os | |
from collections import defaultdict | |
from typing import Optional, List, AsyncGenerator, Union, Awaitable, DefaultDict, Tuple, BinaryIO |
;; This is the Welcome Bot in @PyrogramChat (Telegram) written in Hy | |
;; | |
;; Example ported from | |
;; https://github.com/pyrogram/pyrogram/blob/c2da2a61ece6711bd7ed51d68249995843ff5dec/examples/welcome_bot.py | |
;; | |
(import [pyrogram [Client Emoji Filters]]) | |
(setv MENTION "[{}](tg://user?id={})") | |
(setv MESSAGE "{} Welcome to [Pyrogram](https://docs.pyrogram.ml/)'s group chat {}!") |
Last updated: April 2021
Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22
).
Depending on the age and/or popularity of the video, not all formats will be available.
Resolution | AV1 HFR High | AV1 HFR | AV1 | VP9.2 HDR HFR | VP9 HFR | VP9 | H.264 HFR | H.264 |
---|---|---|---|---|---|---|---|---|
MP4 | MP4 | MP4 | WebM | WebM | WebM | MP4 | MP4 |