Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mp4upload] Add new extractor #19103

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,7 @@
from .movieclips import MovieClipsIE
from .moviezine import MoviezineIE
from .movingimage import MovingImageIE
from .mp4upload import MP4UploadIE
from .msn import MSNIE
from .mtv import (
MTVIE,
Expand Down
39 changes: 39 additions & 0 deletions youtube_dl/extractor/mp4upload.py
Original file line number Diff line number Diff line change
@@ -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
}