简体   繁体   English

如何使用 python 3.9.1 列出 mega.nz 文件夹的文件?

[英]How to list files of a mega.nz folder using python 3.9.1?

I only found this:我只发现了这个:

m = mega.login('email', 'password')

files = m.get_files()
extracted = []
for file in files:
   extracted.append(files[file]['a']['n'])

it returns all of the files and folders:它返回所有文件和文件夹:

['Cloud Drive', 'Inbox', 'Rubbish Bin', 'Welcome to MEGA.pdf', 'FolderN1', 'balloon.png', 'FolderN1/subfolder/balloon.png', 'subfolder', etc. ]

if (files[x]['t'] == 0) it is file.如果 (files[x]['t'] == 0) 它是文件。

files = m.get_files()
extracted = []
for x in files:
  if files[x]['t'] == 0:
     extracted.append(files[x]['a']['n'])

example results:示例结果:

['video.zip', 'film.mkv', 'legal_data.zip', 'tools.py', 'upload.py', 'learn.pdf']

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 python 请求登录到 mega.nz - Log in to mega.nz using python requests 如何将文件夹从 Mega.nz 转移到 GDrive? - How to transfer folder from Mega.nz to GDrive? 从Mega.nz存档(Python)中刮取文本 - Scrape Text from Mega.nz Archive (Python) 通过 google colab 使用 Mega.nz 模块的问题 - problem with using the Mega.nz module via google colab 如何在 python 中使用 mega api 通过共享 url 列出大型公共文件夹的内容 - how can i list the contents of a mega public folder by it's shared url using mega api in python 如何使用 python 库 mega.py 1.0.8 将文件上传到巨型存储平台中的子文件夹? - How to upload files to subfolders in mega storage platform using python library mega.py 1.0.8? 如何在Python中使用zipfile模块列出文件夹的文件 - How to list a folder's files using the zipfile module in Python 如何使用 python 列出 sharepoint 文件夹内的所有文件 - How to list all files inside the folder of sharepoint using python 使用 Python 如何获取 HDFS 文件夹中所有文件的列表? - Using Python how to get list of all files in a HDFS folder? 如何使用 python 列出 S3 存储桶文件夹中的文件 - how to list files from a S3 bucket folder using python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM