mirror of
https://github.com/ytdl-org/youtube-dl
synced 2025-10-01 22:08:36 +09:00
[InfoExtractor] Add _match_valid_url()
class method and refactor
* API compatible with yt-dlp * also support Sequence of patterns in _VALID_URL * one place to compile _VALID_URL * TODO: remove existing extractor shims
This commit is contained in:
@@ -18,12 +18,6 @@ from ..utils import (
|
||||
|
||||
class GlobalPlayerBaseIE(InfoExtractor):
|
||||
|
||||
import re
|
||||
|
||||
@classmethod
|
||||
def _match_valid_url(cls, url):
|
||||
return cls.re.match(cls._VALID_URL, url)
|
||||
|
||||
def _get_page_props(self, url, video_id):
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
return self._search_nextjs_data(webpage, video_id)['props']['pageProps']
|
||||
|
Reference in New Issue
Block a user