1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

[mp4upload] Add new extractor

This commit is contained in:
nekobit1 2019-02-02 09:27:22 -05:00
parent b9bc1cff72
commit c754794071
2 changed files with 40 additions and 0 deletions

View File

@ -673,6 +673,7 @@ from .motorsport import MotorsportIE
from .movieclips import MovieClipsIE
from .moviezine import MoviezineIE
from .movingimage import MovingImageIE
from .mp4upload import MP4UploadIE
from .msn import MSNIE
from .mtv import (
MTVIE,

View File

@ -0,0 +1,39 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
import re
class MP4UploadIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?mp4upload\.com/embed-(?P<id>[a-z0-9]+).html'
_TEST = {
'url': 'https://mp4upload.com/embed-4d25ernqkj91.html',
'info_dict': {
'id': '4d25ernqkj91',
'ext': 'mp4',
'title': '4d25ernqkj91'
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = video_id
# Needed for both port and full video id
videohotlink = re.findall(r'\|video\|(.*?)\|(.*?)\|', webpage)
# All the info we actually need in its order
subdomain = re.search(r'\|([^\|]*?)\|complete\|', webpage).group(1)
port = [x[1] for x in videohotlink][0]
fullid = [x[0] for x in videohotlink][0]
# Compile full domain
theurl = "https://"+subdomain+".mp4upload.com:"+port+"/d/"+fullid+"/video.mp4"
return {
'id': video_id,
'title': title,
'url': theurl
}