mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-15 07:33:08 +01:00
Add megavideoz.eu support.
This commit is contained in:
parent
576904bce6
commit
733be371af
@ -267,6 +267,7 @@
|
|||||||
from .mailru import MailRuIE
|
from .mailru import MailRuIE
|
||||||
from .malemotion import MalemotionIE
|
from .malemotion import MalemotionIE
|
||||||
from .mdr import MDRIE
|
from .mdr import MDRIE
|
||||||
|
from .megavideozeu import MegavideozeuIE
|
||||||
from .metacafe import MetacafeIE
|
from .metacafe import MetacafeIE
|
||||||
from .metacritic import MetacriticIE
|
from .metacritic import MetacriticIE
|
||||||
from .mgoon import MgoonIE
|
from .mgoon import MgoonIE
|
||||||
|
39
youtube_dl/extractor/megavideozeu.py
Normal file
39
youtube_dl/extractor/megavideozeu.py
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from .common import InfoExtractor
|
||||||
|
from ..utils import (
|
||||||
|
int_or_none,
|
||||||
|
parse_filesize,
|
||||||
|
unified_strdate,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class MegavideozeuIE(InfoExtractor):
|
||||||
|
_VALID_URL = r'https?://(?:www\.)?megavideoz\.eu/video/(?P<id>.*)(?:.*)'
|
||||||
|
|
||||||
|
def _real_extract(self, url):
|
||||||
|
tmp_video_id = self._match_id(url)
|
||||||
|
|
||||||
|
webpage = self._download_webpage(url, tmp_video_id)
|
||||||
|
|
||||||
|
config_php = self._html_search_regex(
|
||||||
|
r'var cnf = \'([^\']+)\'', webpage, 'config.php url')
|
||||||
|
|
||||||
|
configpage = self._download_webpage(config_php, tmp_video_id)
|
||||||
|
|
||||||
|
video_id = self._html_search_regex(
|
||||||
|
r'<mediaid>([^<]+)', configpage, 'video id')
|
||||||
|
video_url = self._html_search_regex(
|
||||||
|
r'<file>([^<]+)', configpage, 'video URL')
|
||||||
|
title = self._html_search_regex(
|
||||||
|
r'<title><!\[CDATA\[([^\]]+)', configpage, 'title')
|
||||||
|
duration = int_or_none(self._html_search_regex(
|
||||||
|
r'<duration>([0-9]+)', configpage, 'duration', fatal=False))
|
||||||
|
|
||||||
|
return {
|
||||||
|
'id': video_id,
|
||||||
|
'url': video_url,
|
||||||
|
'title': title,
|
||||||
|
'duration': duration
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user