34 lines
876 B
Python
34 lines
876 B
Python
import urllib.parse
|
|
import re
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
from yt_dlp.extractor.common import InfoExtractor
|
|
|
|
|
|
class VidmolyIE(InfoExtractor):
|
|
_valid_domains = r'|'.join([r'vidmoly\.biz'])
|
|
_VALID_URL = r'https?://(?:' + _valid_domains + ')/embed-(?P<id>\w+)\.html$'
|
|
|
|
def _real_extract(self, url):
|
|
video_id = urllib.parse.unquote_plus(self._match_id(url))
|
|
|
|
html = self._download_html(url)
|
|
|
|
m3u8_url = re.findall("'(https\\:\\/\\/.*master\\.m3u.*)'", html.text)[0]
|
|
formats = self._extract_m3u8_formats(
|
|
m3u8_url, video_id, 'mp4',
|
|
'm3u8_native', m3u8_id='hls')
|
|
title = re.findall(r"<title>(.*)<\/title>", html.text)[0]
|
|
|
|
ret = {
|
|
'id': video_id,
|
|
'display_id': video_id,
|
|
'title': title,
|
|
'formats': formats,
|
|
}
|
|
|
|
return ret
|
|
|