
    !h                        S SK r S SKrS SKJr  S SKJr  S SKJr    S SKr \R                  R                    S r\ R                  " \	5         S SKrSSS5        Sr " S	 S
\5      rS S.S\S\S\4S jjrS S.S\S\S\4S jjrS S.S\S\S\4S jjrg! \	 a    S SK
r Nf = f! \ a    \" S\5        S r N~f = f! \	 a     Nf = f! , (       d  f       N}= f)    N)BytesIO)warn)ScrapyDeprecationWarningc                 $    U R                  U5      $ N)processdecompressordatas     `/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/scrapy/utils/_compression.py_brotli_decompressr   %   s    ''--    a  You have brotlipy installed, and Scrapy will use it, but Scrapy support for brotlipy is deprecated and will stop working in a future version of Scrapy. brotlipy itself is deprecated, it has been superseded by brotlicffi. Please, uninstall brotlipy and install brotli or brotlicffi instead. brotlipy has the same import name as brotli, so keeping both installed is strongly discouraged.c                 $    U R                  U5      $ r   )
decompressr	   s     r   r   r       s    **400r   i   c                       \ rS rSrSrg)_DecompressionMaxSizeExceeded0    N)__name__
__module____qualname____firstlineno____static_attributes__r   r   r   r   r   0   s    r   r   )max_sizer   r   returnc                   [         R                  " 5       n[         R                  " SS9n[        U 5      n[        5       nSnSnU(       am  UR                  [        5      n UR                  U5      nU[        U5      -  nU(       a  Xq:  a  [        SU SU S35      eUR                  U5        U(       a  Mm  UR                  S5        UR                  5       $ ! [         R                   a    X#:w  a  UnUR                  U5      n Ne f = f)Ni)wbits   .r   )The number of bytes decompressed so far (" B) exceed the specified maximum ( B).)zlibdecompressobjr   read_CHUNK_SIZEr   errorlenr   writeseek)	r   r   r
   raw_decompressorinput_streamoutput_streamoutput_chunkdecompressed_sizeinput_chunks	            r   _inflater0   4   s   %%'L))44=LIML
"''4	'22;?L 	S..)4/%& ':T# 
 	L)- ,. q) zz 
	/  0+66{C
	s    C ,DDc                z   [         R                  " 5       n[        U 5      n[        5       nSnSnU(       af  UR                  [        5      n[        X'5      nU[        U5      -  nU(       a  Xa:  a  [        SU SU S35      eUR                  U5        U(       a  Mf  UR                  S5        UR                  5       $ Nr   r   r   r    r!   )
brotliDecompressorr   r$   r%   r   r'   r   r(   r)   )r   r   r
   r+   r,   r-   r.   r/   s           r   	_unbrotlir5   V   s    &&(L4=LIML
"''4),DS..)4/%& ':T# 
 	L) , qr   c                   [         R                  " 5       nUR                  [        U 5      5      n[        5       nSnSnU(       a[  UR	                  [
        5      nU[        U5      -  nU(       a  Xa:  a  [        SU SU S35      eUR                  U5        U(       a  M[  UR                  S5        UR	                  5       $ r2   )
	zstandardZstdDecompressorstream_readerr   r$   r%   r'   r   r(   r)   )r   r   r
   r9   r,   r-   r.   s          r   _unzstdr:   k   s    --/L ..wt}=MIML
$))+6S..)4/%& ':T# 
 	L) , qr   )
contextlibr"   ior   warningsr   scrapy.exceptionsr   r3   ImportError
brotlicffir4   r   r   AttributeErrorsuppressr7   r%   
ValueErrorr   bytesintr0   r5   r:   r   r   r   <module>rF      s       6.$.##(	. % & 	J 	 ./  5  s  5  D /0  E    E  * -.  %  c  %  A  $#$  15 %	
	11  		8 &%sF   B B% C	
B"B= !B""B= %B:9B:=CC	
C