various smaller changes/additions

pull/54/head
Mike Fährmann 7 years ago
parent 4fb6803fa6
commit 291369eab2
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -61,7 +61,7 @@ class GelbooruExtractor(SharedConfigExtractor):
))[0]
data["file_url"] = "http" + data["file_url"]
data["md5"] = data["file_url"].rpartition("/")[2].partition(".")[0]
data["rating"] = RATING_MAP[data["rating"]]
data["rating"] = (data["rating"] or "?")[0].lower()
for key in ("id", "width", "height", "score"):
data[key] = util.safe_int(data[key])
return data
@ -153,10 +153,3 @@ class GelbooruPostExtractor(GelbooruExtractor):
def get_posts(self):
return (self.post_id,)
RATING_MAP = {
"Safe": "s",
"Questionable": "q",
"Explicit": "e",
}

@ -58,9 +58,9 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
def get_album_tracks(self, page):
"""Collect url and metadata for all tracks of a soundtrack"""
page = text.extract(page, '<table class="songlist">', '</table>')[0]
page = text.extract(page, '<table id="songlist">', '</table>')[0]
for num, url in enumerate(text.extract_iter(
page, ' href="', '"'), 1):
page, '<td class="clickable-row"><a href="', '"'), 1):
page = self.request(url, encoding="utf-8").text
url = text.extract(
page, '<p><a style="color: #21363f;" href="', '"')[0]

@ -24,7 +24,7 @@ class Job():
if self.extractor is None:
raise exception.NoExtractorError(url)
self.extractor.log.debug(
"Using %s for %s", self.extractor.__class__.__name__, url)
"Using %s for '%s'", self.extractor.__class__.__name__, url)
# url predicates
predicates = [util.UniquePredicate()]

@ -148,7 +148,7 @@ def build_parser():
downloader.add_argument(
"--http-timeout",
metavar="SECONDS", action=ConfigAction, dest="timeout", type=float,
help="Timeout for HTTP connections (defaut: 30s)",
help="Timeout for HTTP connections (defaut: 30.0)",
)
downloader.add_argument(
"--sleep",
@ -192,15 +192,17 @@ def build_parser():
authentication.add_argument(
"-u", "--username",
metavar="USER", action=ConfigAction, dest="username",
help="A username to login with"
)
authentication.add_argument(
"-p", "--password",
metavar="PASS", action=ConfigAction, dest="password",
help="The password associated with the given username",
)
authentication.add_argument(
"--netrc",
action=ConfigConstAction, nargs=0, dest="netrc", const=True,
help="Use .netrc authentication data",
help="Enable .netrc authentication data",
)
selection = parser.add_argument_group("Selection Options")
@ -223,8 +225,8 @@ def build_parser():
metavar="EXPR", dest="image_filter",
help=("Python expression controlling which images to download. Images "
"for which the expression evaluates to False are ignored. "
"Available keys are the filename-specific ones listed by "
"'--list-keywords'. Example: --filter \"image_width >= 1000 and "
"Available keys are the filename-specific ones listed by '-K'. "
"Example: --filter \"image_width >= 1000 and "
"rating in ('s', 'q')\""),
)
selection.add_argument(

@ -82,7 +82,6 @@ skip = [
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
"archivedmoe", "archiveofsins", "thebarchive",
# temporary issues
"turboimagehost",
]
# enable selective testing for direct calls
if __name__ == '__main__' and len(sys.argv) > 1:

Loading…
Cancel
Save