Don't use _html_search_regex when there's no html to filter out

This commit is contained in:
rubyist 2020-02-27 19:10:31 -08:00
parent 8c5c97a0d3
commit b5879f6e44

View File

@ -22,19 +22,19 @@ class MatterIE(InfoExtractor):
"https://api.matter.online/api/v1/open-graph/tracks/%s/embedded" % track_id, track_id "https://api.matter.online/api/v1/open-graph/tracks/%s/embedded" % track_id, track_id
) )
author = self._html_search_regex( author = self._search_regex(
r'<a href="https://app.matter.online/artists/[^"]+" target="[^"]+">([^<]+)</a>', r'<a href="https://app.matter.online/artists/[^"]+" target="[^"]+">([^<]+)</a>',
webpage, "author" webpage, "author"
) )
title = self._html_search_regex( title = self._search_regex(
r'<a href="https://app.matter.online/tracks/\d+" target="[^"]+">([^<]+)</a>', r'<a href="https://app.matter.online/tracks/\d+" target="[^"]+">([^<]+)</a>',
webpage, "title" webpage, "title"
) )
download_url = self._html_search_regex( download_url = self._search_regex(
r'<source src="(https://matter-production.s3.amazonaws.com/audios/[^\.]+\.[^"]+)"/>', r'<source src="(https://matter-production.s3.amazonaws.com/audios/[^\.]+\.[^"]+)"/>',
webpage, "download_url" webpage, "download_url"
) )
artwork = self._html_search_regex( artwork = self._search_regex(
r'style="background: url\((https://matter-production.s3.amazonaws.com/images/[^\.]+\.[^\)]+)\)', r'style="background: url\((https://matter-production.s3.amazonaws.com/images/[^\.]+\.[^\)]+)\)',
webpage, "artwork" webpage, "artwork"
) )