Skip to content

Instantly share code, notes, and snippets.

@wassname
wassname / to_filename.py
Last active March 14, 2025 09:54
python convert string to safe filename
"""
Url: https://gist.github.com/wassname/1393c4a57cfcbf03641dbc31886123b8
"""
import unicodedata
import string
valid_filename_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
char_limit = 255
def clean_filename(filename, whitelist=valid_filename_chars, replace=' '):
// ==UserScript==
// @name Kinopoisk-Torronto
// @namespace http://torronto.evilbloodydemon.ru/
// @version 0.1
// @description Кнопка перехода на торронту для кинопоиска
// @author Igor Fomin
// @match http://www.kinopoisk.ru/film/*
// @grant none
// ==/UserScript==