downloadfiles.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:RastLeak 作者: n4xh4ck5 项目源码 文件源码
def Downloadfiles(urls_metadata,output,target):
    path = None
    try:
        filename = None
        print "\nDo you like downloading these files to analyze metadata(Y/N)?"
        #Convert to lower the input
        resp = raw_input().lower()
        if (resp == 'n'):
            print "Exiting"
            exit(1)
        if ((resp != 'y') and (resp != 'n')):
            print "The option is not valided. Please, try again it"
        if (resp =='y'):
            print "Indicate the location where you want to keep the files downloaded.by default in the target folder",
            path = raw_input()
            #path = createdir.CreateDir(target)
            for url in urls_metadata:
                filename = wget.download(url,str(path))
                Analyze_Metadata(filename)
            Display_Export_Metadata(metadata_files,output,target)
            if count_pdf > 1:
                os.system('mv *pdf '+ str(target))
            if count_word > 1:
                os.system('mv *doc '+ str(target))
                os.system('mv *docx '+ str(target))
            if count_others > 1:
                os.system('mv *xlsx '+ str(target))
                os.system('mv *ppt '+ str(target))
    except Exception as e:
        print str(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号