VideoHelp Forum


Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!


Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.


+ Reply to Thread
Results 1 to 15 of 15
Thread
  1. Hello I'm trying a way to add this free italian channel on my ott nav playlist.

    https://www.discoveryplus.com/it/channel/nove?pc=311

    the issue I'm facing (sorry if I'm a noob I'm seriously willing to learn) is that the url expires each 24h I believe so I have to manually retrieve it each time and add it again into the playlist. Is there a way to make OTT nav automatically retrieve the url without having to add it every 24h?

    Thanks in advance for your help and sorry again if th question is too NOOBish.
    Quote Quote  
  2. Find mpd link
    this is the key
    Code:
    76933515b27b4ae285f1d976d1e19e75:ab21b257363af1b93d50f653b4a8e1df
    OTT SCRIPT
    save with .m3u extension

    Code:
    #EXTM3U
    #EXTINF:-1 ,CHANNEL NAME
    #KODIPROP:inputstream.adaptive.license_type=clearkey
    #KODIPROP:inputstream.adaptive.license_key=76933515b27b4ae285f1d976d1e19e75:ab21b257363af1b93d50f653b4a8e1df
    mpd_link
    Quote Quote  
  3. i think he dont need the key, he just want a script/method to auto generate mpd or mpd token from its api.
    Quote Quote  
  4. Originally Posted by shellcmd View Post
    i think he dont need the key, he just want a script/method to auto generate mpd or mpd token from its api.

    ohh i see
    i think build own php script in replit could help
    Quote Quote  
  5. Originally Posted by jckzz View Post
    Originally Posted by shellcmd View Post
    i think he dont need the key, he just want a script/method to auto generate mpd or mpd token from its api.

    ohh i see
    i think build own php script in replit could help
    may someone point me in a thread or website which I can learn how to do it? Or someone can guide me? I can pay for that.
    Quote Quote  
  6. Originally Posted by jckzz View Post
    Find mpd link
    this is the key
    Code:
    76933515b27b4ae285f1d976d1e19e75:ab21b257363af1b93d50f653b4a8e1df
    OTT SCRIPT
    save with .m3u extension

    Code:
    #EXTM3U
    #EXTINF:-1 ,CHANNEL NAME
    #KODIPROP:inputstream.adaptive.license_type=clearkey
    #KODIPROP:inputstream.adaptive.license_key=76933515b27b4ae285f1d976d1e19e75:ab21b257363af1b93d50f653b4a8e1df
    mpd_link
    Thanks for the answer sir. I already had all this and I could successfully retrieve the key. I'm struggling now in creating the script with replit or chatgpt since I'm sure I have some parts missing and I'm still not getting how this all works to retrieve a mpd url thorugh a script and then make it work automatically with ott navigator.
    Quote Quote  
  7. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Code:
    import json
    from urllib.parse import urlparse, parse_qs
    
    import requests
    
    GLOBAL_API = 'https://global-prod.disco-api.com/bootstrapInfo'
    ST_COOKIE = "<ST_COOKIE>"
    
    
    def get_base_api_url():
        return json.loads(
            requests.get(GLOBAL_API, headers={
                'x-disco-client': '0:0:0:0',
                'x-disco-params': 'bid=dplus',
            }).content.decode()
        )["data"]["attributes"]["baseApiUrl"]
    
    
    BASE_API_URL = get_base_api_url()
    
    
    def get_mpd(input_url):
        response_json = json.loads(requests.post(
            BASE_API_URL + '/playback/v3/channelPlaybackInfo',
            cookies={'st': ST_COOKIE},
            json={
                'channelId': parse_qs(urlparse(input_url).query).get("pc")[0],
                'wisteriaProperties': {'device': {'browser': {'name': 'chrome'}}},
                'deviceInfo': {'adBlocker': False}
            }
        ).content.decode())
    
        mpd_urls = []
        for u in response_json["data"]["attributes"]["streaming"]:
            mpd_urls += [u["url"]]
        return mpd_urls
    
    
    print(get_mpd("https://www.discoveryplus.com/it/channel/nove?pc=311"))
    Grab the st value from the cookies. Only the st one, the rest of the cookies are irrelevant. I don't know if the lifetime of a cookie is better than that of the mpd URL. So if it's not good, you need to find a way to grab those cookies programmatically. Don't ask me how. ¯\_(ツ)_/¯
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  8. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Alright. Turns out it was relatively easy due to their neat API. You can actually get the token yourself which is nice. This is the final script. Was fun to figure it out.

    Code:
    import json
    from urllib.parse import urlparse, parse_qs
    
    import requests
    
    GLOBAL_API = 'https://global-prod.disco-api.com/bootstrapInfo'
    
    
    def get_base_api_url():
        return json.loads(requests.get(GLOBAL_API, headers={
            'x-disco-client': '0:0:0:0',
            'x-disco-params': 'bid=dplus'
        }).content.decode())["data"]["attributes"]["baseApiUrl"]
    
    
    def get_st():
        return json.loads(requests.get(BASE_API_URL + '/token', params={
            'realm': 'dplay',
            'shortlived': 'false',
            'deviceId': 'deviceId'
        }).content.decode())["data"]["attributes"]["token"]
    
    
    BASE_API_URL = get_base_api_url()
    ST_COOKIE = get_st()
    
    
    def get_mpd(input_url):
        response_json = json.loads(requests.post(
            BASE_API_URL + '/playback/v3/channelPlaybackInfo',
            cookies={'st': ST_COOKIE},
            json={
                'channelId': parse_qs(urlparse(input_url).query).get("pc")[0],
                'wisteriaProperties': {'device': {'browser': {'name': 'chrome'}}},
                'deviceInfo': {'adBlocker': False}
            }
        ).content.decode())
    
        mpd_urls = []
        for u in response_json["data"]["attributes"]["streaming"]:
            mpd_urls += [u["url"]]
        return mpd_urls
    
    
    print(get_mpd("https://www.discoveryplus.com/it/channel/nove?pc=311"))
    print(get_mpd("https://www.discoveryplus.com/it/channel/nove?pc=312"))
    Whatever way you incorporate this into your stuff, is entirely up to you and you're on your own.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 5th Mar 2024 at 15:52.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  9. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Alright. Turns out it was relatively easy due to their neat API. You can actually get the token yourself which is nice. This is the final script. Was fun to figure it out.

    Whatever way you incorporate this into your stuff, is entirely up to you and you're on your own.
    Mate, thanks a ot for your kind answer. As always you are really helpful and exhaustive in your answers. I will study the code and try to understand where I was lacking info. You helped me so much, a true gentleman.
    i will find a way to incorporate it in ott nav and try to apply this to other channels and in the future my goal is to create my own personal script
    Quote Quote  
  10. To make it work for me I had to replace with this part

    HTML Code:
    def get_base_api_url():
        return json.loads(requests.get(GLOBAL_API, headers={
          'x-disco-client': 'WEB:UNKNOWN:dplus_us:2.39.1',
          'x-disco-params': 'bid=dplus,hn=www.discoveryplus.com,hth=it',
        }).content.decode())["data"]["attributes"]["baseApiUrl"]
    Quote Quote  
  11. Ok I've successfully converted the script to PHP and it works properly.

    Now I'm trying to add it to OTT Navigator to make it retrieve the URL automatically.

    I'm trying this method but it doesn't seem to work. Is there something wrong? The player (which is based on exoplayer I think) it doesn't seem to retrieve the url from the script. I already made sure that the script returns a proper working link with no brackets or commas. Any ideas?

    Code:
    #EXTINF:-1 group-title="*" tvg-logo="*" tvg-id="*",Channel Name
    #KODIPROP:inputstream.adaptive.license_type=org.w3.clearkey
    #KODIPROP:inputstream.adaptive.license_key=kid_key
    https://0.0.0.0/myscript.php
    Quote Quote  
  12. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Alright. Turns out it was relatively easy due to their neat API. You can actually get the token yourself which is nice. This is the final script. Was fun to figure it out.
    Hi mate sorry for bothering you again,
    May you please explain how did you figure that out?

    I'm missing this part
    Code:
     def get_st():
        return json.loads(requests.get(BASE_API_URL + '/token', params={
            'realm': 'dplay',
            'shortlived': 'false',
            'deviceId': 'deviceId'
        }).content.decode())["data"]["attributes"]["token"]
    How did you see the endpoint BASE_API_URL + '/token'?

    I'm trying to study their API but i don't see any token attribute?
    Quote Quote  
  13. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Originally Posted by Stoc View Post
    I'm trying to study their API but i don't see any token attribute?
    That token value is kept as a cookie. Naturally, because you can access that video without an account, it means that the endpoint token must be called at most once. Keyword, at most once, because it is kept as a cookie so that the next time you access that page, the endpoint isn't called anymore. So open incognito on an empty tab, open inspect network requests, and access that page. You will see the token endpoint called only once. The next time you refresh the page, it's gone.
    Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 9th Mar 2024 at 06:34.
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  
  14. Member
    Join Date
    Sep 2024
    Location
    Italy
    Search Comp PM
    Does anyone know how to modify the script for links like:

    https://www.discoveryplus.com/it/video/chissa-chi-e/stagione-1-episodio-1

    From Firefox's Web Developer Tools (F12) it follow that

    channelId = 311
    videoId = 7523412

    and a mpd url like to this

    https://dplus-it-cloudfront.prod-vod.h264.io/s/eu-west-1/v1/playlist/dash/5d132ad5-142...pm5LIyUDKWkgI=

    but I couldn't find how to change the requests.post() to get it.
    Quote Quote  
  15. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    That script is old and meant for /channel links. For a good discoveryplus script, use devine. I don't have access to discovery and can't edit the script anyway
    --[----->+<]>.++++++++++++.---.--------.
    [*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*]
    Quote Quote  



Similar Threads

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