From 5de4ebf7b571fc8c7a5fb9ef66bc3955840af6b3 Mon Sep 17 00:00:00 2001 From: quinlander Date: Tue, 16 Apr 2019 19:29:41 -0400 Subject: [PATCH] simplified try block regex and specified better name for url --- youtube_dl/extractor/changba.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/changba.py b/youtube_dl/extractor/changba.py index 2a3e8aef3..ac9b2be2b 100644 --- a/youtube_dl/extractor/changba.py +++ b/youtube_dl/extractor/changba.py @@ -49,12 +49,12 @@ class ChangbaIE(InfoExtractor): ext = 'mp3' if int(isvideo) == 0 else 'mp4' try: - url = self._search_regex(r'([a-z]+:\/\/[0-9a-z]+\.changba\.com\/[a-z]+\/[a-z]+\/[0-9]+\/[0-9]+\.mp[3-4])', webpage, 'url') + src_url = self._search_regex(r'var a="([^"]*)', webpage, 'url') except: - url = 'http://lzscuw.changba.com/{}.{}'.format(str(id), ext) + src_url = 'http://lzscuw.changba.com/{}.{}'.format(str(id), ext) return { - 'url': url, + 'url': src_url, 'id': id, 'ext': ext, 'title': title,