various smaller changes/additions
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user