1
0
forked from Mirrors/itch-dl

Bump to 0.3.0, bump deps, misc cleanups and type corrections

Some of the misc issues were found with mypy. Not adding it to dev deps
for now as it complains about missing types in libraries and does not
honor noqa where we need it (non-literal TypedDict keys).
This commit is contained in:
Ryszard Knop
2022-06-12 19:31:25 +02:00
parent 4542057654
commit 90346f579a
7 changed files with 24 additions and 23 deletions

View File

@@ -2,7 +2,7 @@ import json
import os.path
import logging
import urllib.parse
from typing import List, Optional
from typing import List, Set, Optional
from bs4 import BeautifulSoup
@@ -49,7 +49,7 @@ def get_jobs_for_browse_url(url: str, client: ItchApiClient) -> List[str]:
.xml?page=N suffix and iterate until we've caught 'em all.
"""
page = 1
found_urls = set()
found_urls: Set[str] = set()
logging.info(f"Scraping game URLs from RSS feeds for %s", url)
while True:
@@ -189,3 +189,5 @@ def get_jobs_for_url_or_path(path_or_url: str, settings: Settings) -> List[str]:
return get_jobs_for_itch_url(path_or_url, client)
elif os.path.isfile(path_or_url):
return get_jobs_for_path(path_or_url)
else:
raise NotImplementedError(f"Cannot handle path or URL: {path_or_url}")