mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 16:57:40 +00:00
[yourupload] Simplify
This commit is contained in:
parent
9d8ba307ef
commit
cbbece96a2
1 changed files with 3 additions and 11 deletions
|
@ -1,8 +1,6 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,25 +33,19 @@ class YourUploadIE(InfoExtractor):
|
||||||
]
|
]
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
mobj = re.match(self._VALID_URL, url)
|
video_id = self._match_id(url)
|
||||||
video_id = mobj.group('id')
|
|
||||||
|
|
||||||
embed_url = 'http://embed.yucache.net/{0:}'.format(video_id)
|
embed_url = 'http://embed.yucache.net/{0:}'.format(video_id)
|
||||||
webpage = self._download_webpage(embed_url, video_id)
|
webpage = self._download_webpage(embed_url, video_id)
|
||||||
|
|
||||||
title = self._og_search_title(webpage)
|
title = self._og_search_title(webpage)
|
||||||
thumbnail = self._og_search_thumbnail(webpage)
|
|
||||||
video_url = self._og_search_video_url(webpage)
|
video_url = self._og_search_video_url(webpage)
|
||||||
|
thumbnail = self._og_search_thumbnail(webpage, default=None)
|
||||||
formats = [{
|
|
||||||
'format_id': 'sd',
|
|
||||||
'url': video_url,
|
|
||||||
}]
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'title': title,
|
'title': title,
|
||||||
'formats': formats,
|
'url': video_url,
|
||||||
'thumbnail': thumbnail,
|
'thumbnail': thumbnail,
|
||||||
'http_headers': {
|
'http_headers': {
|
||||||
'Referer': embed_url,
|
'Referer': embed_url,
|
||||||
|
|
Loading…
Reference in a new issue