403Webshell
Server IP : 35.80.110.71  /  Your IP : 216.73.216.221
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/calibre/calibre/scraper/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/calibre/calibre/scraper/__pycache__/simple.cpython-312.pyc
�

�f[���ddlZddlZddlZddlZddlmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZd�ZgZGd	�d
�Zd�Ze�Zdd�Zd
�Zedk(reegej8d��yy)�N)�Lock�Thread�	get_ident)�	iswindows)�PersistentTemporaryFile)�
retry_on_fail)�start_pipe_worker)�get_pathc��ddlm}ddlm}ddlm}|�ddlm}|�||�}tjjD�]1}|j�}|dk(r*t|jd�tj�	�	|jd
d�\}}|dk(rt#t%|���|dk(s�x	t'j(|�}	|j+|j-|	d
j/d��t1|	d���}
t3d��5}|j5|
j/d��ddd�dj6d�}tt'j>|�d����4y#t $rY��BwxYw#1swY�LxYw#t $r+}
ddl}d|j;�t=|
�d�}Yd}
~
�od}
~
wwxYw)Nr��QUrl)�must_use_qt)�setup_qt_logging�)�
SimpleScraper�test�utf-8)�file�:sEXITsFETCH�url�timeout�rz-scraper-result.html)�suffixT)�ok�	html_fileF)r�tb�err)�flush) �qt.corer
�calibre.gui2r�calibre.gui_launchr�simple_backendr�sys�stdin�buffer�strip�print�decode�stderr�split�	Exception�
SystemExit�int�json�loads�fetch�fromEncoded�encode�floatr�write�name�	traceback�
format_exc�str�dumps)�sourcer
rrr�s�line�cmd�rest�d�html�t�result�er6s               �*/usr/lib/calibre/calibre/scraper/simple.py�worker_mainrEs����(�3���-��M��f��A��	�	� � �2���z�z�|���V���$�+�+�g�&�S�Z�Z�8�	��
�
�4��+�I�C���'�>��S��Y�'�'��(�?�	
;��J�J�t�$���w�w�t�/�/��%�����0H�I�SX�YZ�[d�Ye�Sf�w�g��
-�4J�K�2�q��G�G�D�K�K��0�1�2� $�1�6�6�:���$�*�*�V�$�D�1�+2���	��	��2�2��	�
T� � %�Y�-A�-A�-C�C�PQ�F�S���
T�s7�
E?�AF�#!F�?	F�F�F	�	G�$!G
�
Gc�0�eZdZd�Zd�Zd�Zdd�Zd�ZeZy)�Overseerc��t�|_i|_tj	tj|��y�N)r�lock�workers�	overseers�append�weakref�ref)�selfs rD�__init__zOverseer.__init__9s)���F��	����������T�*�+�c�D�	|j|�S#t$rYywxYwrI)�waitr+)rP�wrs   rD�	safe_waitzOverseer.safe_wait>s'��	��6�6�'�?�"���	��	�s��	�c���|�dt���}|j5|jj|�}|� t	d|�d��}|x}|j|<ddd�|S#1swYSxYw)Nz::z<from calibre.scraper.simple import worker_main; worker_main(�))rrJrK�getr	)rPr:�wname�ansrUs     rD�worker_for_sourcezOverseer.worker_for_sourceDs|���(�"�Y�[�M�*��
�Y�Y�	.��,�,�"�"�5�)�C��{�%�(d�ek�dn�no�&p�q��,-�-��d�l�l�5�)�		.�
�
�	.�
�
�s�>A$�$A.c��ddlm}|j|�}t|t�r||�}|j
j
d�|j
j
tjt|j��jd�|d��jd��|j
j
d�|j
j�tj|jj!��}|dst#|d��t%|d	d
�5}|j'�jd�}ddd�t)t*j,|d	�S#1swY�(xYw)NrrsFETCH:r)rr�
rrr�rb)rr
r\�
isinstancer8r$r4r.r9�bytes�	toEncodedr(r2rr/�stdout�readline�
ValueError�open�readr�os�remove)	rP�url_or_qurlr:rr
rU�output�fr@s	         rD�	fetch_urlzOverseer.fetch_urlMs�� ��"�"�6�*���k�3�'��{�+�K�	���
�
�i� �	���
�
�d�j�j��{�/D�/D�/F�)G�)N�)N�w�)W�dk�!l�m�t�t�u|�}�~�	���
�
�e��	���
�
�����A�H�H�-�-�/�0���d�|��V�E�]�+�+�
�&��%�t�
,�	,���6�6�8�?�?�7�+�D�	,��b�i�i���!4�5���	,�	,�s�5 E<�<Fc�b�|j5|jj�D]k}|jj	d�|jj�|jj
�|jj
��m|jj�D]O}|j|d���|j�tr�-|j|d���@|j��Q|jj�ddd�y#1swYyxYw)NsEXIT:0
g�������?g�������?)
rJrK�valuesr$r4r�closercrV�	terminater�kill�clear)rPrUs  rD�__del__zOverseer.__del__^s���
�Y�Y�	!��\�\�(�(�*�
!�����
�
�k�*����
�
�����
�
������� �	
!�
�\�\�(�(�*�
%���>�>�!�S�)�1��K�K�M�$��>�>�!�S�1�9��F�F�H�
%�
�L�L��� �	!�	!�	!�s�B8D%�D%�D%�0,D%�%D.N)��<)	�__name__�
__module__�__qualname__rQrVr\rmrtrp�rRrDrGrG7s"��,�
���"
!�
�ErRrGc����g�tD]D}|�}|��
t|jd��}|j��j	|��Ftdd�=�fd�}|S)N�
CloseOverSeer)�targetr5c�4���D]}|j��yrI)�join)rA�threadss �rD�join_allz#cleanup_overseers.<locals>.join_allys����	�A�
�F�F�H�	rR)rLrrp�startrM)�x�orAr�r�s    @rD�cleanup_overseersr�os]����G�
���
�C���=��a�g�g�O�<�A�
�G�G�I��N�N�1���	�!����OrRc��t5|s|jt��|d}ddd�ddlm}|j||���S#1swY�(xYw)Nr)�strip_encoding_declarationsr)�
read_url_lockrMrG�calibre.ebooks.chardetr�rm)�storagerr�scraperr�s     rD�read_urlr��sU��	����N�N�8�:�&��!�*���C�&�w�'8�'8��g�'8�'N�O�O���s�!A�Ac�4����ddl�ddl}ddlm�m�d}dt
jjdd�v}|rd}ndt
jvrd}|j||�G���fd	�d
|j��}|jj|�S)Nr)�
fromstring�tostringru�libasan�
LD_PRELOADz)Skipping Scraper tests as ASAN is enabled�SKIP_QT_BUILD_TESTz7Skipping Scraper tests as it causes crashes in macOS VMc���eZdZ���fd�Zy)�.find_tests.<locals>.TestSimpleWebEngineScraperc���ddlm}t�}dD]�}td|�d�d��}|j	|�}|j|d�}�
��fd	�}t
|d
�5}|j�jd�}ddd�|j||�|����|jt|j
dd�|j}	|jt|	�d
�~|j|	�y#1swY��xYw)Nrr)�book�navztemplates/new_z.htmlF)�allow_user_overriderc�j����|jd��dd��}�jdd|�S)NrT�unicode)�pretty_print�encodingz\s+� )r2�sub)�ar[r��rer�s  ���rD�czGfind_tests.<locals>.TestSimpleWebEngineScraper.test_dom_load.<locals>.c�s3���"�:�a�h�h�w�.?�#@�t�^g�h�C��6�6�&�#�s�3�3rRr_rzfile:///does-not-exist.htmlr)rr
rG�P�
fromLocalFilermrfrgr(�assertEqual�assertRaisesrerK�len�assertFalse)
rPr
�overseerrl�pathrr@r��rawrUr�r�r�s
          ���rD�
test_dom_loadz<find_tests.<locals>.TestSimpleWebEngineScraper.test_dom_load�s����$��z�H�$�

2���>�!��E�2��N���(�(��.���)�)�#�v�6��4��$��%�3���&�&�(�/�/�'�2�C�3�� � ��4��!�C�&�1�

2�
���j�(�*<�*<�>[�]c�d�� � �A����S��V�Q�'�����Q��3�3�s� D�D	N)rwrxryr�)r�r�r�s���rD�TestSimpleWebEngineScraperr��s���	 rRr�)r��unittest�	lxml.htmlr�r�rh�environrY�skipIf�TestCase�defaultTestLoader�loadTestsFromTestCase)r��skip�is_sanitizedr�r�r�r�s    @@@rD�
find_testsr��s����
��.�
�D���
�
���|�R� @�@�L��:��	����	+�H��
�_�_�T�4� � � �X�%6�%6� �!� �,�%�%�;�;�<V�W�WrR�__main__���)rv)r.rhr#rN�	threadingrrr�calibre.constantsr�calibre.ptempfiler�calibre.utils.filenamesr�calibre.utils.ipc.simple_workerr	�calibre.utils.resourcesr
r�rErLrGr�r�r�r�rwr'�argvrzrRrD�<module>r�s���
�	�
��-�-�'�5�1�=�1�2�D
�	�5�5�p
� ��
�P�"X�J�z��	�(�2�s�x�x��|�
$�%�rR

Youez - 2016 - github.com/yon3zu
LinuXploit