VideoHelp Forum



Support our site by donate $5 directly to us Thanks!!!

Try StreamFab Downloader and download streaming video from Netflix, Amazon!



+ Reply to Thread
Results 1 to 22 of 22
  1. I ask you please if there is anyone who knows how to download videos from this type of server, if there is any program or modify any code I would greatly appreciate it. I pass an example link.

    https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8
    Quote Quote  
  2. Member
    Join Date
    Oct 2022
    Location
    Behind You
    Search PM
    This link does not work. You must send the direct website link. not an iframe no one can use or help you with.
    I help all that ask.
    Quote Quote  
  3. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    Code:
    #!/usr/bin/env python3
    
    import re
    import sys
    from hashlib import md5
    from html import unescape
    from random import random
    from urllib.parse import urlparse
    
    import requests
    import yt_dlp
    
    
    class iframeVideoDownloader:
        # user agent and platform related headers
        user_agent = {
            'sec-ch-ua':
                '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
            'sec-ch-ua-mobile':
                '?0',
            'sec-ch-ua-platform':
                '"Linux"',
            'user-agent':
                'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
        }
        session = requests.session()
        session.headers.update(user_agent)
    
        def __init__(self,
                     referer='https://127.0.0.1/',
                     embed_url='',
                     name='',
                     path=''):
            self.referer = referer if referer else sys.exit(1)
            self.embed_url = embed_url if embed_url else sys.exit(1)
            self.guid = urlparse(embed_url).path.split('/')[-1]
            self.headers = {
                'embed': {
                    'authority': 'iframe.mediadelivery.net',
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'referer': referer,
                    'sec-fetch-dest': 'iframe',
                    'sec-fetch-mode': 'navigate',
                    'sec-fetch-site': 'cross-site',
                    'upgrade-insecure-requests': '1',
                },
                'ping|activate': {
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'origin': 'https://iframe.mediadelivery.net',
                    'pragma': 'no-cache',
                    'referer': 'https://iframe.mediadelivery.net/',
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-site',
                },
                'playlist': {
                    'authority': 'iframe.mediadelivery.net',
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'referer': embed_url,
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-origin',
                }
            }
            embed_response = self.session.get(embed_url,
                                              headers=self.headers['embed'])
            embed_page = embed_response.text
            try:
                self.server_id = re.search(
                    r'https://video-(.*?)\.mediadelivery\.net', embed_page).group(1)
            except AttributeError:
                sys.exit(1)
            self.headers['ping|activate'].update(
                {'authority': f'video-{self.server_id}.mediadelivery.net'})
            search = re.search(r'contextId=(.*?)&secret=(.*?)"', embed_page)
            self.context_id, self.secret = search.group(1), search.group(2)
            if name:
                self.file_name = f'{name}.mp4'
            else:
                file_name_unescaped = re.search(r'og:title" content="(.*?)"',
                                                embed_page).group(1)
                file_name_escaped = unescape(file_name_unescaped)
                self.file_name = re.sub(r'\.[^.]*$.*', '.mp4', file_name_escaped)
            self.path = path if path else '~/Videos/'
    
        def prepare_dl(self) -> str:
    
            def ping(time: int, paused: str, res: str):
                md5_hash = md5(
                    f'{self.secret}_{self.context_id}_{time}_{paused}_{res}'.encode(
                        'utf8')).hexdigest()
                params = {
                    'hash': md5_hash,
                    'time': time,
                    'paused': paused,
                    'chosen_res': res
                }
                self.session.get(
                    f'https://video-{self.server_id}.mediadelivery.net/.drm/{self.context_id}/ping',
                    params=params,
                    headers=self.headers['ping|activate'])
    
            def activate():
                self.session.get(
                    f'https://video-{self.server_id}.mediadelivery.net/.drm/{self.context_id}/activate',
                    headers=self.headers['ping|activate'])
    
            def main_playlist():
                params = {'contextId': self.context_id, 'secret': self.secret}
                response = self.session.get(
                    f'https://iframe.mediadelivery.net/{self.guid}/playlist.drm',
                    params=params,
                    headers=self.headers['playlist'])
                resolutions = re.findall(r'RESOLUTION=(.*)', response.text)[::-1]
                if not resolutions:
                    sys.exit(2)
                else:
                    return resolutions[0]  # highest resolution, -1 for lowest
    
            def video_playlist():
                params = {'contextId': self.context_id}
                self.session.get(
                    f'https://iframe.mediadelivery.net/{self.guid}/{resolution}/video.drm',
                    params=params,
                    headers=self.headers['playlist'])
    
            ping(time=0, paused='true', res='0')
            activate()
            resolution = main_playlist()
            video_playlist()
            for i in range(0, 29, 4):  # first 28 seconds, arbitrary
                ping(time=i + round(random(), 6),
                     paused='false',
                     res=resolution.split('x')[-1])
            self.session.close()
            return resolution
    
        def download(self):
            resolution = self.prepare_dl()
            url = [
                f'https://iframe.mediadelivery.net/{self.guid}/{resolution}/video.drm?contextId={self.context_id}'
            ]
            ydl_opts = {
                'http_headers': {
                    'Referer': self.embed_url,
                    'User-Agent': self.user_agent['user-agent']
                },
                'concurrent_fragment_downloads': 10,
                # 'external_downloader': 'aria2c'
                'nocheckcertificate': True,
                'outtmpl': self.file_name,
                'restrictfilenames': True,
                'windowsfilenames': True,
                'nopart': True,
                'paths': {
                    'home': self.path,
                    'temp': f'.{self.file_name}/',
                },
                'retries': float('inf'),
                'extractor_retries': float('inf'),
                'fragment_retries': float('inf'),
                'skip_unavailable_fragments': False,
                'no_warnings': True,
            }
            with yt_dlp.YoutubeDL(ydl_opts) as ydl:
                ydl.download(url)
    
    
    if __name__ == '__main__':
        video = iframeVideoDownloader(
            # insert the referer between the quotes below (address of your webpage)
            referer='https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8',
            # paste your embed link
            embed_url='https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8',
            # you can override file name, no extension
            name="video",
            # you can override download path
            path=r"")
        # video.session.close()
        video.download()
    Image
    [Attachment 74460 - Click to enlarge]
    Quote Quote  
  4. wow iamghost, amazing script
    Quote Quote  
  5. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    Originally Posted by lomero View Post
    wow iamghost, amazing script
    i didnt create this script, found them on here
    Quote Quote  
  6. great friend, thank you I would like if you could help me on how to download these types of links
    Quote Quote  
  7. Originally Posted by iamghost View Post
    Code:
    #!/usr/bin/env python3
    
    import re
    import sys
    from hashlib import md5
    from html import unescape
    from random import random
    from urllib.parse import urlparse
    
    import requests
    import yt_dlp
    
    
    class iframeVideoDownloader:
        # user agent and platform related headers
        user_agent = {
            'sec-ch-ua':
                '"Google Chrome";v="107", "Chromium";v="107", "Not=A?Brand";v="24"',
            'sec-ch-ua-mobile':
                '?0',
            'sec-ch-ua-platform':
                '"Linux"',
            'user-agent':
                'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36'
        }
        session = requests.session()
        session.headers.update(user_agent)
    
        def __init__(self,
                     referer='https://127.0.0.1/',
                     embed_url='',
                     name='',
                     path=''):
            self.referer = referer if referer else sys.exit(1)
            self.embed_url = embed_url if embed_url else sys.exit(1)
            self.guid = urlparse(embed_url).path.split('/')[-1]
            self.headers = {
                'embed': {
                    'authority': 'iframe.mediadelivery.net',
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'referer': referer,
                    'sec-fetch-dest': 'iframe',
                    'sec-fetch-mode': 'navigate',
                    'sec-fetch-site': 'cross-site',
                    'upgrade-insecure-requests': '1',
                },
                'ping|activate': {
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'origin': 'https://iframe.mediadelivery.net',
                    'pragma': 'no-cache',
                    'referer': 'https://iframe.mediadelivery.net/',
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-site',
                },
                'playlist': {
                    'authority': 'iframe.mediadelivery.net',
                    'accept': '*/*',
                    'accept-language': 'en-US,en;q=0.9',
                    'cache-control': 'no-cache',
                    'pragma': 'no-cache',
                    'referer': embed_url,
                    'sec-fetch-dest': 'empty',
                    'sec-fetch-mode': 'cors',
                    'sec-fetch-site': 'same-origin',
                }
            }
            embed_response = self.session.get(embed_url,
                                              headers=self.headers['embed'])
            embed_page = embed_response.text
            try:
                self.server_id = re.search(
                    r'https://video-(.*?)\.mediadelivery\.net', embed_page).group(1)
            except AttributeError:
                sys.exit(1)
            self.headers['ping|activate'].update(
                {'authority': f'video-{self.server_id}.mediadelivery.net'})
            search = re.search(r'contextId=(.*?)&secret=(.*?)"', embed_page)
            self.context_id, self.secret = search.group(1), search.group(2)
            if name:
                self.file_name = f'{name}.mp4'
            else:
                file_name_unescaped = re.search(r'og:title" content="(.*?)"',
                                                embed_page).group(1)
                file_name_escaped = unescape(file_name_unescaped)
                self.file_name = re.sub(r'\.[^.]*$.*', '.mp4', file_name_escaped)
            self.path = path if path else '~/Videos/'
    
        def prepare_dl(self) -> str:
    
            def ping(time: int, paused: str, res: str):
                md5_hash = md5(
                    f'{self.secret}_{self.context_id}_{time}_{paused}_{res}'.encode(
                        'utf8')).hexdigest()
                params = {
                    'hash': md5_hash,
                    'time': time,
                    'paused': paused,
                    'chosen_res': res
                }
                self.session.get(
                    f'https://video-{self.server_id}.mediadelivery.net/.drm/{self.context_id}/ping',
                    params=params,
                    headers=self.headers['ping|activate'])
    
            def activate():
                self.session.get(
                    f'https://video-{self.server_id}.mediadelivery.net/.drm/{self.context_id}/activate',
                    headers=self.headers['ping|activate'])
    
            def main_playlist():
                params = {'contextId': self.context_id, 'secret': self.secret}
                response = self.session.get(
                    f'https://iframe.mediadelivery.net/{self.guid}/playlist.drm',
                    params=params,
                    headers=self.headers['playlist'])
                resolutions = re.findall(r'RESOLUTION=(.*)', response.text)[::-1]
                if not resolutions:
                    sys.exit(2)
                else:
                    return resolutions[0]  # highest resolution, -1 for lowest
    
            def video_playlist():
                params = {'contextId': self.context_id}
                self.session.get(
                    f'https://iframe.mediadelivery.net/{self.guid}/{resolution}/video.drm',
                    params=params,
                    headers=self.headers['playlist'])
    
            ping(time=0, paused='true', res='0')
            activate()
            resolution = main_playlist()
            video_playlist()
            for i in range(0, 29, 4):  # first 28 seconds, arbitrary
                ping(time=i + round(random(), 6),
                     paused='false',
                     res=resolution.split('x')[-1])
            self.session.close()
            return resolution
    
        def download(self):
            resolution = self.prepare_dl()
            url = [
                f'https://iframe.mediadelivery.net/{self.guid}/{resolution}/video.drm?contextId={self.context_id}'
            ]
            ydl_opts = {
                'http_headers': {
                    'Referer': self.embed_url,
                    'User-Agent': self.user_agent['user-agent']
                },
                'concurrent_fragment_downloads': 10,
                # 'external_downloader': 'aria2c'
                'nocheckcertificate': True,
                'outtmpl': self.file_name,
                'restrictfilenames': True,
                'windowsfilenames': True,
                'nopart': True,
                'paths': {
                    'home': self.path,
                    'temp': f'.{self.file_name}/',
                },
                'retries': float('inf'),
                'extractor_retries': float('inf'),
                'fragment_retries': float('inf'),
                'skip_unavailable_fragments': False,
                'no_warnings': True,
            }
            with yt_dlp.YoutubeDL(ydl_opts) as ydl:
                ydl.download(url)
    
    
    if __name__ == '__main__':
        video = iframeVideoDownloader(
            # insert the referer between the quotes below (address of your webpage)
            referer='https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8',
            # paste your embed link
            embed_url='https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8',
            # you can override file name, no extension
            name="video",
            # you can override download path
            path=r"")
        # video.session.close()
        video.download()
    Image
    [Attachment 74460 - Click to enlarge]

    Could you advise me a little? I don't know much about code, I don't know what program you use. I would appreciate it if you can help me a little more.
    Quote Quote  
  8. What programs do friends use? I tried streamlink and it doesn't work.

    Image
    [Attachment 74503 - Click to enlarge]
    Quote Quote  
  9. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    Python 3.9.18
    Quote Quote  
  10. Member
    Join Date
    Mar 2024
    Location
    WALDBURG
    Search Comp PM
    changing the script above from

    referer='https://iframe.mediadelivery.net/embed/7232/e39c927f-2284-4642-a1dc-9fef120783e8',

    to

    referer='https://iframe.mediadelivery.net/embed/184713/63a281fb-30a7-4ea0-9d4e-8c7833f66ee5',

    breaks it ?!

    can someone tell me whats the topic?
    Quote Quote  
  11. Originally Posted by ksch View Post
    can someone tell me whats the topic?
    The topic is astrophysics.

    To download your video, just find the m3u8 in the network tab and use yt-dlp with referer
    Code:
    yt-dlp --add-header "Referer: https://iframe.mediadelivery.net/" "https://vz-5a0a10dc-e1b.b-cdn.net/63a281fb-30a7-4ea0-9d4e-8c7833f66ee5/1080p/video.m3u8"
    click click2
    If I/my posts ever helped you, and you want to give back, send me a private message!
    Quote Quote  
  12. Member
    Join Date
    Mar 2024
    Location
    WALDBURG
    Search Comp PM
    Originally Posted by [ss]vegeta View Post
    Originally Posted by ksch View Post
    can someone tell me whats the topic?
    The topic is astrophysics.

    yeah, feels like ^^
    Quote Quote  
  13. So glad I found this thread. The script that iamghost shared is gold!!! I haven't been able to download recent uploads from a site and get the following error:

    Code:
    yt_dlp.utils.DownloadError: ERROR: m3u8 download detected but ffmpeg could not be found. Please install
    I've installed ffmpeg via pip but I'm not sure how to call/reference it from the script. Help?
    Quote Quote  
  14. Thanks, ffmpeg installed but I receive:
    Code:
    yt_dlp.utils.DownloadError: ERROR: ffmpeg exited with code 3419392776
    Google not too helpful on this one, unfortunately

    Video link from page source (download worked before using this link):

    Code:
    {\"posterUrl\":\"https://vz-7031a1e6-d65.b-cdn.net/516612fc-5ee4-45fd-a1ee-1a58206bb926/thumbnail_4ef9a17b.jpg\",\"embedSrc\":\"https://iframe.mediadelivery.net/embed/127294/516612fc-5ee4-45fd-a1ee-1a58206bb926?autoplay=false\u0026preload=true\"
    Video Link from Stream Detector
    Code:
    https://iframe.mediadelivery.net/516612fc-5ee4-45fd-a1ee-1a58206bb926/1080p/video.drm?contextId=431436c0-7e19-435d-a599-8ca34922acc8
    Not sure how to pass it through yt-dlp or the bunny-cdn-drm script. bunny-cdn-drm returns ffmpeg exited with error code, and yt-dlp returns 403 error. Tried passing login credentials with --username but also unsuccessful.
    Last edited by coolwave; 12th Mar 2024 at 10:56.
    Quote Quote  
  15. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by coolwave View Post
    Not sure how to pass it through yt-dlp or the bunny-cdn-drm script. bunny-cdn-drm returns ffmpeg exited with error code, and yt-dlp returns 403 error. Tried passing login credentials with --username but also unsuccessful.
    The bunny script needs to be updated because they changed their pinging mechanism. For now, just have patience.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  16. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    The bunny script needs to be updated because they changed their pinging mechanism. For now, just have patience.
    That makes sense why the older videos still work. I was stumped because the info from network tab was pretty much identical except for the Cdn-Edgestorageid and Cdn-Fileserver response headers. Thanks for the info! New and still learning. I've learned a lot from reading through your posts. (and also from the prince of all saiyans)
    Quote Quote  
  17. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by coolwave View Post
    That makes sense why the older videos still work. I was stumped because the info from network tab was pretty much identical except for the Cdn-Edgestorageid and Cdn-Fileserver response headers.
    If you share the login details in private, I may try to download it (I do not guarantee I will succeed though, need to see the video).

    Edit: solved using account. Your link: https://www.transfernow.net/dl/20240313QngCXByY
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 13th Mar 2024 at 10:16.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  18. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Originally Posted by coolwave View Post
    Not sure how to pass it through yt-dlp or the bunny-cdn-drm script. bunny-cdn-drm returns ffmpeg exited with error code, and yt-dlp returns 403 error. Tried passing login credentials with --username but also unsuccessful.
    The bunny script needs to be updated because they changed their pinging mechanism. For now, just have patience.
    The wait is over, i have created a fix for this.
    Now we only have some more patience until it gets merged.
    https://github.com/MaZED-UP/bunny-cdn-drm-video-dl/pull/22
    Quote Quote  
  19. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by monk87 View Post
    The wait is over, i have created a fix for this.
    Now we only have some more patience until it gets merged.
    Well done. Finally a proper solution.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~~~~~~~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  20. Originally Posted by [ss]vegeta View Post
    Originally Posted by ksch View Post
    can someone tell me whats the topic?
    The topic is astrophysics.

    To download your video, just find the m3u8 in the network tab and use yt-dlp with referer
    Code:
    yt-dlp --add-header "Referer: https://iframe.mediadelivery.net/" "https://vz-5a0a10dc-e1b.b-cdn.net/63a281fb-30a7-4ea0-9d4e-8c7833f66ee5/1080p/video.m3u8"
    Thank you so much buddy. This helped me a lot and it worked. I struggled a lot to download my class videos earlier. You fixed the problem. Thank you again <3
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!