mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-11-16 17:56:05 +00:00
Fixed flake8
Search title from multiple sources
This commit is contained in:
parent
14bedfc938
commit
c2f08dd505
1 changed files with 7 additions and 4 deletions
|
@ -10,6 +10,7 @@ from ..utils import (
|
||||||
# VALID_STREAMS = ('dash', 'hls', )
|
# VALID_STREAMS = ('dash', 'hls', )
|
||||||
VALID_STREAMS = ('dash', )
|
VALID_STREAMS = ('dash', )
|
||||||
|
|
||||||
|
|
||||||
class MxplayerIE(InfoExtractor):
|
class MxplayerIE(InfoExtractor):
|
||||||
_VALID_URL = r'https?://(?:www\.)?mxplayer\.in/movie/(?P<slug>[a-z0-9]+(?:-[a-z0-9]+)*)'
|
_VALID_URL = r'https?://(?:www\.)?mxplayer\.in/movie/(?P<slug>[a-z0-9]+(?:-[a-z0-9]+)*)'
|
||||||
# _VALID_URL = r'https?://(?:www\.)?mxplayer\.in/movie/(?P<title>.*)[-](?P<id>.+)$'
|
# _VALID_URL = r'https?://(?:www\.)?mxplayer\.in/movie/(?P<title>.*)[-](?P<id>.+)$'
|
||||||
|
@ -69,6 +70,9 @@ class MxplayerIE(InfoExtractor):
|
||||||
video_dict = source['entities'][video_id]
|
video_dict = source['entities'][video_id]
|
||||||
stream_urls = self._get_stream_urls(video_dict)
|
stream_urls = self._get_stream_urls(video_dict)
|
||||||
|
|
||||||
|
if not title:
|
||||||
|
title = self._og_search_title(webpage, fatal=True, default=video_dict['title'])
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
headers = {'Referer': url}
|
headers = {'Referer': url}
|
||||||
for stream_name, stream_url in stream_urls:
|
for stream_name, stream_url in stream_urls:
|
||||||
|
@ -83,7 +87,7 @@ class MxplayerIE(InfoExtractor):
|
||||||
info = {
|
info = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'ext': 'mpd',
|
'ext': 'mpd',
|
||||||
'title': video_dict.get('title') or title,
|
'title': title,
|
||||||
'description': video_dict.get('description'),
|
'description': video_dict.get('description'),
|
||||||
'formats': formats
|
'formats': formats
|
||||||
}
|
}
|
||||||
|
@ -98,4 +102,3 @@ class MxplayerIE(InfoExtractor):
|
||||||
info['display_id'] = last_part.replace(video_id, "").rstrip("-")
|
info['display_id'] = last_part.replace(video_id, "").rstrip("-")
|
||||||
|
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue