__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

��g�!����SSKrSSKrSSKrSSKrSSKJr "SS\RR5r	\RRS\	5 \RRRS/5 g)�N)�BackendExceptionc�j�\rSrSrSrSrSrSrSrSr	Sr
S	rS
rSr
SSjrS
rSrSrSrg)�
Megav2Backend�a�Backend for MEGA.nz cloud storage, only one that works for accounts created since Nov. 2018
See https://github.com/megous/megatools/issues/411 for more details

This MEGA backend resorts to official tools (MEGAcmd) as available at https://mega.nz/cmd
MEGAcmd works through a single binary called "mega-cmd", which talks to a backend server
"mega-cmd-server", which keeps state (for example, persisting a session). Multiple "mega-*"
shell wrappers (ie. "mega-ls") exist as the user interface to "mega-cmd" and MEGA API
The full MEGAcmd User Guide can be found in the software's GitHub page below :
https://github.com/meganz/MEGAcmd/blob/master/UserGuide.mdc��[RRRX5 UR	S5 UR	S5 UR	S5 UR	S5 UR	S5 UR	S5 UR	S5 UR	S5 UR	S	5 UR
UlURc�[R"S
5S3Ul
[URS5n0nUHEnURS5SSS2upg[UR!55XFR!5'MG UR#5 USUlUSUlO&UR(UlUR+5UlSUR,SS3UlUR15 SUR./nUR3U5 g![an[S
URS35eSnAff=f![a%nUR5UR.5 SnAgSnAff=f)N�
mega-login�mega-logoutzmega-cmdzmega-cmd-server�mega-ls�
mega-mkdir�mega-get�mega-put�mega-rm�HOMEz
/.megav2rc�rzYNo password provided in URL and MEGA configuration file for duplicity does not exist as '�'�=��Username�Password�/�)�	duplicity�backend�Backend�__init__�_check_binary_exists�hostname�	_hostname�password�os�getenv�_megarc�open�	Exceptionr�	partition�str�strip�close�	_username�	_password�username�get_password�path�_folder�
mega_login�subprocess_popen�_makedir)	�self�
parsed_url�	conf_file�e�myvars�line�name�var�cmds	         �B/usr/lib/python3/dist-packages/duplicity/backends/megav2backend.pyr�Megav2Backend.__init__)s
�����!�!�*�*�4�<�	
�!�!�,�/��!�!�-�0��!�!�*�-��!�!�"3�4��!�!�)�,��!�!�,�/��!�!�*�-��!�!�*�-��!�!�)�,�$�,�,������&� �i�i��/�0�
�;�D�L�
� ����s�3�	��F�!�� �N�N�3�/��!��4�	��'*�3�9�9�;�'7��z�z�|�$�"�
�O�O��#�J�/�D�N�#�J�/�D�N�(�0�0�D�N�!�.�.�0�D�N��:�?�?�1�2�.�/�0���	
�����$�,�,�'��	(��!�!�#�&��3�
�&�4�48�L�L�>��D����
��4�	(��M�M�$�,�,�'�'��	(�s0�G6�$H!�6
H�H�H�!
I�+I�Ic�x�[R"SU/5 g![an[SUS35eSnAff=f)zGChecks that a specified command exists in the running user command path�whichz	Command 'zw' not found, make sure 'MEGAcmd' tools (https://mega.nz/cmd) is properly installed and in the running user command pathN)�
subprocess�check_outputr$r)r2r:r5s   r;r�"Megav2Backend._check_binary_exists[sI��	��#�#�W�c�N�3���	�"��C�5�!M�N��
��	�s��
9�4�9c���UR5 SSU/nURU5 g![a7n[U5nSU;a[	SUS35e[	SUSUS35eSnAff=f)	z5Creates a remote directory (recursively if necessary)rz-pzFolder already existszFolder 'zp' could not be created on MEGA because it already exists. Use another path or remove the folder in MEGA manuallyz"' could not be created, reason : 'rN)r/r0r$r&r)r2r-r:r5�	error_strs     r;r1�Megav2Backend._makedirgs���	
�����T�4�(��
	`��!�!�#�&���	`��A��I�&�)�3�&��t�f�%M�N���
'��$��7Y�Z[�Y\�\]�'^�_�_��	`�s�)�
A*�2A%�%A*c���URUR55 URUR	5R5UR5S9 g![a NGf=f)zoUploads file to the specified remote folder (tries to delete it first to make
sure the new one can be uploaded))�
local_file�remote_fileN)�delete�decoder$�upload�
get_canonical)r2�source_path�remote_filenames   r;�_put�Megav2Backend._putxsd��	��K�K��.�.�0�1�	
���"�0�0�2�9�9�;�'�.�.�0�	�	
���	��	�s�A�
A)�(A)c�p�URUR5URR5S9 g)z-Downloads file from the specified remote path)rGrFN)�downloadrIr8)r2rM�
local_paths   r;�_get�Megav2Backend._get�s*��	
�
�
�/�"8�"8�":�z���G]�G]�G_�
�`�c� �URSS9$)z(Lists files in the specified remote pathT)�
files_only)�folder_contents)r2s r;�_list�Megav2Backend._list�s���#�#�t�#�4�4rUc�>�URUR5S9 g)z+Deletes file from the specified remote path)rGN)rHrI)r2�filenames  r;�_delete�Megav2Backend._delete�s��	
������ 1��2rUc�,�S/nURU5 g)z/Function called when backend is done being usedr	N)r0)r2r:s  r;�_close�Megav2Backend._close�s���o�����c�"rUc�V�[R"SSS9 g	![Ra [S5e[ahnSUR
UR/n[R"U[RS9 S	nAg	![an[SUS35eS	nAff=fS	nAff=f)
z�Helper function to call from each method interacting with MEGA to make
sure a session already exists or one is created to start withzmega-sessionr)�timeoutz<Timed out while trying to determine if a MEGA session existsr)�stderrz#Could not log in to MEGA, error : 'rN)r?r@�TimeoutExpiredrr$r)r*�DEVNULL)r2r5r:s   r;r/�Megav2Backend.mega_login�s���		S��#�#�N�B�?���(�(�	c�"�#a�b�b��	S��������@�C�
S��'�'��J�4F�4F�G���
S�&�)L�Q�C�q�'Q�R�R��
S��		S�s3��(B(�B#�#B�
B �B�B � B#�#B(c�H�SSUR/nUR5 [R"U5nUR	5RS5nU(aAUVs/sH4n[R"SU5(dM!UR5SPM6 nnU$s snf)zHLists contents of a remote MEGA path, optionally ignoring subdirectoriesr
z-l�
z^-�)r.r/r?r@rI�split�re�search)r2rWr:�files�fs     r;rX�Megav2Backend.folder_contents�s����$����-�������'�'��,������$�$�T�*���+0�G�5�a�B�I�I�d�A�4F�\�Q�W�W�Y�q�\�5�E�G����Hs�  B�Bc�n�SURSU3U/nUR5 URU5 g)z(Downloads a file from a remote MEGA pathrrN�r.r/r0)r2rGrFr:s    r;rQ�Megav2Backend.download�s7���d�l�l�^�1�[�M�:�J�G���������c�"rUc��SXRSU3/nUR5 URU5 g	![a7n[	U5nSU;a[SUS35e[SUSUS35eS	nAff=f)
z$Uploads a file to a remote MEGA pathr
rzReached storage quotaz1MEGA account over quota, could not write file : 'zC'. Upgrade your storage at https://mega.nz/pro or remove some data.zFailed writing file 'z' to MEGA, reason : 'rN)r.r/r0r$r&r)r2rFrGr:r5rCs      r;rJ�Megav2Backend.upload�s����:�,�,��q��
�'F�G������
	g��!�!�#�&���	g��A��I�&�)�3�&�G��}�UW�X���
'�)>�{�m�K`�ab�`c�cd�'e�f�f��	g�s�7�
A8�2A3�3A8c�n�SSURSU3/nUR5 URU5 g)z&Deletes a file from a remote MEGA pathrz-frNrr)r2rGr:s   r;rH�Megav2Backend.delete�s7���$�4�<�<�.��+�� ?�@���������c�"rU)r.rr"r*r)N)F)�__name__�
__module__�__qualname__�__firstlineno__�__doc__rrr1rNrSrYr]r`r/rXrQrJrH�__static_attributes__�rUr;rrsN��B�0(�d
�`�"
�a�
5�
3�
#�S�"
�#�g�"#rUr�megav2)
r rlr?�duplicity.backendr�duplicity.errorsrrrr�register_backend�uses_netloc�extendr~rUr;�<module>r�se��,
�	���-�y#�I�%�%�-�-�y#�x
���"�"�8�]�;�	�����$�$�h�Z�0rU

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 379 B 0644
_cf_cloudfiles.cpython-313.pyc File 5.1 KB 0644
_cf_pyrax.cpython-313.pyc File 6.79 KB 0644
_testbackend.cpython-313.pyc File 16.5 KB 0644
adbackend.cpython-313.pyc File 18.76 KB 0644
azurebackend.cpython-313.pyc File 6.79 KB 0644
b2backend.cpython-313.pyc File 11.74 KB 0644
boxbackend.cpython-313.pyc File 9.21 KB 0644
cfbackend.cpython-313.pyc File 665 B 0644
dpbxbackend.cpython-313.pyc File 24.58 KB 0644
gdocsbackend.cpython-313.pyc File 10.15 KB 0644
gdrivebackend.cpython-313.pyc File 15.64 KB 0644
giobackend.cpython-313.pyc File 9.93 KB 0644
hsibackend.cpython-313.pyc File 3.42 KB 0644
hubicbackend.cpython-313.pyc File 2.76 KB 0644
idrivedbackend.cpython-313.pyc File 23.25 KB 0644
imapbackend.cpython-313.pyc File 12.94 KB 0644
jottacloudbackend.cpython-313.pyc File 7.04 KB 0644
lftpbackend.cpython-313.pyc File 12.44 KB 0644
localbackend.cpython-313.pyc File 4.08 KB 0644
mediafirebackend.cpython-313.pyc File 6.07 KB 0644
megabackend.cpython-313.pyc File 8.47 KB 0644
megav2backend.cpython-313.pyc File 10.2 KB 0644
megav3backend.cpython-313.pyc File 11.81 KB 0644
multibackend.cpython-313.pyc File 14.88 KB 0644
ncftpbackend.cpython-313.pyc File 7.3 KB 0644
onedrivebackend.cpython-313.pyc File 17.76 KB 0644
par2backend.cpython-313.pyc File 11.9 KB 0644
pcabackend.cpython-313.pyc File 15.11 KB 0644
pydrivebackend.cpython-313.pyc File 14.04 KB 0644
rclonebackend.cpython-313.pyc File 6.53 KB 0644
rsyncbackend.cpython-313.pyc File 7.66 KB 0644
s3_boto3_backend.cpython-313.pyc File 11.21 KB 0644
slatebackend.cpython-313.pyc File 7.49 KB 0644
ssh_paramiko_backend.cpython-313.pyc File 23.04 KB 0644
ssh_pexpect_backend.cpython-313.pyc File 14.37 KB 0644
swiftbackend.cpython-313.pyc File 12.88 KB 0644
sxbackend.cpython-313.pyc File 2.87 KB 0644
tahoebackend.cpython-313.pyc File 3.64 KB 0644
webdavbackend.cpython-313.pyc File 25.74 KB 0644
xorrisobackend.cpython-313.pyc File 16.46 KB 0644
Filemanager