VideoHelp Forum
+ Reply to Thread
Page 3 of 3
FirstFirst 1 2 3
Results 61 to 87 of 87
Thread
  1. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Webby123 View Post
    any advice on a script to just grab the MPD token?
    Use httpToolkit or similar and watch the interactions. Then write code to emulate those interactions. A small script maybe - a lot of work making it happen. Good luck.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  2. I tried running this and it just gets stuck. I don't get an error, it just shows this and stays on it:

    ____ ______ _ __ _ __
    / _/ /_ __/ | | / / | |/_/
    _/ / / / | |/ / _> <
    /___/ /_/ |___/ /_/|_|


    An ITVX Video Search, Selector and Downloader.

    I installed everything in requirements.txt. I'm on Python 3.11. I went through the thread but I'm still not sure what the issue is. Am I forgetting something?
    Quote Quote  
  3. Probably best to use Angela's newest tool, the FTA downloader.
    Quote Quote  
  4. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by peterb999 View Post
    Probably best to use Angela's newest tool, the FTA downloader.
    No,I just tested it and it still works.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  5. I tried it on several machines and the only one that didn't have the issue was Linux machines. It has something to do with character encoding or something similar.
    Quote Quote  
  6. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by bobbintb View Post
    I tried it on several machines and the only one that didn't have the issue was Linux machines. It has something to do with character encoding or something similar.
    if you think character encoding is the the issue look through the code and remove the stuff that prints ITVX banner at the start of the program. You say very little of the 'Windows machines' so only very little can be said to help you.

    Try using a windows app called 'Terminal' to run the code.

    edit your code
    Image
    [Attachment 75230 - Click to enlarge]

    remove
    Code:
    title = PF.figlet_format(' I T V X ', font='smslant'
    add
    Code:
    title = 'ITVX'
    I have tested the code; it runs on windows 10 and 11.
    Last edited by A_n_g_e_l_a; 3rd Dec 2023 at 07:43. Reason: added code edit
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  7. Originally Posted by A_n_g_e_l_a View Post
    if you think character encoding is the the issue look through the code and remove the stuff that prints ITVX banner at the start of the program. You say very little of the 'Windows machines' so only very little can be said to help you.

    Try using a windows app called 'Terminal' to run the code.

    edit your code
    Image
    [Attachment 75230 - Click to enlarge]

    remove
    Code:
    title = PF.figlet_format(' I T V X ', font='smslant'
    add
    Code:
    title = 'ITVX'
    I have tested the code; it runs on windows 10 and 11.
    Well, I got past the issue on Linux. My main machine suffered an unrelated hardware issue after I sent the first message so I haven't looked at it in a while (motherboard RMA), which is why my other responses didn't give much information. I was just going off of memory. It had something to do with certain strings or character encoding or one of the packages used that makes the text graphics. I just don't recall. I'll follow up once I get a chance to look at it again. Thanks.
    Quote Quote  
  8. I am getting this error:
    Code:
    Traceback (most recent call last):
      File "/home/user/PycharmProjects/itvx/itv_loader.py", line 254, in <module>
        myITV.download(url)
      File "/home/user/PycharmProjects/itvx/ITVX.py", line 122, in download
        video = data['Playlist']['Video']
    KeyError: 'Playlist'
    Quote Quote  
  9. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by bobbintb View Post
    I am getting this error:
    Code:
    Traceback (most recent call last):
      File "/home/user/PycharmProjects/itvx/itv_loader.py", line 254, in <module>
        myITV.download(url)
      File "/home/user/PycharmProjects/itvx/ITVX.py", line 122, in download
        video = data['Playlist']['Video']
    KeyError: 'Playlist'
    That sort of suggest you are not feeding a url which leads to the videostream. But who can tell?

    Just make sure your url look like this format:- https://www.itv.com/watch/the-winter-king/10a3393/10a3393a0001
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  10. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    I've update the script at post #1. (and here https://files.videohelp.com/u/301890/itv_update_2.zip
    Some apostrophes were sneaking through my traps and breaking the temporary data storage.

    Additionally ITV specials - without a series designated - were failing to download.
    Any specials will be now grouped in S99.

    For UK-FTA users this standalone can be copied into the itv-dl folder as a replacement.
    Last edited by A_n_g_e_l_a; 12th Jan 2024 at 08:33.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  11. Every time thread updates my heart races in hope that the 1080p stream has finally been cracked

    Thank you for this wonderful work.
    Quote Quote  
  12. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by adrian44 View Post
    Every time thread updates my heart races in hope that the 1080p stream has finally been cracked

    Thank you for this wonderful work.
    Thanks Adrian, but don't forget stv.tv carries much of ITV's output in 1080p! And most of it is unencrypted! See my UK-FTA downloader for something similar to this but for STV, or see StabbedBtBrick's Freevine for a more command line type of experience
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  13. Originally Posted by A_n_g_e_l_a View Post
    Thanks Adrian, but don't forget stv.tv carries much of ITV's output in 1080p! And most of it is unencrypted! See my UK-FTA downloader for something similar to this but for STV, or see StabbedBtBrick's Freevine for a more command line type of experience
    Indeed. I use yt-dlp to get stuff from STV, but for some reason their videos are "pale" with less vivid colors compared to other platforms. My best guess is lower bitrate for reduced bandwidth usage.

    Check this composite image for comparison. Exact same frame from ITVx video, STV one, and ABC IView. The color is off on the STV one

    Image
    [Attachment 76164 - Click to enlarge]
    Quote Quote  
  14. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by adrian44 View Post
    My best guess is lower bitrate for reduced bandwidth usage.

    Check this composite image for comparison. Exact same frame from ITVx video, STV one, and ABC IView. The color is off on the STV one
    For series 13 episode 1 of Vera.
    ITV 720p 1931 kbps
    STV 1080p 3713kbps which is close to double the ITV bit-rate.

    Could it be the up-scaling software on your TV/monitor or whatever doing an interpolation that adds to the picture in a manner you like?

    I think STV give me a better picture but it's only a matter of taste. You have the tools to choose whatever suits you best. Happy days!
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  15. Originally Posted by A_n_g_e_l_a View Post

    For series 13 episode 1 of Vera.
    ITV 720p 1931 kbps
    STV 1080p 3713kbps which is close to double the ITV bit-rate.
    Interesting! I'll go compare these and see if I get the same results on my hardware

    Appreciate all you do and keep up the fantastic work.
    Quote Quote  
  16. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    ITV was still defeating the script with the new Vera Series 13 Episode 1 being given a series number by ITV as 'Sun 7 Jan' while I was trapping for series not starting with S! Such episodes are now trapped and filed in series 99 for the time being. I'll keep an eye on ITV to see if this method of labelling becomes more general as indeed it is with STV.

    Also for some reason the series list (1 2 etc) didn't come out sorted - that is now fixed.

    Update at post #1 and here https://files.videohelp.com/u/301890/itv-update_3.zip

    Apologies for posting two updates so close together.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  17. I feel like I'm close to getting this working but trying this with Linux I'm getting

    $ python3 itv_loader.py
    ____ ______ _ __ _ __
    / _/ /_ __/ | | / / | |/_/
    _/ / / / | |/ / _> <
    /___/ /_/ |___/ /_/|_|


    An ITVX Video Search, Selector and Downloader.


    Enter any ITVX url for the series-title to download
    https://www.itv.com/watch/agatha-and-poirot-partners-in-crime/10a0689

    Use up/down keys + spacebar to de-select or re-select videos to download

    Using pywidevine WVD on this machine
    Traceback (most recent call last):
    File "/home/user/Documents/itv-update/itv_loader.py", line 284, in <module>
    myITV.download(url)
    File "/home/user/Documents/itv-update/ITVX.py", line 168, in download
    key = self.get_key(pssh, lic_url)
    File "/home/user/Documents/itv-update/ITVX.py", line 86, in get_key
    device = Device.load(WVD_PATH)
    File "/home/user/.local/lib/python3.10/site-packages/pywidevine/device.py", line 164, in load
    with Path(path).open(mode="rb") as f:
    File "/usr/lib/python3.10/pathlib.py", line 1119, in open
    return self._accessor.open(self, mode, buffering, encoding, errors,
    FileNotFoundError: [Errno 2] No such file or directory: '/home/angela/android_sdk.wvd'

    Gave it a try in Windows as well just in case

    python.exe .\ITVX.py
    ____ ______ _ __ _ __
    / _/ /_ __/ | | / / | |/_/
    _/ / / / | |/ / _> <
    /___/ /_/ |___/ /_/|_|


    A Single ITVX Downloader:


    Enter video url for download.
    https://www.itv.com/watch/agatha-and-poirot-partners-in-crime/10a0689
    Traceback (most recent call last):
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 268, in <module>
    main()
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 260, in main
    myITV.download(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 120, in download
    title, extendtitle, data = self.get_data(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 226, in get_data
    extendtitle = jmespath.search('episode.contentInfo', myjson).replace('.','').replace(',','')
    AttributeError: 'NoneType' object has no attribute 'replace'
    ⣽ Loading...

    Is this failing because it's a one off show and not a TV series?
    Quote Quote  
  18. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Saurbaum View Post
    I feel like I'm close to getting this working but trying this with Linux I'm gettin

    Is this failing because it's a one off show and not a TV series?
    Image
    [Attachment 77114 - Click to enlarge]


    No. It's operator error.

    Code:
    #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    # EDIT Choices here
    
    #Set False for WKS-KEYS use or True for pywidevine
    PYWIDEVINE = True
    # if using pywidevine edit below to your wvd path
    WVD_PATH = "/home/angela/android_sdk.wvd"
    
    # End edit
    #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  19. Looks like here is where my attempts end even with changing the setting. I'll give it up now and leave you in peace

    A Single ITVX Downloader:


    Enter video url for download.
    https://www.itv.com/watch/agatha-and-poirot-partners-in-crime/10a0689
    Traceback (most recent call last):
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 268, in <module>
    main()
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 260, in main
    myITV.download(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 120, in download
    title, extendtitle, data = self.get_data(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 226, in get_data
    extendtitle = jmespath.search('episode.contentInfo', myjson).replace('.','').replace(',','')
    AttributeError: 'NoneType' object has no attribute 'replace'
    ⣽ Loading...
    Quote Quote  
  20. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Saurbaum View Post
    Looks like here is where my attempts end even with changing the setting. I'll give it up now and leave you in peace

    A Single ITVX Downloader:


    Enter video url for download.
    https://www.itv.com/watch/agatha-and-poirot-partners-in-crime/10a0689
    Traceback (most recent call last):
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 268, in <module>
    main()
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 260, in main
    myITV.download(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 120, in download
    title, extendtitle, data = self.get_data(url)
    File "C:\Users\user\Desktop\itv-update\ITVX.py", line 226, in get_data
    extendtitle = jmespath.search('episode.contentInfo', myjson).replace('.','').replace(',','')
    AttributeError: 'NoneType' object has no attribute 'replace'
    ⣽ Loading...
    I'll look in to it.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  21. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    That video did not have an extended title associated with it so the routine looking for it failed.

    edit your version of ITVX.py using a text editor and remove the whole definition for get_data... and replace it with this correction:

    Code:
    def get_data(self, url: str) -> tuple:
                spinner = Spinner(DOTS)
                spinner.start()
                headers={
                'authority': 'www.itv.com',
                'user-agent': 'Dalvik/2.9.8 (Linux; U; Android 9.9.2; ALE-L94 Build/NJHGGF)',
                }
    
                r = self.client.get(url, headers=headers, follow_redirects=True)
                if r.status_code == 200:
                    tree = LexborHTMLParser(r.text)
                    jsondata = tree.root.css_first('#__NEXT_DATA__').text()
                    myjson = json.loads(jsondata)
                    
                    extendtitle = ''  # may not be assigned below
                    myjson =myjson['props']['pageProps']
                    title = jmespath.search("programme.title", myjson)
                    title = title.replace(' ', '_')
                    try:
                        extendtitle = jmespath.search('episode.contentInfo', myjson).replace('.','').replace(',','')
                    except:
                        extendtitle = ''
                        pass
    
                    magni_url = jmespath.search('[ seriesList.[*].titles.[*].playlistUrl , episode.playlistUrl]', myjson)
                    magni_url = (next (item for item in magni_url if item is not None))
                    features = ['mpeg-dash', 'widevine', 'outband-webvtt', 'hd', 'single-track']
                    payload = {
                        'client': {'id': 'browser'},
                        'variantAvailability': {
                            'featureset': {'min': features, 'max': features},
                            'platformTag': 'dotcom',
                        }
                    }
                    r = self.client.post(magni_url, json=payload)
                    spinner.stop()
                    return title, extendtitle, r.json()
                else:
                    print(f"The response code {r.status_code} did not indicate successs!")
                    print(f"The web page content returned was:-\n\n {r.content}\n\nExiting!")
                    print(f"Be sure to copy a page url for a playable video ")
                    exit(1)
    For some reason for thuis url (https://www.itv.com/watch/agatha-and-poirot-partners-in-crime/10a0689) it is important to run ITVX.py as a surrogate. So be sure to call itv_loader.py and feed that with your itv link url.
    Last edited by A_n_g_e_l_a; 18th Feb 2024 at 15:21.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  22. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    I've updated the link to point to new version 4 in the first post for this thread. An occasional single one-off failed to load for lack of expected data. Also the title fails to load using ITVX.py as a stand-alone downloader, but using the pre-selector - itv_loader.py - which itself calls ITVX.py, everything works fine.
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  23. Member
    Join Date
    Mar 2024
    Location
    New Zealand
    Search PM
    Unfortunately the code exits with an error:
    Code:
    Traceback (most recent call last):
      File "itv_loader.py", line 284, in <module>
        myITV.download(url)
      File "/mnt/c/Users/mlevene/src/itvx/itv-update/ITVX.py", line 122, in download
        video = data['Playlist']['Video']
    KeyError: 'Playlist'
    Looking into the code and outputting some variables, I get a data dictionary:
    Code:
    data={'Message': 'Request Originated Outside Of Allowed Geographic Region'}
    Perhaps at line 121 of ITVX.py it could gracefully exit in this circumstance with the contents of 'Message' to be more informative??

    Thanks for your work.
    Last edited by markfromnz; 3rd Mar 2024 at 16:28.
    Quote Quote  
  24. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by markfromnz View Post
    Unfortunately the code exists with an erro

    Perhaps at line 121 of ITVX.py it could gracefully exit in this circumstance with the contents of 'Message' to be more informative??

    .

    VPN not working?
    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  25. Member
    Join Date
    Mar 2024
    Location
    New Zealand
    Search PM
    Sorry ... that should have said "exits", not "exists".

    And VPN wasn't up, but it would still be nice to gracefully exit with the returned message

    (Just my 2c worth)
    Quote Quote  
  26. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by markfromnz View Post
    Sorry ... that should have said "exits", not "exists".

    And VPN wasn't up, but it would still be nice to gracefully exit with the returned message

    (Just my 2c worth)
    Ok, Mark from NZ, here's how it works. I post scripts I wrote for me. I only post them when they seemingly work as intended - in this case for UK users. If they work for you - great! If they don't work for you - tough! You think I have some responsibility for how you use my script? Get real!
    If you see something that needs changing - well, its a script - you edit it yourself, Sunshine. I have better things to do with my life.
    If you cannot do that right now, then you learn how, just as I did.
    (just my 2p worth)

    Do not PM me please. Just ask your question here!
    https://forum.videohelp.com/threads/413534-From-My-Postbox
    Quote Quote  
  27. Member
    Join Date
    Mar 2024
    Location
    New Zealand
    Search PM
    Ouch ...

    I thought I was helping by feeding back ... but obviously not.

    As I said, thank you for your work, which I can happily modify for my environment.
    Quote Quote  



Similar Threads

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