mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 17:31:24 +01:00
Compare commits
5 Commits
5abc4d3ae0
...
5d135d8a06
Author | SHA1 | Date | |
---|---|---|---|
|
5d135d8a06 | ||
|
b2d51158a2 | ||
|
b35a981154 | ||
|
f1fbfc8199 | ||
|
e8e9a11ae5 |
|
@ -1,4 +1,4 @@
|
||||||
from yt_dlp.extractor.common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,8 +17,7 @@ class MaarivIE(InfoExtractor):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def extract_resolution(url):
|
def extract_resolution(url):
|
||||||
pattern = r'(\d{2,4}x\d{2,4})\.mp4$'
|
match = re.search(r'(\d{2,4}x\d{2,4})\.mp4$', url)
|
||||||
match = re.search(pattern, url)
|
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
|
@ -26,13 +25,13 @@ class MaarivIE(InfoExtractor):
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
# Find the correct iframes
|
# Find the correct iframes
|
||||||
video_urls = re.findall(r'<iframe .*?poster="(.*?)" src="(.*?)"', webpage)
|
video_urls = re.findall(r'<iframe [^>]?poster="([^"]+)"[^>]+ src="([^"]+)"', webpage)
|
||||||
video_info_list = []
|
video_info_list = []
|
||||||
|
|
||||||
for thumbnail, src in video_urls:
|
for thumbnail, src in video_urls:
|
||||||
media_param = re.search(r'media=(\d+)', src).group(1)
|
media_param = re.search(r'media=(\d+)', src).group(1)
|
||||||
info_url = f"https://dal.walla.co.il/media/{media_param}?origin=player.maariv.co.il"
|
info_json = self._download_json(f"https://dal.walla.co.il/media/{media_param}?origin=player.maariv.co.il",
|
||||||
info_json = self._download_json(info_url, video_id)
|
video_id)
|
||||||
data = info_json['data']
|
data = info_json['data']
|
||||||
main_video_to_download_filename = data['video']['file_name']
|
main_video_to_download_filename = data['video']['file_name']
|
||||||
main_video_to_download_url = data['video']['url']
|
main_video_to_download_url = data['video']['url']
|
||||||
|
@ -48,13 +47,11 @@ class MaarivIE(InfoExtractor):
|
||||||
|
|
||||||
for format_id, stream_url_object in enumerate(data['video']['stream_urls'], start=1):
|
for format_id, stream_url_object in enumerate(data['video']['stream_urls'], start=1):
|
||||||
stream_url = stream_url_object['stream_url']
|
stream_url = stream_url_object['stream_url']
|
||||||
resolution = self.extract_resolution(stream_url)
|
format_list.append({
|
||||||
format_info = {
|
|
||||||
'format_id': str(format_id),
|
'format_id': str(format_id),
|
||||||
'url': stream_url,
|
'url': stream_url,
|
||||||
'resolution': resolution,
|
'resolution': self.extract_resolution(stream_url),
|
||||||
}
|
})
|
||||||
format_list.append(format_info)
|
|
||||||
|
|
||||||
video_info = {
|
video_info = {
|
||||||
'id': media_param,
|
'id': media_param,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user