Made requested changes
This commit is contained in:
parent
3e5b6a2542
commit
27ef02fa83
@ -1341,11 +1341,7 @@ from .vk import (
|
|||||||
VKUserVideosIE,
|
VKUserVideosIE,
|
||||||
VKWallPostIE,
|
VKWallPostIE,
|
||||||
)
|
)
|
||||||
from .vlaretv import (
|
from .vlaretv import VlaretvPlaylistIE
|
||||||
VlaretvIE,
|
|
||||||
VlaretvPlaylistIE
|
|
||||||
)
|
|
||||||
|
|
||||||
from .vlive import (
|
from .vlive import (
|
||||||
VLiveIE,
|
VLiveIE,
|
||||||
VLiveChannelIE,
|
VLiveChannelIE,
|
||||||
|
@ -1,60 +1,12 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import urljoin
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
class VlaretvIE(InfoExtractor):
|
|
||||||
_VALID_URL = r'https?:\/\/vlare.tv\/v\/(?P<id>[0-9a-zA-Z]+)'
|
|
||||||
IE_NAME = 'vlare.tv'
|
|
||||||
_TESTS = [
|
|
||||||
{
|
|
||||||
'url': 'https://vlare.tv/v/cTQKAh0z',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'cTQKAh0z',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Interspecies Reviewers Abridged | One Shot (Parody)',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': 'https://vlare.tv/v/HSzfUoye',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'HSzfUoye',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Quake II (1997) - Gameplay AMD K6-III+ and 3dfx Voodoo Banshee',
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'url': 'https://vlare.tv/v/t7XSuZfK/2568',
|
|
||||||
'info_dict': {
|
|
||||||
'id': 'HSzfUoye',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'title': 'Quake II (1997) - Gameplay AMD K6-III+ and 3dfx Voodoo Banshee',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
def _real_extract(self, url):
|
|
||||||
video_id = self._match_id(url)
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
|
||||||
title = self._html_search_regex(r'<title>(.+?)<\/title>', webpage, 'title').replace(' | Vlare', '')
|
|
||||||
video_urls = self._html_search_regex(r'sources: \[{"file":(.+?)\],', webpage, 'video_urls')
|
|
||||||
video_urls = video_urls.split(',')
|
|
||||||
video_urls_clean = []
|
|
||||||
for i in video_urls:
|
|
||||||
if 'http' in i:
|
|
||||||
video_urls_clean.insert(0, {'url': i.replace("\"", "").replace("\n", "").replace("{file:", "")})
|
|
||||||
return {
|
|
||||||
'id': video_id,
|
|
||||||
'title': title,
|
|
||||||
'formats': video_urls_clean
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class VlaretvPlaylistIE(InfoExtractor):
|
class VlaretvPlaylistIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://vlare.tv/u/(?P<Channel_id>[0-9a-zA-Z]+)/playlist/(?P<id>[0-9]+)'
|
_VALID_URL = r'https?://vlare\.tv/u/(?P<Channel_id>[0-9a-zA-Z]+)/playlist/(?P<id>[0-9]+)'
|
||||||
IE_NAME = 'Vlare.tv Playlist'
|
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://vlare.tv/u/LVWDDFhi/playlist/2568',
|
'url': 'https://vlare.tv/u/LVWDDFhi/playlist/2568',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
@ -66,22 +18,11 @@ class VlaretvPlaylistIE(InfoExtractor):
|
|||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
playlist_id = self._match_id(url)
|
playlist_id = self._match_id(url)
|
||||||
|
|
||||||
webpage = self._download_webpage(url, playlist_id)
|
webpage = self._download_webpage(url, playlist_id)
|
||||||
urls = re.findall(r'<a href="(.+?)" class="video_thumbnail"', webpage)
|
urls = re.findall(r'<a href="(.+?)" class="video_thumbnail"', webpage)
|
||||||
title = self._html_search_regex(r'<title>(.+?)<\/title>', webpage, 'title').split('|')[1][1:-1]
|
title = self._html_search_regex(r'<title>(.+?) \| Vlare</title>', webpage, 'title')
|
||||||
entries = []
|
|
||||||
for i in urls:
|
|
||||||
entry = {
|
|
||||||
'_type': 'url_transparent',
|
|
||||||
'url': 'https://vlare.tv' + i,
|
|
||||||
'id': re.match(r'\/v\/(.+?)\/', i),
|
|
||||||
}
|
|
||||||
entries.append(entry)
|
|
||||||
|
|
||||||
return {
|
# When playlist points to deleted video there is an "error" in the url (Ex. https://vlare.tv/v/error/3257)
|
||||||
'_type': 'playlist',
|
entries = [self.url_result(urljoin('https://vlare.tv', u)) for u in urls if 'error' not in u]
|
||||||
'title': title,
|
|
||||||
'id': self._match_id(url),
|
return self.playlist_result(entries, playlist_id, title)
|
||||||
'entries': entries,
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user