예제 #1
0
 def download(self, url, fullpath, item):
     try:
         df = Download(url, fullpath)
         df.download()
     except urllib.error.HTTPError:
         print("Http Error, skipping")
         return False
     self.check_id3_edit(item.podcast.id, fullpath, item)
     return
예제 #2
0
파일: podcli.py 프로젝트: bantonj/podcli
 def download(self, url, fullpath, item):
     try:
         df = Download(url, fullpath)
         df.download()
     except urllib.error.HTTPError:
         print("Http Error, skipping")
         return False
     self.check_id3_edit(item.podcast.id, fullpath, item)
     return
예제 #3
0
def downloadAll(id):
    keys = ['geo','id','title']
    dlist = []
    for k in keys:
        fname = gconfig.metadatadir + '/%s/%s.json' % (id,k)
        fr = open(fname)
        data = json.loads(fr.read())
        for photo in data['photos']:
            dlist.append(photo['photo'])
        fr.close()
            
    db = Download(gconfig.tmpdir + '/%s' % id)
    db.download(dlist)
예제 #4
0
 def download_list(self, url_list: list):
     for item in url_list:
         t.log_message('Downloading: ' + item)
         try:
             download = Download(item, retries=5)
             download.download()
             path = os.path.abspath(download.download_path)
             _, extension = os.path.splitext(path)
             if extension[1:] in dict(shutil.get_archive_formats()).keys(
             ) and self.config.extract_archives:
                 shutil.unpack_archive(path)
         except Exception as e:
             t.log_message("ERROR. Download: " + item + ' FAILED.\n' +
                           str(e))
예제 #5
0
 def download_config(self, config_url: str, file_name: str = None):
     downloader = Download(config_url, file_name)
     downloader.download()