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-
Replace that unread function code with 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 '''
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?Code:def main() -> int: url = input("Enter a single url \n") ITV().download(url) return 0
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 60 of 217
Thread
-
Last edited by A_n_g_e_l_a; 25th Jun 2023 at 08:56.
-
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. -
@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
-
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. -
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 -
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? -
-
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! -
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. -
I've updated the script in the first post.
- 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.
- 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
- Filtering out nuisance characters from video names that break the program has been improved. "*'%$!(),:;-" are removed, plus '&' becomes 'and'.
- 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.
- 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
-
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.
-
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/ -
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
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.
-
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? -
Last edited by A_n_g_e_l_a; 13th Jul 2023 at 10:59.
-
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
-
.-
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 -
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.
-
-
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
[Attachment 72810 - Click to enlarge]
Can anyone help me out as I have no clue. -
I help all that ask.
Telegram: https://t.me/MagicianNulled -
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. -
I help all that ask.
Telegram: https://t.me/MagicianNulled -
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")
So, first try editing line 133 to read:
Code:os.system(f"tt convert -i {videoname}.subs.vtt -o {videoname}.subs.srt ")
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",
Code:f"{videoname}.subs.vtt",
Code:os.system(f"rm {myvideoname}.mp4 {videoname}.subs.vtt {videoname}.subs.srt")
Code:os.system(f"rm {myvideoname}.mp4 {videoname}.subs.vtt ")
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. -
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
Similar Threads
-
Crash course on downloading ITVx hub please?
By adrian44 in forum Video Streaming DownloadingReplies: 217Last Post: 4th Dec 2023, 19:25 -
ITVX & Error 403
By PhilipG in forum Video Streaming DownloadingReplies: 14Last Post: 20th May 2023, 03:39 -
Portable Windows Video DownLoader & SubTitles?
By TEH in forum Video Streaming DownloadingReplies: 4Last Post: 21st Jul 2022, 12:41 -
4K-Video-Downloader and playlist subtitles
By ChasVideo in forum Video Streaming DownloadingReplies: 0Last Post: 11th Sep 2020, 06:49 -
Using TV downloader
By frankopstaele in forum Newbie / General discussionsReplies: 0Last Post: 2nd Feb 2019, 19:44