mirror of
https://github.com/ytdl-org/youtube-dl
synced 2024-12-23 04:30:10 +09:00
Use a helper method to replace a messy regex
This commit is contained in:
parent
6ce7baecaa
commit
14834bf977
@ -5,6 +5,8 @@ import re
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
from ..utils import get_elements_by_class
|
||||||
|
|
||||||
|
|
||||||
class TASVideosIE(InfoExtractor):
|
class TASVideosIE(InfoExtractor):
|
||||||
_VALID_URL = r'http://tasvideos.org/(?P<id>\d+M)\.html'
|
_VALID_URL = r'http://tasvideos.org/(?P<id>\d+M)\.html'
|
||||||
@ -57,8 +59,8 @@ class TASVideosPlaylistIE(InfoExtractor):
|
|||||||
webpage = self._download_webpage(url, playlist_id)
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
playlist_title = self._search_regex(
|
playlist_title = self._search_regex(
|
||||||
r'<title>(?P<title>[^<]*)</title>', webpage, 'title')
|
r'<title>(?P<title>[^<]*)</title>', webpage, 'title')
|
||||||
video_entries = re.findall(
|
video_entries = get_elements_by_class('item', webpage)
|
||||||
r'((?s)<table class="item".*?archive.*?<\/table)>', webpage)
|
|
||||||
entries = []
|
entries = []
|
||||||
for entry in video_entries:
|
for entry in video_entries:
|
||||||
video_urls = re.findall(
|
video_urls = re.findall(
|
||||||
|
Loading…
Reference in New Issue
Block a user