这里是代码:
from bs4 import BeautifulSoup as bs
import requests
DOMAIN = 'https://archive.org/'
URL = 'https://archive.org/download/nointroNintendoDSDecrypted_2020Mar08/'
FILETYPE = '%28USA%29.7z'
def get_soup(url):
return bs(requests.get(url).text, 'html.parser')
for link in get_soup(URL).find_all('a'):
file_link = link.get('href')
if FILETYPE in file_link:
print(file_link)
with open(link.text, 'wb') as file:
response = requests.get(URL + file_link)
file.write(response.content)
我正在尝试编写将视频游戏ROMS移出archive.org的代码,它目前已按字母顺序从上至下下载所有文件。我的电脑无法下载全部...
["a", "a", "a", "a", "b", "b", "c"]
,仅是示例。