⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.31
Server IP:
95.217.99.93
Server:
Linux sv1.sonichosted.com 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
proc
/
self
/
root
/
usr
/
lib64
/
python2.7
/
Edit File: mimetypes.pyc
zfc @ sq d Z d d l Z d d l Z d d l Z d d l Z y d d l Z Wn e k r_ d Z n Xd d d d d d g Z d d d d d d d d d g Z e a d a d d- d YZ e d Z e d Z e d Z e d Z d d Z d Z d Z e e d k rmd d l Z d Z d d Z y/ e j e j d d d d! d" g \ Z Z Wn# e j k rZ e d e n Xd Z d# Z xW e D]O \ Z! Z" e! d. k re d# qe! d/ k rd# Z qe! d0 k rd Z qqWxx e D]m Z# e r.e e# e Z$ e$ s&d* Ge# GHqfe$ GHqe e# e \ Z$ Z% e$ sUd* Ge# GHqd+ Ge$ Gd, Ge% GHqWn d S(1 s Guess the MIME type of a file. This module defines two useful functions: guess_type(url, strict=1) -- guess the MIME type and encoding of a URL. guess_extension(type, strict=1) -- guess the extension for a given MIME type. It also contains the following, for tuning the behavior: Data: knownfiles -- list of files to parse inited -- flag set when init() has been called suffix_map -- dictionary mapping suffixes to suffixes encodings_map -- dictionary mapping suffixes to encodings types_map -- dictionary mapping suffixes to types Functions: init([files]) -- parse a list of files, default knownfiles (on Windows, the default values are taken from the registry) read_mime_types(file) -- parse one file, return a dictionary or None iNt guess_typet guess_extensiont guess_all_extensionst add_typet read_mime_typest inits /etc/mime.typess /etc/httpd/mime.typess /etc/httpd/conf/mime.typess /etc/apache/mime.typess /etc/apache2/mime.typess$ /usr/local/etc/httpd/conf/mime.typess" /usr/local/lib/netscape/mime.typess /usr/local/etc/mime.typest MimeTypesc B sq e Z d Z d e d Z e d Z e d Z e d Z e d Z e d Z e d Z e d Z RS( s MIME-types datastore. This datastore can handle information from mime.types-style files and supports basic determination of MIME type from a filename or URL, and can guess a reasonable extension given a MIME type. c C s t s t n t j | _ t j | _ i i f | _ i i f | _ x- t j D] \ } } | j | | t qY Wx- t j D] \ } } | j | | t q Wx | D] } | j | | q Wd S( N( t initedR t encodings_mapt copyt suffix_mapt types_mapt types_map_invt itemsR t Truet common_typest Falset read( t selft filenamest strictt extt typet name( ( s! /usr/lib64/python2.7/mimetypes.pyt __init__@ s c C sJ | | j | | <| j | j | g } | | k rF | j | n d S( s Add a mapping between a type and an extension. When the extension is already known, the new type will replace the old one. When the type is already known the extension will be added to the list of known extensions. If strict is true, information will be added to list of standard types, else to the list of non-standard types. N( R R t setdefaultt append( R R R R t exts( ( s! /usr/lib64/python2.7/mimetypes.pyR N s c C s t j | \ } } | d k r | j d } | d k r@ d S| j d d | } | d k rn | | } n | | } d | k s d | k r d } n | d f St j | \ } } x3 | | j k r t j | | j | \ } } q W| | j k r"| j | } t j | \ } } n d } | j t } | | k rO| | | f S| j | k ru| | j | f S| rd | f S| j t } | | k r| | | f S| j | k r| | j | f Sd | f Sd S( s: Guess the type of a file based on its URL. Return value is a tuple (type, encoding) where type is None if the type can't be guessed (no or unknown suffix) or a string of the form type/subtype, usable for a MIME Content-type header; and encoding is None for no encoding or the name of the program used to encode (e.g. compress or gzip). The mappings are table driven. Encoding suffixes are case sensitive; type suffixes are first tried case sensitive, then case insensitive. The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped to '.tar.gz'. (This is table-driven too, using the dictionary suffix_map.) Optional `strict' argument when False adds a bunch of commonly found, but non-standard types. t datat ,i t ;t =t /s text/plainN( NN( t urllibt splittypet findt Nonet posixpatht splitextR R R R t lowerR ( R t urlR t schemet commat semiR t baseR t encodingR ( ( s! /usr/lib64/python2.7/mimetypes.pyR _ s@ $ c C sr | j } | j t j | g } | sn x@ | j t j | g D]" } | | k rE | j | qE qE Wn | S( s Guess the extensions for a file based on its MIME type. Return value is a list of strings giving the possible filename extensions, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. ( R' R R t getR R ( R R R t extensionsR ( ( s! /usr/lib64/python2.7/mimetypes.pyR s c C s$ | j | | } | s d S| d S( s Guess the extension for a file based on its MIME type. Return value is a string giving a filename extension, including the leading dot ('.'). The extension is not guaranteed to have been associated with any particular data stream, but would be mapped to the MIME type `type' by guess_type(). If no extension can be guessed for `type', None is returned. Optional `strict' argument when false adds a bunch of commonly found, but non-standard types. i N( R R$ ( R R R R/ ( ( s! /usr/lib64/python2.7/mimetypes.pyR s c C s) t | } | j | | Wd QXd S( s Read a single mime.types-format file, specified by pathname. If strict is true, information will be added to list of standard types, else to the list of non-standard types. N( t opent readfp( R t filenameR t fp( ( s! /usr/lib64/python2.7/mimetypes.pyR s c C s x | j } | s Pn | j } x9 t t | D]% } | | d d k r8 | | 3Pq8 q8 W| sm q n | d | d } } x% | D] } | j | d | | q Wq Wd S( s Read a single mime.types-format file. If strict is true, information will be added to list of standard types, else to the list of non-standard types. i t #i t .N( t readlinet splitt ranget lenR ( R R3 R t linet wordst iR t suffixest suff( ( s! /usr/lib64/python2.7/mimetypes.pyR1 s c C s t s d Sd } t j } t j t j d } x | | D] } y t j | | } | j d sw wD n t j | d \ } } | t j k r wD n y | j | } Wn t k r wD n X| j | | | Wd QXWqD t k r qD qD XqD WWd QXd S( s Load the MIME types database from Windows registry. If strict is true, information will be added to list of standard types, else to the list of non-standard types. Nc s s` d } xS t r[ y t j | | } Wn t k r9 Pn Xd | k rN | Vn | d 7} q Wd S( Ni s i ( R t _winregt EnumKeyt EnvironmentError( t mimedbR<