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
|
||||
|
||||
|
||||
|
@ -17,8 +17,7 @@ class MaarivIE(InfoExtractor):
|
|||
|
||||
@staticmethod
|
||||
def extract_resolution(url):
|
||||
pattern = r'(\d{2,4}x\d{2,4})\.mp4$'
|
||||
match = re.search(pattern, url)
|
||||
match = re.search(r'(\d{2,4}x\d{2,4})\.mp4$', url)
|
||||
return match.group(1) if match else None
|
||||
|
||||
def _real_extract(self, url):
|
||||
|
@ -26,13 +25,13 @@ class MaarivIE(InfoExtractor):
|
|||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
# 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 = []
|
||||
|
||||
for thumbnail, src in video_urls:
|
||||
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(info_url, video_id)
|
||||
info_json = self._download_json(f"https://dal.walla.co.il/media/{media_param}?origin=player.maariv.co.il",
|
||||
video_id)
|
||||
data = info_json['data']
|
||||
main_video_to_download_filename = data['video']['file_name']
|
||||
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):
|
||||
stream_url = stream_url_object['stream_url']
|
||||
resolution = self.extract_resolution(stream_url)
|
||||
format_info = {
|
||||
format_list.append({
|
||||
'format_id': str(format_id),
|
||||
'url': stream_url,
|
||||
'resolution': resolution,
|
||||
}
|
||||
format_list.append(format_info)
|
||||
'resolution': self.extract_resolution(stream_url),
|
||||
})
|
||||
|
||||
video_info = {
|
||||
'id': media_param,
|
||||
|
|
Loading…
Reference in New Issue
Block a user