diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-06-25 23:47:38 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-06-25 23:47:38 +0200 |
commit | ba7aa464de0a0a6596eb5334b7e2491a03dfbc92 (patch) | |
tree | ef266b506c5d4974e09b092c41de57fa7d66bea6 /youtube_dl/extractor | |
parent | 8333034dce97c1315fc0bda108985cfadf40d44d (diff) |
[soundgasm] PEP8 and add a display_id (#3155)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/soundgasm.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/youtube_dl/extractor/soundgasm.py b/youtube_dl/extractor/soundgasm.py index b9d4c6a56..a4f8ce6c3 100644 --- a/youtube_dl/extractor/soundgasm.py +++ b/youtube_dl/extractor/soundgasm.py @@ -5,6 +5,7 @@ import re from .common import InfoExtractor + class SoundgasmIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_\-]+)/(?P<title>[0-9a-zA-Z_\-]+)' _TEST = { @@ -20,14 +21,19 @@ class SoundgasmIE(InfoExtractor): def _real_extract(self, url): mobj = re.match(self._VALID_URL, url) + display_id = mobj.group('title') audio_title = mobj.group('user') + '_' + mobj.group('title') - webpage = self._download_webpage(url, '') - audio_url = self._html_search_regex(r'(?s)m4a\:\s"([^"]+)"', webpage, 'audio URL') + webpage = self._download_webpage(url, display_id) + audio_url = self._html_search_regex( + r'(?s)m4a\:\s"([^"]+)"', webpage, 'audio URL') audio_id = re.split('\/|\.', audio_url)[-2] - description = self._html_search_regex(r'(?s)<li>Description:\s(.*?)<\/li>', webpage, 'description', fatal=False, flags=re.DOTALL) + description = self._html_search_regex( + r'(?s)<li>Description:\s(.*?)<\/li>', webpage, 'description', + fatal=False) return { 'id': audio_id, + 'display_id': display_id, 'url': audio_url, 'title': audio_title, 'description': description |