Browse Source

Filter out 'no banner' banners

main
fluffy 7 months ago
parent
commit
75e0fd14ad
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      zenius.py

+ 4
- 2
zenius.py View File

@@ -137,12 +137,14 @@ def mirror(cat_url, args):
for groupname, group_url in group_urls.items():
page = get_page(group_url)
banner_urls = {urllib.parse.urljoin(group_url, banner['src'])
for banner in page.select('p.centre img')}
for banner in page.select('p.centre img')
if 'simfileNoBanner.png' not in banner['src']}
for url in banner_urls:
filename = f'songs/{groupname}/banner.png'
headers = f'zips/{groupname}-banner.headers'
req_headers = load_prev_headers(filename, headers)
retrieve(url, filename, extract=False, headers=req_headers, save_headers=headers)
retrieve(url, filename, extract=False,
headers=req_headers, save_headers=headers)


if __name__ == "__main__":


Loading…
Cancel
Save