projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[youporn] Add support form generic embeds
[youtube-dl]
/
youtube_dl
/
extractor
/
plays.py
diff --git
a/youtube_dl/extractor/plays.py
b/youtube_dl/extractor/plays.py
index 5ac0292fad5ff73adf89264e7f17087d2343f7a6..ddfc6f1486c4b49185bf68b3be3ff9ba9e957633 100644
(file)
--- a/
youtube_dl/extractor/plays.py
+++ b/
youtube_dl/extractor/plays.py
@@
-8,8
+8,8
@@
from ..utils import int_or_none
class PlaysTVIE(InfoExtractor):
class PlaysTVIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?plays\.tv/
video
/(?P<id>[0-9a-f]{18})'
- _TEST
=
{
+ _VALID_URL = r'https?://(?:www\.)?plays\.tv/
(?:video|embeds)
/(?P<id>[0-9a-f]{18})'
+ _TEST
S = [
{
'url': 'https://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall',
'md5': 'dfeac1198506652b5257a62762cec7bc',
'info_dict': {
'url': 'https://plays.tv/video/56af17f56c95335490/when-you-outplay-the-azir-wall',
'md5': 'dfeac1198506652b5257a62762cec7bc',
'info_dict': {
@@
-18,14
+18,18
@@
class PlaysTVIE(InfoExtractor):
'title': 'Bjergsen - When you outplay the Azir wall',
'description': 'Posted by Bjergsen',
}
'title': 'Bjergsen - When you outplay the Azir wall',
'description': 'Posted by Bjergsen',
}
- }
+ }, {
+ 'url': 'https://plays.tv/embeds/56af17f56c95335490',
+ 'only_matching': True,
+ }]
def _real_extract(self, url):
video_id = self._match_id(url)
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
+ webpage = self._download_webpage(
+ 'https://plays.tv/video/%s' % video_id, video_id)
+
+ info = self._search_json_ld(webpage, video_id,)
- content = self._search_json_ld(webpage, video_id)
- title = content['title']
mpd_url, sources = re.search(
r'(?s)<video[^>]+data-mpd="([^"]+)"[^>]*>(.+?)</video>',
webpage).groups()
mpd_url, sources = re.search(
r'(?s)<video[^>]+data-mpd="([^"]+)"[^>]*>(.+?)</video>',
webpage).groups()
@@
-39,10
+43,11
@@
class PlaysTVIE(InfoExtractor):
})
self._sort_formats(formats)
})
self._sort_formats(formats)
-
return
{
+
info.update(
{
'id': video_id,
'id': video_id,
- 'title': title,
'description': self._og_search_description(webpage),
'description': self._og_search_description(webpage),
- 'thumbnail': self._og_search_thumbnail(webpage),
+ 'thumbnail':
info.get('thumbnail') or
self._og_search_thumbnail(webpage),
'formats': formats,
'formats': formats,
- }
+ })
+
+ return info