mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-10 16:02:53 +08:00
[Vidbit] Simplify base URL
This commit is contained in:
parent
e2568ca666
commit
dd49ab150e
@ -5,6 +5,8 @@ import re
|
|||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..utils import url_basename
|
from ..utils import url_basename
|
||||||
|
from ..compat import compat_urlparse
|
||||||
|
|
||||||
|
|
||||||
class VidbitIE(InfoExtractor):
|
class VidbitIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?vidbit\.co/watch\?v=(?P<id>[\w-]+)'
|
_VALID_URL = r'https?://(?:www\.)?vidbit\.co/watch\?v=(?P<id>[\w-]+)'
|
||||||
@ -23,12 +25,10 @@ class VidbitIE(InfoExtractor):
|
|||||||
video_id = self._match_id(url)
|
video_id = self._match_id(url)
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
_BASE_URL = 'http://' + url.split('/')[2] + '/'
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': self._html_search_regex(r'<h1>(.+)</h1>', webpage, 'title'),
|
'title': self._html_search_regex(r'<h1>(.+)</h1>', webpage, 'title'),
|
||||||
'url': _BASE_URL + self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2),
|
'url': compat_urlparse.urljoin(url, self._html_search_regex(r'file:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'video URL', group=2)),
|
||||||
'thumbnail': _BASE_URL + self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2),
|
'thumbnail': compat_urlparse.urljoin(url, self._html_search_regex(r'image:\s*(["\'])((?:(?!\1).)+)\1', webpage, 'thumbnail', None, group=2)),
|
||||||
'description': self._html_search_regex(r'description:(["\'])((?:(?!\1).)+)\1', webpage, 'description', None, group=2),
|
'description': self._html_search_regex(r'description:(["\'])((?:(?!\1).)+)\1', webpage, 'description', None, group=2),
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user