Skip to content

Instantly share code, notes, and snippets.

View ESWZY's full-sized avatar
🧣
SO AWESOME

Woa ESWZY

🧣
SO AWESOME
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ESWZY on github.
  • I am eswzy (https://keybase.io/eswzy) on keybase.
  • I have a public key whose fingerprint is 0EDA 32EE CCC5 6F73 A7D8 69BC 01D2 9D34 2955 72A1

To claim this, I am signing this object:

@ESWZY
ESWZY / refresh_cookies_in_one_line.sh
Created April 23, 2021 02:17
Keep your cookie alive just in one line!
python3 -c "while True: print(__import__('requests').get('http://www.github.com',cookies={'MYSESSID':'blabla'}));__import__('time').sleep(1450)"
@ESWZY
ESWZY / compress_video.py
Last active April 18, 2024 14:16
An example Python code for compressing video file to target size.
# Simplified version and explanation at: https://stackoverflow.com/a/64439347/12866353
import os
import ffmpeg
def compress_video(video_full_path, size_upper_bound, two_pass=True, filename_suffix='cps_'):
"""
Compress video file to max-supported size.
:param video_full_path: the video you want to compress.
:param size_upper_bound: Max video size in KB.
# -*- coding: UTF-8 -*-
import hashlib
import json
import os
from sqlalchemy import create_engine
from sqlalchemy.orm import Session
from telegram_news.template import (
InfoExtractor,
NewsPostman,