VideoHelp Forum
+ Reply to Thread
Page 2 of 8
FirstFirst 1 2 3 4 ... LastLast
Results 31 to 60 of 217
Thread
  1. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by ringy9 View Post
    Got a heap of code this time
    OK so something is probably happening with your clipboard.

    edit your script bestITVX.py

    Find the function def main() near the bottom and comment it out put three ellipses ''' at the start of the definition on a blank line and three ellipses ''' at the end.
    When the code runs that bit will not be read.
    it will look like this-
    Code:
    '''def main() -> int:
        input("Press enter with urls in clipboard ")
        urls = PC.paste().split('\n')   
        for url in urls:
            ITV().download(url)
        return 0
        '''
    Replace that unread function code with this:
    Code:
    def main() -> int:
        url = input("Enter a single url \n")
        ITV().download(url)
        return 0
    This will allow a SINGLE url to be pasted as input and you can see if it will download. It is now looking like clipboard copy isn't behaving for you. I wonder do you use multiple languages on your machine?
    Last edited by A_n_g_e_l_a; 25th Jun 2023 at 08:56.
    Quote Quote  
  2. Member
    Join Date
    Mar 2023
    Location
    Australia
    Search Comp PM
    Code:
    C:\ffmpeg\bin>bestITVX.py
    Enter a single url
    https://www.itv.com/watch/ruby-speaking/10a3377/10a3377a0001
    Traceback (most recent call last):
      File "C:\ffmpeg\bin\bestITVX.py", line 174, in <module>
        main()
      File "C:\ffmpeg\bin\bestITVX.py", line 168, in main
        ITV().download(url)
      File "C:\ffmpeg\bin\bestITVX.py", line 50, in download
        video = data['Playlist']['Video']
    KeyError: 'Playlist'
    Quote Quote  
  3. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by ringy9 View Post
    Code:
    C:\ffmpeg\bin>bestITVX.py
    Enter a single url
    https://www.itv.com/watch/ruby-speaking/10a3377/10a3377a0001
    Traceback (most recent call last):
      File "C:\ffmpeg\bin\bestITVX.py", line 174, in <module>
        main()
      File "C:\ffmpeg\bin\bestITVX.py", line 168, in main
        ITV().download(url)
      File "C:\ffmpeg\bin\bestITVX.py", line 50, in download
        video = data['Playlist']['Video']
    KeyError: 'Playlist'
    It is not downloading anything. The variable data does not contain what it should. I tested that altered def main() and know it works as a single download.
    On balance I think it is probably a VPN issue. Possibly intermittent as you got a response with qtest.py. Try your VPN provider. Sorry, I'm stuck.
    Quote Quote  
  4. Member
    Join Date
    Mar 2023
    Location
    Australia
    Search Comp PM
    @Angela just want to check that this changed piece of code looks right to you
    Code:
    '''def main() -> int:
        input("Press enter when urls in clipboard ")
        urls = PC.paste().split('\n')
            for url in urls:
            ITV().download(url)
        return 0
        '''
    def main() -> int:
        url = input("Enter a single url \n")
        ITV().download(url)
        return 0
    Quote Quote  
  5. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by ringy9 View Post
    @Angela just want to check that this changed piece of code looks right to you
    Yes.
    Quote Quote  
  6. Debbie akduyurye's Avatar
    Join Date
    Jun 2023
    Location
    Knightsbridge, UK
    Search Comp PM
    Oh dear, it appears as though poor Angela's code has claimed more victims.

    I can only imagine the endless hours one would waste attempting to decipher her nonsensical creations.
    It may be time for her to consider another career path, perhaps in the art of tea-pouring or glove-wearing, where her lackluster abilities may be better suited.
    Quote Quote  
  7. Please try to exercise this old adage

    If you can't say something nice, don't say anything at all.



    As you are well aware, the forum is called videohelp, not videocriticize


    Regards
    Quote Quote  
  8. Well this is truly spectacular, as we have come to expect from A_n_g_e_l_a.

    I managed to get it to work.

    Can this be hacked to get the 1080p video, or no?
    Quote Quote  
  9. Member
    Join Date
    Dec 2020
    Location
    Croatia
    Search PM
    Originally Posted by genericeddie View Post
    Can this be hacked to get the 1080p video, or no?
    you can do anything with the right inputs, the problem is in figuring out what they are
    Quote Quote  
  10. Member
    Join Date
    Mar 2023
    Location
    Australia
    Search Comp PM
    So in my previous threads I was trying @Angelas bestITVX downloader an kept getting the error: ERROR: SSLV3_ALERT_HANDSHAKE_FAILURE and the thought was that it was probably down to my crappy VPN. I spent a bit of time googleing for some soloutions and came across a post on stack overflow from Steffen Ullrich which in part is as follows:
    Python 3.10 increased the default security settings of the TLS stack by among other things prohibiting any ciphers which still use the RSA key exchange. RSA key exchange is long considered inferior since it does not provide forward secrecy and is therefore also no longer available in TLS 1.3. So in general the change in Python 3.10 can be considered an improvement. But, some servers still require this obsolete key exchange. Connecting to such servers with the newly hardened TLS settings will now fail, even if it succeeded with older versions of Python.
    Long story short, I downgraded my Python back to version 9.9, tried the script again, and things started to work. I will admit that it didn't download all episodes first try, but with a little patience I managed to get what I wanted.

    All I can say is kudos to Angela and all the other kind people who have helped me on this forum. Cheers!
    Quote Quote  
  11. Should we worry about watermarking on files downloaded from ITV.com?

    Is it safe to share them without worrying it could be tracked back to our IP/email address?
    Quote Quote  
  12. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by genericeddie View Post
    Should we worry about watermarking on files downloaded from ITV.com?

    Is it safe to share them without worrying it could be tracked back to our IP/email address?
    Watermark? Who knows. BUT your IP address will be recorded as getting decryption keys at cdrm-project.com if you use the script directly. I do not use their service. If you have your own CDM you can comment out and uncomment other sections in the script to suit your local CDM, (if you have one), so any key getting interactions will be appear normal to the license server.

    However, if you 'share' and take money for the service you will be a target of anti-piracy actors.
    Quote Quote  
  13. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    I've updated the script in the first post.
    1. Some programs on ITVX - such as these https://www.itv.com/watch/inspector-morse/MORSE/916074 all carry the same video title, here, in this case, "Inspector Morse". To prevent over-writing earlier downloads there is an option to add an index number at the start of the video name.
    2. The way this program was originally constructed it created a new class ITV at each attempt to download a video. That was wasteful of resources. A Singleton is now used. Still over-kill I know but i just wanted to explore using singletons in Python
    3. Filtering out nuisance characters from video names that break the program has been improved. "*'%$!(),:;-" are removed, plus '&' becomes 'and'.
    4. There are two def _get_keys() methods one uses your own CDM the other a remote CDM. The remote CDM is configured; read the program and comment out the one not needed.
    5. The program uses httpx which is a modern fast python module to fetch over http(s). By default it has rather a quick time-out if the connection does not respond soon enough.
      This has been changed to 60s for connect and 10s subsequent traffic.
    Last edited by A_n_g_e_l_a; 2nd Jul 2023 at 09:55. Reason: Edited timeout changes
    Quote Quote  
  14. Member
    Join Date
    May 2023
    Location
    England
    Search Comp PM
    Just a suggestion: instead of the extra prompt for indexing, the script could check for the calculated output file's existence with (Googling here) os.path.isfile, automatically adding a number to the output name if it does (and re-checking as necessary with incrementing numbers).
    Quote Quote  
  15. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by PhilipG View Post
    Just a suggestion: instead of the extra prompt for indexing, the script could check for the calculated output file's existence with (Googling here) os.path.isfile, automatically adding a number to the output name if it does (and re-checking as necessary with incrementing numbers).
    Yes it could. And if you need that then that's for you to add, but it would mean a slower program doing all those file lookups - whether necessary or not. For me, a double Enter is good enough to set the program going, except when I know I need an index number. And you know by looking at the tab title; if there is no series or episode and it is not a one off video you'll need a Y to start.
    Quote Quote  
  16. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    ITVX made some changes to their back-end this weekend and the original script parsing ITVX's webpage failed. Also CDRM=Project has died.

    I have updated the script in the first post.
    It now works fetching keys from https://keysdb.net/
    Quote Quote  
  17. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Thanks for this, do you have some newb instructions on how to install and use this on Windows though? I've installed python and then some additional modules but I've got as far as this

    ModuleNotFoundError: No module named 'pywidevine.L3'

    I added the pywidevine module before that, but there isn't one called pywidevine.L3?
    Quote Quote  
  18. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Killer3737 View Post
    Thanks for this, do you have some newb instructions on how to install and use this on Windows though? I've installed python and then some additional modules but I've got as far as this

    ModuleNotFoundError: No module named 'pywidevine.L3'

    I added the pywidevine module before that, but there isn't one called pywidevine.L3?
    I've just this moment updated my first post's code and it will use a remote CDM by choice. There is a setting REMOTE to set to True (as is now) or False you want to use your own CDM
    If you use it as configured you can put a '#' hash in front of the two lines in quotes below and it will stop the script reading them.

    Your problem is most likely a pywidevine/WKS-KEYS tussle. If you've installed python pywidewine then the paths
    pywidevine.L3.cdm import deviceconfig
    pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt
    may not be found.

    If you are using WKS-KEYS as Temple of Doom suggests then unfortunately there are 'varieties' of WKS-KEYS around all with different variations of the path above.
    What 'pywidevine.L3.cdm import deviceconfig' means is that python script expects there to be:-
    EITHER a folder called pywidevine->sub-folder L3 -> sub-folder cdm inside which if a file deviceconfig.py
    OR a folder in the python libraries ($PATH) called pywidevine with the same sub-folders. But the python pywidewine doesn't have L3 whereas WKS-KEYS pywidevine has.

    Now Python is clever enough to work out which you mean. If in the folder where you are running the script from it finds a path pywidevine->sub-folder L3 -> sub-folder cdm -> deviceconfig.py it will use that, other wise it will look in the library version.

    All my scripts assume the user has WKS-KEYS setup and the script is being run from inside the WKS-KEYS folder

    Now the only gotcha is you need to check your WKS-KEYS has pyvidevine/L3/cdm if not make sure you correct that with a file-manager and create or rename folders.
    AND the last piece of housekeeping is to signal to python that it can expect to find something useful in the folder or the next one down if it is empty. THIS IS IMPORTANT - make sure in each folder down to deviceconfig.py there is an __init__.py file (that's double underscore init double underscore dot py . It only needs to be an empty file. Create it with file manager or 'touch __init__.py' from a command window. And then do the same for the other path to WvDecrypt.

    If I've confused you enough it is time to stop.
    Last edited by A_n_g_e_l_a; 13th Jul 2023 at 10:22.
    Quote Quote  
  19. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by Killer3737 View Post
    Thanks for this, do you have some newb instructions on how to install and use this on Windows though? I've installed python and then some additional modules but I've got as far as this

    ModuleNotFoundError: No module named 'pywidevine.L3'

    I added the pywidevine module before that, but there isn't one called pywidevine.L3?
    I've just this moment updated my first post's code and it will use a remote CDM by choice. There is a setting REMOTE to set to True (as is now) or False you want to use your own CDM
    If you use it as configured you can put a '#' hash in front of the two lines in quotes below and it will stop the script reading them.

    Your problem is most likely a pywidevine/WKS-KEYS tussle. If you've installed python pywidewine then the paths
    pywidevine.L3.cdm import deviceconfig
    pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt
    may not be found.

    If you are using WKS-KEYS as Temple of Doom suggests then unfortunately there are 'varieties' of WKS-KEYS around all with different variations of the path above.
    What 'pywidevine.L3.cdm import deviceconfig' means is that python script expects there to be:-
    EITHER a folder called pywidevine->sub-folder L3 -> sub-folder cdm inside which if a file deviceconfig.py
    OR a folder in the python libraries ($PATH) called pywidevine with the same sub-folders. But the python pywidewine doesn't have L3 whereas WKS-KEYS pywidevine has.

    Now Python is clever enough to work out which you mean. If in the folder where you are running the script from it finds a path pywidevine->sub-folder L3 -> sub-folder cdm -> deviceconfig.py it will use that, other wise it will look in the library version.

    All my scripts assume the user has WKS-KEYS setup and the script is being run from inside the WKS-KEYS folder

    Now the only gotcha is you need to check your WKS-KEYS has pyvidevine/L3/cdm if not make sure you correct that with a file-manager and create or rename folders.
    AND the last piece of housekeeping is to signal to python that it can expect to find something useful in the folder or the next one down if it is empty. THIS IS IMPORTANT - make sure in each folder down to deviceconfig.py there is an __init__.py file (that's double underscore init double underscore dot py . It only needs to be an empty file. Create it with file manager or 'touch __init__.py' from a command window. And then do the same for the other path to WvDecrypt.

    If I've confused you enough it is time to stop.
    Thanks. I think I've followed, but now I'm getting the same issue someone else earlier in the thread did.

    httpx.InvalidURL: Invalid non-printable ASCII character in URL.

    I'm using Windows with Powershell 7.3.5. My clipboard is just the list of ITVX URLs.

    EDIT: Seems it may be the CR LF end of line?
    Quote Quote  
  20. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Killer3737 View Post

    httpx.InvalidURL: Invalid non-printable ASCII character in URL.
    Give me an example URL? But before you do try again - I've added a trap for unwanted characters.
    Last edited by A_n_g_e_l_a; 13th Jul 2023 at 10:59.
    Quote Quote  
  21. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by Killer3737 View Post

    httpx.InvalidURL: Invalid non-printable ASCII character in URL.
    Give me an example URL?
    See my edit, it was the CR LF Windows line ending. Converted to Unix LF ending and that error was gone, but replaced with a new one.

    Code:
    Traceback (most recent call last):
      File "D:\AV_Edit_Tools\itvx_downloader\WKS-KEYS\itvx.py", line 273, in <module>
        main()
      File "D:\AV_Edit_Tools\itvx_downloader\WKS-KEYS\itvx.py", line 267, in main
        myITV.download(url)
      File "D:\AV_Edit_Tools\itvx_downloader\WKS-KEYS\itvx.py", line 148, in download
        subprocess.run([
      File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 548, in run
        with Popen(*popenargs, **kwargs) as process:
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
        self._execute_child(args, executable, preexec_fn, close_fds,
      File "C:\Users\x\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
        hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    FileNotFoundError: [WinError 2] The system cannot find the file specified
    Which file is it saying it can't find? C:\Users\x\AppData\Local\Programs\Python\Python311 \Lib\subprocess.py is present.
    Quote Quote  
  22. Member
    Join Date
    Oct 2022
    Location
    Behind You
    Search PM
    .-
    Last edited by Magicians; 13th Jul 2023 at 11:31. Reason: Misread. smoked too much weed.
    I help all that ask.
    Telegram: https://t.me/MagicianNulled
    Quote Quote  
  23. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by Killer3737 View Post

    subprocess.py is present.
    but subprocess cannot find N_m3u8DL-RE add .exe to the name in the script and if it is in your windows path it should work.

    Otherwise add a copy of N-m3u8DL-RE.exe to the folder where the script is.

    In the same way you will have to rename mkvmerge to mkvmerge.exe - these comments are in the script if you read it.

    I've corrected the script for windows ascii unprintables - Linux doesn't have the issue.
    Last edited by A_n_g_e_l_a; 13th Jul 2023 at 12:03.
    Quote Quote  
  24. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by A_n_g_e_l_a View Post
    Originally Posted by Killer3737 View Post

    subprocess.py is present.
    but subprocess cannot find N_m3u8DL-RE add .exe to the name in the script and if it is in your windows path it should work.

    Otherwise add a copy of N-m3u8DL-RE.exe to the folder where the script is.

    In the same way you will have to rename mkvmerge to mkvmerge.exe - these comments are in the script if you read it.

    I've corrected the script for windows ascii unprintables - Linux doesn't have the issue.
    Ah, I'd done that but then I realised you don't need the .exe when it's in your PATH.

    Maybe should add that note, only need to add the .EXE if you're just dumping them in the same folder.

    All working now, thanks.
    Quote Quote  
  25. Member
    Join Date
    Jul 2023
    Location
    The ninth level
    Search PM
    I am trying to download this using the script in the first post but I had to comment out the following lines as i was getting the error "ModuleNotFoundError: No module named 'pywidevine.L3"

    #from pywidevine.L3.cdm import deviceconfig
    #from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt

    When I use the url as captured by the Streamdetector

    https://www.itv.com/watch/king-of-the-roads/2a5089/2a5089a0062

    I get the following shown in the CMD window

    Image
    [Attachment 72810 - Click to enlarge]


    Can anyone help me out as I have no clue.
    Quote Quote  
  26. Member
    Join Date
    Oct 2022
    Location
    Behind You
    Search PM
    Originally Posted by day69walker View Post
    I am trying to download this using the script in the first post but I had to comment out the following lines as i was getting the error "ModuleNotFoundError: No module named 'pywidevine.L3"

    #from pywidevine.L3.cdm import deviceconfig
    #from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt

    When I use the url as captured by the Streamdetector

    https://www.itv.com/watch/king-of-the-roads/2a5089/2a5089a0062

    I get the following shown in the CMD window

    Image
    [Attachment 72810 - Click to enlarge]


    Can anyone help me out as I have no clue.
    Its trying to execute something you dont have installed. Install all requirements.
    I help all that ask.
    Telegram: https://t.me/MagicianNulled
    Quote Quote  
  27. Member
    Join Date
    Jul 2023
    Location
    The ninth level
    Search PM
    Originally Posted by Magicians View Post
    Its trying to execute something you dont have installed. Install all requirements.
    Thanks for your reply but I thought I have installed all the requirements. When I ran the script it complained regarding modules that were missing so I installed these until it only then complained about the "ModuleNotFoundError: No module named 'pywidevine.L3" so I commented out the lines as follows as instructed by A_n_g_e_l_a in a previous post where somebody else was getting the error.

    #from pywidevine.L3.cdm import deviceconfig
    #from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt

    So I assumed that this was OK. If I do need this module where do I get this from? I was installing the previous modules using

    py -m pip install "SomeProject"

    As I had commented out the lines above I assumed that I was using the original script as configured (the code in the first post) so do I in fact need to uncomment those lines and ensure that I have the folders set up as indicated below in a further quotes from the same post by A_n_g_e_l_a?

    If you are using WKS-KEYS as Temple of Doom suggests then unfortunately there are 'varieties' of WKS-KEYS around all with different variations of the path above.
    What 'pywidevine.L3.cdm import deviceconfig' means is that python script expects there to be:-
    EITHER a folder called pywidevine->sub-folder L3 -> sub-folder cdm inside which if a file deviceconfig.py
    OR a folder in the python libraries ($PATH) called pywidevine with the same sub-folders. But the python pywidewine doesn't have L3 whereas WKS-KEYS pywidevine has.

    Now Python is clever enough to work out which you mean. If in the folder where you are running the script from it finds a path pywidevine->sub-folder L3 -> sub-folder cdm -> deviceconfig.py it will use that, other wise it will look in the library version.

    All my scripts assume the user has WKS-KEYS setup and the script is being run from inside the WKS-KEYS folder

    Now the only gotcha is you need to check your WKS-KEYS has pyvidevine/L3/cdm if not make sure you correct that with a file-manager and create or rename folders.
    AND the last piece of housekeeping is to signal to python that it can expect to find something useful in the folder or the next one down if it is empty. THIS IS IMPORTANT - make sure in each folder down to deviceconfig.py there is an __init__.py file (that's double underscore init double underscore dot py . It only needs to be an empty file. Create it with file manager or 'touch __init__.py' from a command window. And then do the same for the other path to WvDecrypt.
    Sorry if these seem basic questions but this is my first time using python so I am new to all of this.
    Quote Quote  
  28. Member
    Join Date
    Oct 2022
    Location
    Behind You
    Search PM
    Originally Posted by day69walker View Post
    Originally Posted by Magicians View Post
    Its trying to execute something you dont have installed. Install all requirements.
    Thanks for your reply but I thought I have installed all the requirements. When I ran the script it complained regarding modules that were missing so I installed these until it only then complained about the "ModuleNotFoundError: No module named 'pywidevine.L3" so I commented out the lines as follows as instructed by A_n_g_e_l_a in a previous post where somebody else was getting the error.

    #from pywidevine.L3.cdm import deviceconfig
    #from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt

    So I assumed that this was OK. If I do need this module where do I get this from? I was installing the previous modules using

    py -m pip install "SomeProject"

    As I had commented out the lines above I assumed that I was using the original script as configured (the code in the first post) so do I in fact need to uncomment those lines and ensure that I have the folders set up as indicated below in a further quotes from the same post by A_n_g_e_l_a?

    If you are using WKS-KEYS as Temple of Doom suggests then unfortunately there are 'varieties' of WKS-KEYS around all with different variations of the path above.
    What 'pywidevine.L3.cdm import deviceconfig' means is that python script expects there to be:-
    EITHER a folder called pywidevine->sub-folder L3 -> sub-folder cdm inside which if a file deviceconfig.py
    OR a folder in the python libraries ($PATH) called pywidevine with the same sub-folders. But the python pywidewine doesn't have L3 whereas WKS-KEYS pywidevine has.

    Now Python is clever enough to work out which you mean. If in the folder where you are running the script from it finds a path pywidevine->sub-folder L3 -> sub-folder cdm -> deviceconfig.py it will use that, other wise it will look in the library version.

    All my scripts assume the user has WKS-KEYS setup and the script is being run from inside the WKS-KEYS folder

    Now the only gotcha is you need to check your WKS-KEYS has pyvidevine/L3/cdm if not make sure you correct that with a file-manager and create or rename folders.
    AND the last piece of housekeeping is to signal to python that it can expect to find something useful in the folder or the next one down if it is empty. THIS IS IMPORTANT - make sure in each folder down to deviceconfig.py there is an __init__.py file (that's double underscore init double underscore dot py . It only needs to be an empty file. Create it with file manager or 'touch __init__.py' from a command window. And then do the same for the other path to WvDecrypt.
    Sorry if these seem basic questions but this is my first time using python so I am new to all of this.
    Your exact error was already solved once on this exact thread and page.
    I help all that ask.
    Telegram: https://t.me/MagicianNulled
    Quote Quote  
  29. Member
    Join Date
    Feb 2022
    Location
    Search the forum first!
    Search PM
    Originally Posted by day69walker View Post
    I am trying to download this using the script in the first post but I had to comment out the following lines as i was getting the error "ModuleNotFoundError: No module named 'pywidevine.L3"

    #from pywidevine.L3.cdm import deviceconfig
    #from pywidevine.L3.decrypt.wvdecryptcustom import WvDecrypt


    Can anyone help me out as I have no clue.
    Bernard,
    You apparently you do not have a CDM and are using the remote one to get keys - which worked. Commenting out the calls to load your non-existent local CDM is the correct thing to do.

    I have found since posting the script that Windows has trouble with a subtitle conversion program called tt - there are instructions in the code to install it "pip install --pre ttconv" but when testing on a Windows Virtual machine the conversion didn't work anyway. A work around would be to remove all references to converting subtitles.

    Try this first;
    line 133 looks like this
    Code:
     os.system(f"tt convert  -i {videoname}.subs.vtt -o {videoname}.subs.srt > /dev/null 2>&1")
    What it does is to call tt to convert subtitles. But tt spews out a lot of garbage to the screen. To stop that, the output is directed to the dump '/dev/null' - windows systems do not have that location - hence the file not found error.

    So, first try editing line 133 to read:
    Code:
     os.system(f"tt convert  -i {videoname}.subs.vtt -o {videoname}.subs.srt ")
    That should try to convert the subtitles and produce an srt file extension but also tell you very verbosely what it is doing. Run it like that and see what happens.
    But as I say I know of one case of tt not working on windows, so if that is the same for you after testing, comment out the line by putting a # at the start of line 133.

    Then the only other thing to correct is to remove any further references to using a subtitle file with an srt extension.
    alter line 178
    Code:
    f"{videoname}.subs.srt",
    to
    Code:
    f"{videoname}.subs.vtt",
    Alter line 184
    Code:
    os.system(f"rm {myvideoname}.mp4 {videoname}.subs.vtt {videoname}.subs.srt")
    to
    Code:
    os.system(f"rm {myvideoname}.mp4 {videoname}.subs.vtt ")
    And hopefully that will do. I post my code with no support offered. Information Technology has been in the UK schools National Curriculum since 1987 - so a bit of code editing cannot really be 'new' to anyone in the UK at school after that. I'll accept this issue is a bit obscure - hence my help here.
    If you still cannot make it work after that, the alternative is to set up a Linux virtual machine within windows. There are web instructions how to do that.
    Quote Quote  
  30. Member
    Join Date
    Jul 2023
    Location
    The ninth level
    Search PM
    Thank you A_n_g_e_l_a unfortunately my schooling was finished by 1987! So the only experience of computers I got at school was a BBC B using basic and "hello World" repeated many times. However I am trying to learn and comments such as "its already been answered in this thread" without referencing where don't really help much.

    But A_n_g_e_l_a's response gives me something to try and hopefully get the script to work for me and maybe others. I have some experience of using linux but not for any scripting etc but if the suggestions don't work I can give that a go as well.

    Unfortunately I am doing the day job at the moment so will check back in later with any results.

    Thanks again
    Quote Quote  



Similar Threads

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