mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-16 22:28:18 +01:00
[youtube:search_url] Update regexes
This commit is contained in:
parent
1e07fea200
commit
6feb2d5e80
@ -1698,14 +1698,14 @@ class YoutubeSearchURLIE(InfoExtractor):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, query)
|
webpage = self._download_webpage(url, query)
|
||||||
result_code = self._search_regex(
|
result_code = self._search_regex(
|
||||||
r'(?s)<ol id="search-results"(.*?)</ol>', webpage, u'result HTML')
|
r'(?s)<ol class="item-section"(.*?)</ol>', webpage, u'result HTML')
|
||||||
|
|
||||||
part_codes = re.findall(
|
part_codes = re.findall(
|
||||||
r'(?s)<h3 class="yt-lockup-title">(.*?)</h3>', result_code)
|
r'(?s)<h3 class="yt-lockup-title">(.*?)</h3>', result_code)
|
||||||
entries = []
|
entries = []
|
||||||
for part_code in part_codes:
|
for part_code in part_codes:
|
||||||
part_title = self._html_search_regex(
|
part_title = self._html_search_regex(
|
||||||
r'(?s)title="([^"]+)"', part_code, 'item title', fatal=False)
|
[r'(?s)title="([^"]+)"', r'>([^<]+)</a>'], part_code, 'item title', fatal=False)
|
||||||
part_url_snippet = self._html_search_regex(
|
part_url_snippet = self._html_search_regex(
|
||||||
r'(?s)href="([^"]+)"', part_code, 'item URL')
|
r'(?s)href="([^"]+)"', part_code, 'item URL')
|
||||||
part_url = compat_urlparse.urljoin(
|
part_url = compat_urlparse.urljoin(
|
||||||
|
Loading…
Reference in New Issue
Block a user