示例#1
0
 def download_entry(self, entry, path):
     uid = get_safe_local_id(entry.url)
     new_path = os.path.join(path, uid)
     download_file(entry.url, new_path)
     relative_path = get_relative_url(new_path)
     entry.local_paths = [relative_path]
     entry.downloaded = True
示例#2
0
 def download_entry(self, entry, path):
     uid = get_safe_local_id(entry.url)
     new_path = os.path.join(path, uid)
     download_file(entry.url, new_path)
     relative_path = get_relative_url(new_path)
     entry.local_paths = [relative_path]
     entry.downloaded = True
示例#3
0
    def download_entry(self, entry, path):
        local_paths = []
        next_url = entry.url
        page_id = 0

        while next_url is not None:
            uid = get_safe_local_id(next_url, '_page{0}'.format(page_id))
            new_path = os.path.join(path, uid)
            download_file(next_url, new_path)
            relative_path = get_relative_url(new_path)
            local_paths.append(relative_path)
            tree = download_html_tree(new_path)
            page_id += 1
            next_url = self._get_next_entry_url(next_url, page_id, tree)

        entry.downloaded = True
        entry.local_paths = local_paths
示例#4
0
    def download_entry(self, entry, path):
        local_paths = []
        next_url = entry.url
        page_id = 0

        while next_url is not None:
            uid = get_safe_local_id(next_url, "_page{0}".format(page_id))
            new_path = os.path.join(path, uid)
            download_file(next_url, new_path)
            relative_path = get_relative_url(new_path)
            local_paths.append(relative_path)
            tree = download_html_tree(new_path)
            page_id += 1
            next_url = self._get_next_entry_url(next_url, page_id, tree)

        entry.downloaded = True
        entry.local_paths = local_paths