use text.urljoin()

This commit is contained in:
Mike Fährmann
2018-04-26 17:00:26 +02:00
parent 2721417dd8
commit 95392554ee
10 changed files with 12 additions and 21 deletions

View File

@@ -10,7 +10,6 @@
from .common import AsynchronousExtractor, Message
from .. import text, exception
from urllib.parse import urljoin
class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
@@ -63,7 +62,8 @@ class KhinsiderSoundtrackExtractor(AsynchronousExtractor):
page = text.extract(page, '<table id="songlist">', '</table>')[0]
for num, url in enumerate(text.extract_iter(
page, '<td class="clickable-row"><a href="', '"'), 1):
page = self.request(urljoin(self.root, url), encoding="utf-8").text
url = text.urljoin(self.root, url)
page = self.request(url, encoding="utf-8").text
url = text.extract(
page, '<p><a style="color: #21363f;" href="', '"')[0]
yield url, text.nameext_from_url(url, {"num": num})