foyoux / aligo

🔥简单、易用、可扩展的阿里云盘 API 接口库🚀
GNU General Public License v3.0
859 stars 157 forks source link

手机备份的照片全在默认的 album下,如何下载到本地? #161

Open xinmans opened 9 months ago

xinmans commented 9 months ago

看了example,没找到合适的操作方法,用默认album的相册id list文件会报错

xinmans commented 9 months ago
 """
    6333175 None 3 default  # 注意,云盘中会有一个 默认的 album,无法删除
    6333175 None None starred
    iqbf34LjW2 标题。 3 manual
    k6R1nmadvf6 产品标题。 0 manual
    """

    用6333175去list_ablum_file会报错
lemisky commented 8 months ago
from aligo import Aligo

if __name__ == '__main__':
    ali = Aligo()
    albums = ali.list_albums()
    for album in albums:
        if album.type != 'manual':
            continue
        photos = ali.list_album_files(album.album_id)
        for photo in photos:
            print(photo.name, photo.drive_id, photo.file_id, photo.download_url)
lemisky commented 8 months ago

@xinmans

lemisky commented 8 months ago

对于相册所有图片,可通过 search 方法获取

from aligo import Aligo

if __name__ == '__main__':
    ali = Aligo()
    photos = ali.search_files(drive_id=ali.album_info.driveId)
    for photo in photos:
        if photo.type == 'file':
            print(photo.name, photo.download_url)
lemisky commented 8 months ago

更新到最新版 v6.2.1

from aligo import Aligo

if __name__ == '__main__':
    ali = Aligo()
    albums = ali.list_albums()
    for album in albums:
        photos = ali.list_album_files(album.album_id)
        for photo in photos:
            print(photo.name, photo.drive_id, photo.file_id, photo.download_url)
qinggeng2015 commented 3 days ago

photo.download_url是空的了,ali.list_albums()也是空的了,似乎已经无法下载了,

image image
lemisky commented 3 days ago

阿里做了限制,即使有下载链接也会限速,另外毕竟这是“黑接口”,所以一直没有处理这个问题

qinggeng2015 commented 3 days ago

阿里做了限制,即使有下载链接也会限速,另外毕竟这是“黑接口”,所以一直没有处理这个问题

那就是说现在已经没办法批量下载相册中的照片了

lemisky commented 3 days ago

是的,下载还是走官方吧