Skip to content

Instantly share code, notes, and snippets.

@hungte
hungte / megadecrypter.py
Last active January 10, 2025 00:05
A tool to decrypt mega encrypted link, inspired from https://github.com/denysvitali/megadecrypter/ because installing Crystal-lang is not an easy thing for most people.
#!/usr/bin/env python
# Copyright 2018 Hung-Te Lin. All rights reserved.
# Use of this source code is governed by MIT license.
"""A program to decrypt mega://enc2?.... link.
Inspired from https://github.com/denysvitali/megadecrypter
"""
import base64
import binascii
#!/usr/bin/env python3
import sys
import os
from PIL import Image
LRCROP = 600
def process(fpath):
im = Image.open(fpath)
@hungte
hungte / webp2jpg.py
Created December 14, 2024 08:59
Convert webp image files to jpeg files
#!/usr/bin/env python3
from PIL import Image
import sys
def convert(fn):
with Image.open(fn) as im:
new_name = fn.rpartition('.')[0] + '.jpg'
im.save(new_name)