1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-02 17:22:31 +01:00

[twitter] Use _html_search_regex

This commit is contained in:
Yen Chi Hsuan 2015-10-18 17:18:01 +08:00
parent e04edad621
commit f6dfd6603a

View File

@ -122,7 +122,7 @@ def _real_extract(self, url):
name = username name = username
url = re.sub(r'https?://(m|mobile)\.', 'https://', url) url = re.sub(r'https?://(m|mobile)\.', 'https://', url)
webpage = self._download_webpage(url, 'tweet: ' + url) webpage = self._download_webpage(url, 'tweet: ' + url)
description = unescapeHTML(self._search_regex('<title>\s*(.+?)\s*</title>', webpage, 'title')) description = self._html_search_regex('<title>\s*(.+?)\s*</title>', webpage, 'title')
title = description.replace('\n', ' ') title = description.replace('\n', ' ')
splitdesc = re.match(r'^(.+?)\s*on Twitter:\s* "(.+?)"$', title) splitdesc = re.match(r'^(.+?)\s*on Twitter:\s* "(.+?)"$', title)
if splitdesc: if splitdesc: