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
Page 15 of 15
FirstFirst ... 5 13 14 15
Results 421 to 439 of 439
  1. I'm trying to download from rakuten.tv
    I dumped a CDM from Google Pixel as suggested, got everything installed right, followed every step and read everything more than twice...
    but when I try to download, I'm getting this error:

    Code:
     [USER_ERROR] Failed to download: from rakuten_tv. Reason: Bad device id. Solution: Change the device id in the service script file.
    I know the tool is working because I succeed to downloaded from other sites...

    As suggested in the error message, I went to the rakuten_tv.py and changed the device id to all the options listed there... none of it worked...

    What should I do now?
    Quote Quote  
  2. Deleted message
    Last edited by Dafalgan; 29th Apr 2025 at 10:19.
    Quote Quote  
  3. Member
    Join Date
    Dec 2021
    Location
    Tunisia
    Search Comp PM
    i'm using widefrog for a couples of months and it's very usefull
    now i have a problem with tf1.fr download series
    i have paid residentiel proxy and it's work fine
    but with series that have many episodes i have errors at " collections extraction stage" like this
    raise SSLError(e, request=request)
    requests.exceptions.SSLError: HTTPSConnectionPool(host='www.tf1.fr', port=443): Max retries exceeded with url: /tf1/ici-tout-commence/videos/saison-5/187 (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1145)')))
    i'm about to download saison of tf1/ici-tout-commence/videos/saison-5
    and it's stuck on episode 187 i think

    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    urllib3.exceptions.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1145)

    The above exception was the direct cause of the following exception:
    also i don't progress like before exp [3/250] ....
    what is the solution please
    Quote Quote  
  4. Hi,
    It seems goplay.be has changed some things. I can download the first 5 episodes of "de mol" just fine but from episode 6 and on it doesnt seem to work anymore.
    Image
    [Attachment 86932 - Click to enlarge]
    Last edited by vorathan; 11th May 2025 at 07:50.
    Quote Quote  
  5. Member
    Join Date
    May 2025
    Location
    Andorra
    Search PM
    Thank you very much for those scripts 2nHxWW6GkN1l916N3ayz8HQoi , thanks to you I've been learning python and scripting. It works like a charm!

    One question regarding the --query= parameter. Neither me nor any LLM has been able to pierce its secrets. I've tried on tf1.fr and m6.fr without any success. What should be --query= if I want the first x videos of the first line of the first rail on a show page such as this one: https://www.tf1.fr/tmc/quotidien-avec-yann-barthes/videos/replay or this one https://www.m6.fr/cauchemar-en-cuisine-avec-philippe-etchebest-p_841

    I've performed a ton of tests and the best I can get is the first 2 videos or all/100 videos of the page.

    Thank you again for sharing your excellent work with us!
    Quote Quote  
  6. Hello,

    Downloading from VRT seems not to work anymore?

    For instance, the following download (logged in, content plays fine in Firefox):

    Code:
    > python widefrog.py "https://www.vrt.be/vrtmax/a-z/campus-cup/6/de-campus-cup-s6a1/"
    
    [WARNING] The service veeps.com cannot be used because it is not properly implemented, has package errors or has syntax errors. After fixing the issue delete the app_files folder.
    [INFO] Current app version: 3.2.0
    [INFO] Running on: windows/64bit/python 3.10.11
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    [USER_ERROR]/[APP_ERROR] Failed to download: https://www.vrt.be/vrtmax/a-z/campus-cup/6/de-campus-cup-s6a1. Reason: Failed to extract content data. Solution: Make sure you can play the content. If you can, then debug the vrt_be service.
    [INFO] Finished generating the download commands.
    [WARNING] Saved the failed URLs to app_files\cmds_failed.txt
    [WARNING] No download commands have been generated.
    Anyone else experiencing issues with VRT?
    Quote Quote  
  7. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    widevineproxy2 work fine
    Code:
    N_m3u8DL-RE "https://remix.vrtcdn.be/content/vod/pl-7fd9dd84-82f6-484c-af62-1347ae503b24/pl-7fd9dd84-82f6-484c-af62-1347ae503b24_drm_5e352487-e8df-4aa0-b2d2-9c52050cd1f8.ism/.mpd?filter=%28%21%28type%3D%3D%22audio%22%26%26FourCC%21%3D%22AACL%22%29%29" -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36" -H "Accept: */*" -H "Origin: https://www.vrt.be" -H "Referer: https://www.vrt.be/" --key 0bfb25d0f450e4b7c290fbf3b0ef5053:ec8d52126cd726a410bc1c796e30aafc --use-shaka-packager -M format=mkv
    Image
    [Attachment 87071 - Click to enlarge]
    Quote Quote  
  8. Did not yet know about widevindeproxy2, what an eye-opener.
    Thanks for your quick help!
    Quote Quote  
  9. First of all, thank you so much for this project!

    I have been using this for a week now and I'm amazed! Today I tried downloading an episode from GoPlay and I got the following error:

    python widefrog.py "https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-schermen-s5-aflevering-17"
    [INFO] Current app version: 3.2.0
    [INFO] Running on: windows/64bit/python 3.12.3
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-scherme...-aflevering-17. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867490198527/GRQ/streams...6/manifest.mpd. Solution: Extend the goplay_be service.
    [INFO] Finished generating the download commands.
    [WARNING] Saved the failed URLs to app_files\cmds_failed.txt
    [WARNING] No download commands have been generated.

    (venv) D:\XXX\XXX\Widefrog>

    Is there something obvious I'm doing wrong? When I try downloading the complete series, most seem to work, example:

    [INFO] Current progress: [95/144]
    [INFO] Current progress: [96/144]
    [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-scherme...2-aflevering-1. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867526682527/GRQ/streams...d/manifest.mpd. Solution: Extend the goplay_be service.
    [INFO] Current progress: [97/144]

    Hopefully this is clear, thank you!
    Quote Quote  
  10. Originally Posted by Kevste View Post
    [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-scherme...-aflevering-17. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867490198527/GRQ/streams...6/manifest.mpd. Solution: Extend the goplay_be service.
    [INFO] Finished generating the download commands.
    [WARNING] Saved the failed URLs to app_files\cmds_failed.txt
    [WARNING] No download commands have been generated.
    Change goplay_be.py file @line 186-193 and paste:
    Code:
                            try:
                                segment_timeline = representation["SegmentTemplate"]["SegmentTimeline"]
                                if loop == 0:
                                    goplay_be.extend_dict(
                                        segment_dict, segment_key,
                                        segment_timeline
                                    )
                                else:
                                    representation["SegmentTemplate"]["SegmentTimeline"] = segment_dict[segment_key]
                            except KeyError:
                                print("SegmentTimeline or SegmentTemplate not found (using try-except).")
    No support on this code. There is always a better way. For me it works fine.
    Quote Quote  
  11. Originally Posted by de.lesse.be View Post
    Originally Posted by Kevste View Post
    [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-scherme...-aflevering-17. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867490198527/GRQ/streams...6/manifest.mpd. Solution: Extend the goplay_be service.
    [INFO] Finished generating the download commands.
    [WARNING] Saved the failed URLs to app_files\cmds_failed.txt
    [WARNING] No download commands have been generated.
    Change goplay_be.py file @line 186-193 and paste:
    Code:
                            try:
                                segment_timeline = representation["SegmentTemplate"]["SegmentTimeline"]
                                if loop == 0:
                                    goplay_be.extend_dict(
                                        segment_dict, segment_key,
                                        segment_timeline
                                    )
                                else:
                                    representation["SegmentTemplate"]["SegmentTimeline"] = segment_dict[segment_key]
                            except KeyError:
                                print("SegmentTimeline or SegmentTemplate not found (using try-except).")
    No support on this code. There is always a better way. For me it works fine.
    Thank you!!! This worked!!
    Quote Quote  
  12. I am currently having problems using the tool with plus.rtl.de, it used to work fine.

    Getting the error:

    Code:
    ❯ python widefrog.py https://plus.rtl.de/video-tv/serien/pokemon-horizonte-die-serie-988360/ --debug
    [INFO] Current app version: 3.2.0
    [INFO] Running on: linux/64bit/python 3.13.3
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    Traceback (most recent call last):
      File "/home/user/Widefrog-3.2/widefrog.py", line 124, in <module>
        main_service.run_service(response)
        ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 442, in run_service
        dwn_cmds, failed_cmds, proc_cmds = main_service.get_download_commands_parallel(demo_urls)
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 395, in get_download_commands_parallel
        success, fail, proc = future.result()
                              ~~~~~~~~~~~~~^^
      File "/usr/lib/python3.13/concurrent/futures/_base.py", line 449, in result
        return self.__get_result()
               ~~~~~~~~~~~~~~~~~^^
      File "/usr/lib/python3.13/concurrent/futures/_base.py", line 401, in __get_result
        raise self._exception
      File "/usr/lib/python3.13/concurrent/futures/thread.py", line 59, in run
        result = self.fn(*self.args, **self.kwargs)
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 281, in get_download_commands
        raise e
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 266, in get_download_commands
        dl_cmds, pr_cmds = main_service.get_download_command(service, source_element)
                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 89, in get_download_command
        raise e
      File "/home/user/Widefrog-3.2/utils/main_service.py", line 63, in get_download_command
        manifest, pssh, additional = service.get_video_data(source_element)
                                     ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
      File "/home/user/Widefrog-3.2/services/plus_rtl_de.py", line 490, in get_video_data
        video_contents = sorted(
                         ~~~~~~~
            video_contents, key=lambda vc: plus_rtl_de.RES_PRIORITY[vc[2]], reverse=True
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        )[0]
        ~^^^
    IndexError: list index out of range
    Does anybody know what has changed?
    Quote Quote  
  13. I guess you haven't seen and tried the patch in #415?
    Quote Quote  
  14. Originally Posted by Obo View Post
    I guess you haven't seen and tried the patch in #415?
    I feel so stupid. Thanks a lot for the hint!
    Quote Quote  
  15. Originally Posted by de.lesse.be View Post
    Originally Posted by Kevste View Post
    [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-scherme...-aflevering-17. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867490198527/GRQ/streams...6/manifest.mpd. Solution: Extend the goplay_be service.
    [INFO] Finished generating the download commands.
    [WARNING] Saved the failed URLs to app_files\cmds_failed.txt
    [WARNING] No download commands have been generated.
    Change goplay_be.py file @line 186-193 and paste:
    Code:
                            try:
                                segment_timeline = representation["SegmentTemplate"]["SegmentTimeline"]
                                if loop == 0:
                                    goplay_be.extend_dict(
                                        segment_dict, segment_key,
                                        segment_timeline
                                    )
                                else:
                                    representation["SegmentTemplate"]["SegmentTimeline"] = segment_dict[segment_key]
                            except KeyError:
                                print("SegmentTimeline or SegmentTemplate not found (using try-except).")
    No support on this code. There is always a better way. For me it works fine.
    It didn't for me...
    Code:
    (venv) erik@piholeNASLXC:~/schrapen/widefrog$ python widefrog.py "https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-schermen-s5-aflevering-17" --debug
    [INFO] Linux detected. Chosen terminal: gnome-terminal. Chosen shell: bash.
    [INFO] Current app version: 3.2.0
    [INFO] Running on: linux/64bit/python 3.11.2
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    Traceback (most recent call last):
      File "/home/erik/schrapen/widefrog/services/goplay_be.py", line 347, in get_video_data
        manifest = goplay_be.generate_master_mpd(source_element, mpd_content)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/services/goplay_be.py", line 189, in generate_master_mpd
        segment_dict, segment_key,
                      ^^^^^^^^^^^
    NameError: name 'segment_key' is not defined. Did you mean: 'segment_dict'?
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "/home/erik/schrapen/widefrog/widefrog.py", line 124, in <module>
        main_service.run_service(response)
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 442, in run_service
        dwn_cmds, failed_cmds, proc_cmds = main_service.get_download_commands_parallel(demo_urls)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 395, in get_download_commands_parallel
        success, fail, proc = future.result()
                              ^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
        return self.__get_result()
               ^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
        raise self._exception
      File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 281, in get_download_commands
        raise e
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 266, in get_download_commands
        dl_cmds, pr_cmds = main_service.get_download_command(service, source_element)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 84, in get_download_command
        raise e
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 63, in get_download_command
        manifest, pssh, additional = service.get_video_data(source_element)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/services/goplay_be.py", line 349, in get_video_data
        raise CustomException(ERR_MSG.format(
    utils.structs.CustomException: [APP_ERROR] Failed to download: https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-schermen-s5-aflevering-17. Reason: Manifest format not supported: https://dai.google.com/ondemand/dash/content/2615619/vid/10153867490198527/GRQ/streams/1c8dda8a-0154-4c96-8652-fdeef46b2664/manifest.mpd. Solution: Extend the goplay_be service.
    And I did try your fix:
    Code:
    (venv) erik@piholeNASLXC:~/schrapen/widefrog$ cat services/goplay_be.py
    import base64
    import builtins
    import json
    import os
    import re
    from os.path import join
    
    import browser_cookie3
    import requests
    import xmltodict
    
    from utils.constants.macros import USER_ERROR, ERR_MSG, APP_ERROR
    from utils.main_service import main_service
    from utils.structs import BaseElement, CustomException, BaseService
    from utils.tools.args import check_range
    from utils.tools.cdm import get_pssh_from_cenc_pssh
    from utils.tools.common import get_valid_filename, clean_url
    
    
    class goplay_be(BaseService):
        DEMO_URLS = [
            "https://www.goplay.be/video/nonkels/de",
            "https://www.goplay.be/video/maxine/maxine/maxine-s1-aflevering-2",
            "https://www.goplay.be/video/left-for-dead-the-ashley-reeves-story",
            "https://www.goplay.be/video/jodi-arias-dirty-little-secret-1",
            "https://www.goplay.be/vermist",
            "https://www.goplay.be/de-spor",
            "https://www.goplay.be/de-expeditie",
        ]
    
        CONTENT_URL = "https://api.goplay.be/web/v1/videos/{content_type}/{uuid}"
        STREAM_URL = 'https://dai.google.com/ondemand/dash/content/{content_id}/vid/{video_id}/streams'
        LICENSE_URL = "https://widevine.keyos.com/api/v4/getLicense"
        BASE_URL = "https://www.goplay.be"
    
        BEARER_TOKEN = None
        AMZ_JSON = 'application/x-amz-json-1.1'
    
        @staticmethod
        def test_service():
            main_service.run_service(goplay_be)
    
        @staticmethod
        def get_additional_params(additional):
            additional_params = BaseService.get_additional_params(additional)
            manifest_url = additional.get("manifest_url", None)
            if manifest_url is not None:
                manifest_url = clean_url(manifest_url)
                additional_params = [(
                    "BASE_URL", lambda s: s.format(value=manifest_url)
                )] + additional_params
            return additional_params
    
        @staticmethod
        def credentials_needed():
            return {"FIREFOX_COOKIES": True}
    
        @staticmethod
        def get_bearer():
            cookie_dict = {}
            check_cookies = {}
            check_list = ["accesstoken", "refreshtoken"]
    
            for c in browser_cookie3.firefox(domain_name='goplay.be'):
                cookie_dict[c.name] = c.value
                cookie_name = c.name.lower()
                for f in check_list:
                    if f in cookie_name:
                        check_cookies[f] = True
            if len(cookie_dict.keys()) == 0 or len(check_cookies.keys()) != len(check_list):
                return None
    
            refresh_token = None
            client_id = None
            refresh_url = None
            for c, v in cookie_dict.items():
                c_name = c.lower()
                if "accesstoken" in c_name:
                    refresh_url = json.loads(base64.b64decode(v.split(".")[1]  + "==").decode())["iss"]
                    refresh_url = "/".join(refresh_url.split("/")[:-1]) + "/"
    
                if "refreshtoken" in c_name:
                    refresh_token = v
                    client_id = c.split(".")[1]
    
                if refresh_url is not None and refresh_token is not None:
                    break
    
            assert len(refresh_token) > 0
            assert len(client_id) > 0
            assert len(refresh_url) > 0
    
            response = requests.post(
                refresh_url,
                headers={
                    'content-type': goplay_be.AMZ_JSON,
                    'x-amz-target': 'AWSCognitoIdentityProviderService.InitiateAuth'
                },
                data=json.dumps({
                    "ClientId": client_id, "AuthFlow": "REFRESH_TOKEN_AUTH",
                    "AuthParameters": {"REFRESH_TOKEN": refresh_token}
                })
            )
            response = response.content.decode()
            response = json.loads(response)
            return response["AuthenticationResult"]["AccessToken"]
    
        @staticmethod
        def initialize_service():
            if goplay_be.BEARER_TOKEN is None:
                goplay_be.BEARER_TOKEN = goplay_be.get_bearer()
                if goplay_be.BEARER_TOKEN is None:
                    raise CustomException(ERR_MSG.format(
                        type=USER_ERROR,
                        url=f'from {goplay_be.__name__}',
                        reason='Need account for this service',
                        solution='Sign into your account using Firefox'
                    ))
            return goplay_be
    
        @staticmethod
        def get_keys(challenge, additional):
            licence = requests.post(
                goplay_be.LICENSE_URL, data=challenge,
                headers={"customdata": additional["drm_token"]}
            )
            licence.raise_for_status()
            return licence.content
    
        @staticmethod
        def extend_dict(input_dict, input_key, input_value):
            old_value = input_dict.get(input_key, None)
            if old_value is None:
                input_dict[input_key] = input_value
                return input_dict
    
            for k1, v1 in input_value.items():
                if v1 is None:
                    continue
                if type(v1) is not list:
                    v1 = [v1]
    
                v2 = old_value.get(k1, None)
                if v2 is None:
                    old_value[k1] = v1
                    continue
                if type(v2) is not list:
                    v2 = [v2]
    
                v2.extend(v1)
                old_value[k1] = v2
            input_dict[input_key] = old_value
    
        @staticmethod
        def generate_master_mpd(source_element, mpd_content):
            xml_dict = xmltodict.parse(mpd_content)
            xml_node = xml_dict["MPD"]
            new_nodes = []
    
            xml_periods = xml_node["Period"]
            if type(xml_periods) is not list:
                xml_periods = [xml_periods]
            for period in xml_periods:
                if "-ad-" in period["@id"]:
                    continue
                new_nodes.append(period)
    
            segment_dict = {}
            assert len(new_nodes) >= 1
            for loop in range(0, 2):
                if loop == 1:
                    new_nodes = [new_nodes[0]]
    
                for node in new_nodes:
                    adaptations = node["AdaptationSet"]
                    if type(adaptations) is not list:
                        adaptations = [adaptations]
    
                    for adaptation in adaptations:
                        representations = adaptation["Representation"]
                        if type(representations) is not list:
                            representations = [representations]
    
                        for representation in representations:
                            try:
                                segment_timeline = representation["SegmentTemplate"]["SegmentTimeline"]
                                if loop == 0:
                                    goplay_be.extend_dict(
                                        segment_dict, segment_key,
                                        segment_timeline
                                    )
                                else:
                                    representation["SegmentTemplate"]["SegmentTimeline"] = segment_dict[segment_key]
                            except KeyError:
                                print("SegmentTimeline or SegmentTemplate not found (using try-except).")
    
            xml_dict["MPD"]["Period"] = new_nodes
            mpd_content = xmltodict.unparse(xml_dict, pretty=True)
            output_path = join(source_element.collection, source_element.element)
            if not os.path.exists(output_path):
                os.makedirs(output_path)
            output_path = join(str(output_path), "master.mpd")
    
            with open(output_path, "w") as f:
                f.write(mpd_content)
            return output_path
    
        @staticmethod
        def get_video_data(source_element):
            response = requests.get(source_element.url, headers={'Accept': 'application/json'})
            response = json.loads(response.content.decode())
            if response.get("uuid", None) in ["", None]:
                raise CustomException(ERR_MSG.format(
                    type=f'{USER_ERROR}',
                    url=source_element.url,
                    reason="The content isn't available",
                    solution="Do not attempt to download it"
                ))
    
            content_type = response["contentType"]
            content_type = re.sub(r'([a-z])([A-Z])', r'\1-\2', content_type).lower()
            response = requests.get(
                goplay_be.CONTENT_URL.format(content_type=content_type, uuid=response["uuid"]),
                headers={'Authorization': f'Bearer {goplay_be.BEARER_TOKEN}'},
            )
            status_code = response.status_code
            response = json.loads(response.content.decode())
            message = response.get("message", "").lower()
    
            if 400 <= status_code < 500 and "locked" in message:
                raise CustomException(ERR_MSG.format(
                    type=f'{USER_ERROR}',
                    url=source_element.url,
                    reason="Need Belgian IP to access content",
                    solution="Use a VPN"
                ))
    
            if source_element.element is None:
                try:
                    program = response["tracking"]["cimName"]
                    assert len(program) > 0
                except:
                    program = ""
                if program == "":
                    try:
                        program = response["tracking"]["piano"]["program"]
                        assert len(program) > 0
                    except:
                        program = ""
            else:
                program = ""
    
            try:
                title = response["title"]
            except:
                title = ""
            if title.lower() == program.lower():
                title = ""
    
            if source_element.element is None:
                source_element.element = ""
                for f in ["seasonNumber", "episodeNumber"]:
                    try:
                        title += " " + f[0].upper() + str(int(response[f]))
                    except:
                        pass
    
            source_element.element = get_valid_filename(source_element.element + " " + program + " " + title)
            if source_element.element in ["", None]:
                source_element.element = source_element.url.split("/video/")[-1]
                source_element.element = get_valid_filename(source_element.element)
    
            if source_element.collection is None:
                source_element.collection = join(
                    str(builtins.CONFIG["DOWNLOAD_COMMANDS"]["OUTPUT_MEDIA_PATH"]),
                    goplay_be.__name__
                )
    
            drm_token = None
            try:
                is_drm = response["flags"]["isDrm"]
                assert is_drm
                drm_token = response["drmXml"]
                assert len(drm_token) > 0 and type(drm_token) is str
                is_drm = True
            except:
                is_drm = False
    
            try:
                manifest = response["manifestUrls"]["dash"]
                assert len(manifest) > 0
            except:
                manifest = None
    
            if manifest is None:
                response = response["ssai"]
                response = requests.post(goplay_be.STREAM_URL.format(
                    content_id=response["contentSourceID"],
                    video_id=response["videoID"]
                ))
    
                try:
                    assert 200 <= response.status_code < 300
                    response = response.content.decode()
                    response = json.loads(response)
                except:
                    raise CustomException(ERR_MSG.format(
                        type=f'{USER_ERROR}/{APP_ERROR}',
                        url=source_element.url,
                        reason=f"Dash manifest not found",
                        solution=f"If you can watch the video in browser, then extend the {goplay_be.__name__} service"
                    ))
    
                manifest = response["stream_manifest"]
                if response.get("manifest_format", "dash").lower() not in ["dash", "mpd"]:
                    raise CustomException(ERR_MSG.format(
                        type=APP_ERROR,
                        url=source_element.url,
                        reason=f"Manifest format not supported: {manifest}",
                        solution=f"Extend the {goplay_be.__name__} service"
                    ))
    
            pssh_value = None
            additional = {"drm_token": drm_token}
            mpd_content = None
            if is_drm or builtins.CONFIG.get("BASIC", False) is False:
                mpd_content = requests.get(manifest).content.decode()
    
            if is_drm:
                try:
                    pssh_value = get_pssh_from_cenc_pssh(mpd_content)
                except:
                    pssh_value = None
                if pssh_value is None:
                    raise CustomException(ERR_MSG.format(
                        type=APP_ERROR,
                        url=source_element.url,
                        reason=f"Manifest format not supported: {manifest}",
                        solution=f"Extend the {goplay_be.__name__} service"
                    ))
    
            if builtins.CONFIG.get("BASIC", False) is True:
                return manifest, pssh_value, additional
    
            additional["manifest_url"] = manifest
            try:
                manifest = goplay_be.generate_master_mpd(source_element, mpd_content)
            except:
                raise CustomException(ERR_MSG.format(
                    type=APP_ERROR,
                    url=source_element.url,
                    reason=f"Manifest format not supported: {manifest}",
                    solution=f"Extend the {goplay_be.__name__} service"
                ))
            return manifest, pssh_value, additional
    
        @staticmethod
        def get_label_index(label, label_regex):
            if label is None or len(label) == 0:
                return None
            label = label.lower()
            label = re.sub(r'\s+', ' ', label)
            label = label.replace(' ', "_")
            for r in label_regex:
                try:
                    return int(re.findall(r, label)[0])
                except:
                    pass
            return None
    
        @staticmethod
        def get_collection_elements(collection_url):
            collection_url = clean_url(collection_url)
            if "/live-kijken" in collection_url:
                return None
            if "/video/" in collection_url:
                return [BaseElement(url=collection_url)]
    
            response = requests.get(collection_url)
            response = response.content.decode()
            try:
                collection_title = re.findall(r'<title>([^<>]+)</title>', response)[0]
                collection_title = get_valid_filename(collection_title)
                assert len(collection_title) > 0
            except:
                collection_title = collection_url.split("/")[-1]
            collection_title = join(
                join(
                    str(builtins.CONFIG["DOWNLOAD_COMMANDS"]["OUTPUT_MEDIA_PATH"]),
                    goplay_be.__name__
                ),
                get_valid_filename(collection_title)
            )
    
            videos = []
            visited = []
            for video in re.findall(
                    fr'"([^"]*/video/{collection_url.split("/")[-1]}/[^\\"]+)[\\"]',
                    response
            ):
                if not video.startswith("http"):
                    video = goplay_be.BASE_URL + video
                if video in visited:
                    continue
                visited.append(video)
    
                paths = video.split("/")[-2:]
                season_index = None
                episode_index = goplay_be.get_label_index(
                    label=paths[-1],
                    label_regex=["aflevering-(\\d+)"]
                )
    
                if episode_index is not None:
                    for i in [-1, -2]:
                        season_index = goplay_be.get_label_index(
                            label=paths[i],
                            label_regex=["-s(\\d+)[-/]"]
                        )
                        if season_index is not None:
                            break
                    if season_index is None:
                        episode_index = None
    
                videos.append((video, season_index, episode_index))
    
            extras = [v for v in videos if v[1] is None]
            videos = sorted([v for v in videos if v[1] is not None], key=lambda v: (v[1], v[2]))
            try:
                max_season = max(videos, key=lambda v: v[1])[1] + 1
            except:
                max_season = 1
            extras = [(v[0], max_season, i + 1) for i, v in enumerate(extras)]
    
            collection = []
            for episode_url, season_index, episode_index in videos + extras:
                check = check_range(True, season_index, None)
                if check is True:
                    continue
                elif check is False:
                    return collection
    
                check = check_range(False, season_index, episode_index)
                if check is True:
                    continue
                elif check is False:
                    return collection
    
                season_title = "extras" if season_index == max_season else ""
                collection.append(BaseElement(
                    url=episode_url,
                    collection=join(collection_title, get_valid_filename(f'Season_{season_index} {season_title}')),
                    element=f"Episode_{episode_index}"
                ))
            return collection
    I made sure I was able to see the video in Firefox, so the cookies seem okay as well...?

    (I don't know whether it's possible to make these long code fields collapsable?)
    Last edited by ErikDB; 24th Jun 2025 at 10:16.
    Quote Quote  
  16. Member
    Join Date
    Dec 2024
    Location
    Belgium
    Search Comp PM
    Is it possible to integrate Streamz.be?
    Quote Quote  
  17. @ErikDB
    I don't doubt you double checked and found out by yourself that you accidentally erased line 185 with the following code in the original file:

    Code:
    segment_key = representation.get("@width", representation.get("@audioSamplingRate", None))
    Quote Quote  
  18. Originally Posted by Flippi View Post
    @ErikDB
    I don't doubt you double checked and found out by yourself that you accidentally erased line 185 with the following code in the original file:

    Code:
    segment_key = representation.get("@width", representation.get("@audioSamplingRate", None))
    Thanks for the kind words.

    Now the code doesn't break, but the result is still not satisfactory...
    Code:
    (venv) erik@piholeNASLXC:~/schrapen/widefrog$ python widefrog.py "https://www.goplay.be/video/achter-de-schermen/achter-de-schermen-s5/achter-de-schermen-s5-aflevering-17" --debug
    [INFO] Linux detected. Chosen terminal: gnome-terminal. Chosen shell: bash.
    [INFO] Current app version: 3.2.0
    [INFO] Running on: linux/64bit/python 3.11.2
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    SegmentTimeline or SegmentTemplate not found (using try-except).
    SegmentTimeline or SegmentTemplate not found (using try-except).
    SegmentTimeline or SegmentTemplate not found (using try-except).
    SegmentTimeline or SegmentTemplate not found (using try-except).
    [INFO] Current progress: [1/1]
    [INFO] Finished generating the download commands.
    [INFO] Saved the generated download commands to app_files/cmds.txt
    [INFO] If you used a VPN, turn it off to avoid wasting data for the downloading stage. Also you may edit the app_files/cmds.txt file if necessary. Type yes when ready: yes
    [INFO] Starting the downloading stage.
    # Failed to parse arguments: Cannot open display:
    [INFO] SUCCESS! Finished downloading.
    The last statement is rather misleading.

    Edit: I keep forgetting I have to disable Pi-Hole for Go Play... Now I did, but the script returns the same output. Maybe because it ran into Pi-Hole's wall a minute ago?
    Quote Quote  
  19. Something with vtmgo.be also refuses to work. I made sure I was able to see the video of the link in Firefox...

    Code:
    (venv) erik@piholeNASLXC:~/schrapen/widefrog$ python widefrog.py "https://www.vtmgo.be/vtmgo/afspelen/90f3dd6c-c68b-4a87-8f1b-0b7ce44d1b12" --debug
    [INFO] Linux detected. Chosen terminal: gnome-terminal. Chosen shell: bash.
    [INFO] Current app version: 3.2.0
    [INFO] Running on: linux/64bit/python 3.11.2
    [INFO] Starting the service initialization stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the collections extraction stage.
    [INFO] Current progress: [1/1]
    [INFO] Starting the media data extraction stage.
    Traceback (most recent call last):
      File "/home/erik/schrapen/widefrog/widefrog.py", line 124, in <module>
        main_service.run_service(response)
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 442, in run_service
        dwn_cmds, failed_cmds, proc_cmds = main_service.get_download_commands_parallel(demo_urls)
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 395, in get_download_commands_parallel
        success, fail, proc = future.result()
                              ^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
        return self.__get_result()
               ^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
        raise self._exception
      File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
        result = self.fn(*self.args, **self.kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 281, in get_download_commands
        raise e
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 266, in get_download_commands
        dl_cmds, pr_cmds = main_service.get_download_command(service, source_element)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 84, in get_download_command
        raise e
      File "/home/erik/schrapen/widefrog/utils/main_service.py", line 63, in get_download_command
        manifest, pssh, additional = service.get_video_data(source_element)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/erik/schrapen/widefrog/services/vtmgo_be.py", line 125, in get_video_data
        raise CustomException(ERR_MSG.format(
    utils.structs.CustomException: [USER_ERROR]/[APP_ERROR] Failed to download: https://www.vtmgo.be/vtmgo/afspelen/90f3dd6c-c68b-4a87-8f1b-0b7ce44d1b12. Reason: This content is no longer available or refresh the site cookies or VPN issues (Belgium). Solution: Do not attempt to download it or sign into your account using Firefox and play a random video or fix your VPN. If it persists then debug the service.
    Quote Quote  



Similar Threads

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