This commit is contained in:
yasho2101 2020-09-30 12:58:33 +08:00 committed by GitHub
commit 769ef4223b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

View File

@ -511,6 +511,7 @@ from .kickstarter import KickStarterIE
from .kinja import KinjaEmbedIE
from .kinopoisk import KinoPoiskIE
from .konserthusetplay import KonserthusetPlayIE
from .koreus import koreusIE
from .krasview import KrasViewIE
from .ku6 import Ku6IE
from .kusi import KUSIIE

View File

@ -0,0 +1,39 @@
from __future__ import unicode_literals
from .common import InfoExtractor
class koreusIE(InfoExtractor):
_VALID_URL = r'https:\/\/www\.koreus\.com/video/(?P<id>\S+)'
_TESTS = [{
'url': 'https://www.koreus.com/video/pub-mazda-drague.html',
'info_dict': {
'id': 'pub-mazda-drague',
'ext': 'mp4',
'title': 'Pub Mazda (Drague)',
}
}]
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')
download_url = self._html_search_regex(
r'<source src="(https://embed\.koreus\.com/[0-9]+/[0-9]+/[a-z-]+\.mp4)" type="video/mp4"',
webpage, "download_url"
)
return {
'http_headers': {'Accept': 'video/webm,video/ogg,video/*;q=0.9,application/ogg;q=0.7,audio/*;q=0.6,*/*;q=0.5'},
'id': video_id,
'url': download_url,
'title': title
}