zoukankan      html  css  js  c++  java
  • temp

    链接:http://pan.baidu.com/s/1gfhF3xD 密码:kmhg

     http://dsideal.oss-cn-qingdao-internal.aliyuncs.com/BeiJing.zip

    SELECT * FROM t_resource_info WHERE scheme_id_int in
    (4269,15842,15871,15873,15909,34199,106089,4270,15864,15876,15893,15903,34018,34022,34025,4267,15857,15868,15882,15899,15905,34269,34270,39308,4278,15877,15887,15889,15910,33768,33941,33942,105852)
    AND release_status in (1,3);

    import os
    import sys
    from Util.MySQLHelper import *
    
    
    # 下载指定的Url地址下的文件
    def DownloadFile(url, Dir, FileName):
        command = sys.path[
                      0] + "\aria2-1.19.0\aria2c.exe" + " -c -s 2 --check-certificate=false -d " + Dir + " -o " + FileName + " " + url
        os.system(command)
    
    
    # oss-cn-qingdao-internal.aliyuncs.com
    
    if __name__ == "__main__":
        targetPath = "d:\BeiJing"
        db = MySQLHelper()
        sql = "SELECT FILE_ID,RESOURCE_FORMAT,THUMB_ID FROM t_resource_info WHERE scheme_id_int in (4269,15842,15871,15873,15909,34199,106089,4270,15864,15876,15893,15903,34018,34022,34025,4267,15857,15868,15882,15899,15905,34269,34270,39308,4278,15877,15887,15889,15910,33768,33941,33942,105852) AND release_status in (1,3)"
        dt = db.query(sql)
        count = 0
        for row in dt:
            count = count + 1
            print("正在下载第" + str(count) + "个,共30510个!")
            # 1、Material
            FileId = row['FILE_ID']
            ResourceFormat = row['RESOURCE_FORMAT']
            ThumbId = row['THUMB_ID']
    
            url = "http://dsideal-yy.oss-cn-qingdao-internal.aliyuncs.com/down/Material/" + FileId[0:2] + '/' + FileId + '.' + ResourceFormat
    
            SavePath = targetPath + "\Material\" + FileId[0:2]
            if not os.path.exists(SavePath):
                os.mkdir(SavePath)
    
            DownloadFile(url, SavePath, FileId + '.' + ResourceFormat)
            # Thumbs
            url = "http://dsideal-yy.oss-cn-qingdao-internal.aliyuncs.com/down/Thumbs/" + ThumbId[
                                                                                            0:2] + '/' + ThumbId + '.thumb'
            ThumbsSavePath = targetPath + "\Thumbs\" + ThumbId[0:2]
            if not os.path.exists(ThumbsSavePath):
                os.mkdir(ThumbsSavePath)
    
            DownloadFile(url, ThumbsSavePath, ThumbId + '.thumb')
        print('恭喜,所有下载成功完成!')
  • 相关阅读:
    位向量法、二进制法枚举子集
    jfinal 下载文件时重命名
    Java程序员开发参考资源
    (二)Hive1.2.2
    (一)Hive1.2.2
    YARN资源调度框架
    MapReduce并行编程模型
    HDFS 分布式文件系统
    Kafka
    观察者模式
  • 原文地址:https://www.cnblogs.com/littlehb/p/7900120.html
Copyright © 2011-2022 走看看