try to follow this methode, i's worked for me as well
https://forum.videohelp.com/threads/407144-Help-with-Channel-4-Key-to-this-programme-a...se#post2668861
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 124
Thread
-
-
can anyone help me im getting this error
im getting this now:
C:\Users\danny\Desktop\c4-dl-master\c4-dl-master>py .\c4-dl.py --download --wvd "C:\widevine_device.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
Traceback (most recent call last):
File "C:\Users\danny\Desktop\c4-dl-master\c4-dl-master\c4-dl.py", line 10, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
i tried to install requests via pip install requests -
I have my own solutions for ITVX, All4, CH5, UKTV, RTE, Discovery+, STV (encrypted) which I've automated with extra script as much as possible and I've been pretty happy with (they work lol). They are based on the original WKS-KEYS but with some modifications. They do require some manual input like mpd, licence, PSSH (for Britbox/ ITVX), and copying cURL to Python for All4 and Disc+. None of these use this "new" pywidevine module.
So, I thought I'd look at this all-in-one solution for All4. I installed the said pywidevine module. Well, that didn't go too well lol. My ITVX and STV solutions stopped working (came up with errors). It seems that the problem is installing pywidevine also updates already installed modules (like protobuf). The older scripts don't like these latest versions.
Fortunately, I have a backup of my Scripts and site-packages folders, so it was easy to reverse the situation.Last edited by deccavox; 23rd Nov 2022 at 07:45.
-
Been there too, see the end of this post under 'Gotchas' https://forum.videohelp.com/threads/407216-Decryption-The-Dungeon-of-Despair#post2669281
If you get caught this way and you want to use WKS_KEYS then remove protofub 4.x.x (pip uninstall protobuf) and run pip install 'protobuf==3.20.3' to install this older version. -
-
First of all, thank you Diazole for this script. I've learned a ton going through it.
Just a minor caution for those using it. Some channel 4 shows have a descriptive audio track and this script grabs the "ba" best audio by default. For me, this usually meant it grabbed the descriptive audio track. So, I just changed it to "audio=128000" which is the regular English track.
And for anyone interested in subtitles, you can add a snippet to get_vod_stream() to find it. This example tries to find the associated .vtt. Other formats are available too, but not all shows have all formats. But I found that most shows had a .vtt so that is what I look for.
Code:for i in resp['subtitlesAssets']: if (os.path.splitext(i['url'])[1]==".vtt"): print(i['url'])
-
someone talked about it here and the gist seems to be that those streams are for smart tvs
maybe you could spoof a smart tv through android studio(?) or some other emulator and then use http toolkit to look at the traffic when accessing a show and see if there's some kind of token or whatever that gets sent to unlock a better stream -
Good spot on the descriptive audio track, unfortunately "audio=128000" won't work in all scenarios as the name of the audio track isn't always the same. I think it's better, albeit hacky, to set a regex on the audio, "ba[language~="[a-z-Z]{0,0}"]", unless someone has a better idea.
I've managed to figure out how to get the 5000kbps stream so i'll update the script once i've finished testing. -
-
I also use worstaudio and to date have never had an issue. As previously commented using bestaudio gets you the AD track.
-
I don't think that's any better because you could potentially download a lower bit rate audio stream?
The reason "ba" grabs the descriptive audio track is because yt-dlp sorts by lang to figure out the best audio. The descriptive stream has lang="en" whereas the normal stream does not.
The correct way would be to make yt-dlp check the Role node as that contains whether the stream is descriptive or not, but I don't think yt-dlp supports that.
Normal:
Code:<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main" />
Code:<Role schemeIdUri="urn:mpeg:dash:role:2011" value="description" />
-
-
No the reason ba grabs the descriptive track is because it is the last audio track, just the same as best video is the last in the list.
I'm a pragmatist. and If you feel the need to spend hours looking at ways of ensuring you don't get the descriptive track go ahead and over-engineer.
Whenever I've looked at channel4 - and I don't these day because someone gave me a damn-good downloader - I only saw two audio tracks.
[Attachment 68483 - Click to enlarge]Last edited by A_n_g_e_l_a; 2nd Jan 2023 at 07:14.
-
Doing the correct thing isn't overengineering, selecting the worst audio quality will work whilst there are only two audio streams, but it's far from ideal.
What makes this channel4 downloader you speak of so "damn-good"? Care to share it with the community? -
Thanks for the heads up about the 5000kbps support. Incidentally, I've always used a different bodge for the audio when an AD track/channel is present: "ba.2", but I might switch to the regex approach.
-
I've updated the script to grab the highest bitrate stream, the highest I've seen so far is 6000kbps.
I did some testing and found that C4 isn't consistent with the language attribute so my previous comment about using a regex to check the length isn't 100% effective. I also tried "ba.2" during my testing but I found that not every MPD has multiple streams (not all episodes support AD), so this isn't 100% effective either.
I've resorted to "wa" which isn't great. The actual fix would be to make yt-dl expose the "Role" node so we can filter on "value". -
Last edited by Dannyboi; 3rd Jan 2023 at 12:47.
-
-
tried that following errors:
C:\Users\Maverick\Desktop\c4-dl-High bitrate>python .\c4-dl.py --wvd
Traceback (most recent call last):
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 15, in <module>
from pywidevine.pssh import PSSH
File "C:\Users\Maverick\AppData\Local\Programs\Python\P ython310\lib\site-packages\pywidevine\__init__.py", line 1, in <module>
from .cdm import *
File "C:\Users\Maverick\AppData\Local\Programs\Python\P ython310\lib\site-packages\pywidevine\cdm.py", line 10, in <module>
from pywidevine.cdm.formats import wv_proto2_pb2 as wv_proto2
ModuleNotFoundError: No module named 'pywidevine.cdm.formats'; 'pywidevine.cdm' is not a package
C:\Users\Maverick\Desktop\c4-dl-High bitrate>python .\c4-dl.py --download --wvd "C:\Users\Maverick\Desktop\c4-dl-High bitrate\widevine_device.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
Traceback (most recent call last):
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 15, in <module>
from pywidevine.pssh import PSSH
File "C:\Users\Maverick\AppData\Local\Programs\Python\P ython310\lib\site-packages\pywidevine\__init__.py", line 1, in <module>
from .cdm import *
File "C:\Users\Maverick\AppData\Local\Programs\Python\P ython310\lib\site-packages\pywidevine\cdm.py", line 10, in <module>
from pywidevine.cdm.formats import wv_proto2_pb2 as wv_proto2
ModuleNotFoundError: No module named 'pywidevine.cdm.formats'; 'pywidevine.cdm' is not a package -
Originally Posted by Diazole
[Attachment 68507 - Click to enlarge]
Also, big thanks for sharing your scripts! I'm trying to get better at python, and your stuff is a great learning tool. -
You've copied the "original"/"old" pywidevine into the pywidevine package folder...
Delete the "pywidevine" located at "C:\Users\Maverick\AppData\Local\Programs\Pyth on\P ython310\lib\site-packages\pywidevine\" and then run:
Code:pip install pywidevine
Two things:
1. Why does your "P ython310" folder contain a space?
2. Don't copy/paste files into site-packages, that's why you have pip. -
Python310 doesnt have a space and i deleted the pywidevine folder and tried the cmd pip install pywidevine but getting this error now
Microsoft Windows [Version 10.0.19044.2364]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Maverick>pip install pywidevine
Requirement already satisfied: pywidevine in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (1.5.2)
Requirement already satisfied: Unidecode<2.0.0,>=1.3.4 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (1.3.6)
Requirement already satisfied: lxml>=4.9.1 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (4.9.1)
Requirement already satisfied: pycryptodome<4.0.0,>=3.15.0 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (3.15.0)
Requirement already satisfied: requests<3.0.0,>=2.28.1 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (2.28.1)
Requirement already satisfied: pymp4<2.0.0,>=1.2.0 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (1.2.0)
Requirement already satisfied: protobuf==4.21.6 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (4.21.6)
Requirement already satisfied: click<9.0.0,>=8.1.3 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (8.1.3)
Requirement already satisfied: colorama in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from click<9.0.0,>=8.1.3->pywidevine) (0.4.6)
Requirement already satisfied: construct==2.8.8 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pymp4<2.0.0,>=1.2.0->pywidevine) (2.8.8)
Requirement already satisfied: idna<4,>=2.5 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2.10)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (1.26.5)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2022.9.24) -
current error:
\c4-dl.py", line 15, in <module>
from pywidevine.pssh import PSSH
ModuleNotFoundError: No module named 'pywidevine'
after entering pip install pywidevine
also my python310 folder doesnt contain a space but for some reason when i paste what it says in cmd on this site it adds a space for some reason
Microsoft Windows [Version 10.0.19044.2364]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Maverick>pip install pywidevine
Requirement already satisfied: pywidevine in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (1.5.2)
Requirement already satisfied: Unidecode<2.0.0,>=1.3.4 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (1.3.6)
Requirement already satisfied: click<9.0.0,>=8.1.3 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (8.1.3)
Requirement already satisfied: protobuf==4.21.6 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (4.21.6)
Requirement already satisfied: requests<3.0.0,>=2.28.1 in c:\users\Maverick\appdata\roaming\python\python310 \site-packages (from pywidevine) (2.28.1)
Requirement already satisfied: lxml>=4.9.1 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (4.9.1)
Requirement already satisfied: pycryptodome<4.0.0,>=3.15.0 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (3.15.0)
Requirement already satisfied: pymp4<2.0.0,>=1.2.0 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pywidevine) (1.2.0)
Requirement already satisfied: colorama in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from click<9.0.0,>=8.1.3->pywidevine) (0.4.6)
Requirement already satisfied: construct==2.8.8 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from pymp4<2.0.0,>=1.2.0->pywidevine) (2.8.8)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (1.26.5)
Requirement already satisfied: charset-normalizer<3,>=2 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2.1.1)
Requirement already satisfied: certifi>=2017.4.17 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2022.9.24)
Requirement already satisfied: idna<4,>=2.5 in c:\users\Maverick\appdata\local\programs\python\py thon310\lib\site-packages (from requests<3.0.0,>=2.28.1->pywidevine) (2.10)
C:\Users\Maverick> -
-
so i downloaded it from github and added it manually and getting:
C:\Users\Maverick\Desktop\c4-dl-High bitrate>python .\c4-dl.py --download --wvd "C:\Users\Maverick\Desktop\c4-dl-High bitrate\widevine_device.wvd" --url "https://cf.jos.c4assets.com/CH4_08_02_900_73860001001001_001/CH4_08_02_900_73860001001001_001_J01.ism/stream.mpd?c3.ri=13504108658373752707&mpd_segment_ template=time&filter=8typeDD2video26688DisplayHeig htED2889668systemBitrateC4800000999CCtype1D2video2 &ts=1672773728&e=600&st=SkDQwuKTllNeol04d_ATccif2i rw2icc9KCOtk-gPHo"
[!] Failed getting asset ID !!!
Traceback (most recent call last):
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 528, in <module>
main()
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 460, in main
asset_id = get_asset_id(url)
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 179, in get_asset_id
init_data = json.loads(init_data.group(1))
AttributeError: 'NoneType' object has no attribute 'group'
C:\Users\Maverick\Desktop\c4-dl-High bitrate>pause
Press any key to continue . . .
and this when i tried your way:
C:\Users\Maverick>pip uninstall pywidevine
WARNING: Skipping pywidevine as it is not installed.
C:\Users\Maverick>pip install 'pywidevine==1.4.3'
ERROR: Invalid requirement: "'pywidevine==1.4.3'" -
You've fixed your Crypto and pywidevine errors but now you're providing the script with the wrong URL.
The URL needs to be the URL of the episode you are trying to DL, e.g.Code:--url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
-
C:\Users\Maverick\Desktop\c4-dl-High bitrate>python .\c4-dl.py --download --wvd "C:\Users\Maverick\Desktop\c4-dl-High bitrate\widevine_device.wvd" --url "https://www.channel4.com/programmes/the-big-bang-theory/on-demand/44564-001"
Traceback (most recent call last):
File "C:\Users\Maverick\Desktop\c4-dl-High bitrate\c4-dl.py", line 15, in <module>
from pywidevine.pssh import PSSH
ModuleNotFoundError: No module named 'pywidevine'
C:\Users\Maverick\Desktop\c4-dl-High bitrate>pause
Press any key to continue . . .
update:
C:\Users\Maverick\Desktop\all4_new>python .\c4-dl.py --download --url "https://www.channel4.com/programmes/warplane-workshop/on-demand/73860-001"
usage: c4-dl.py [-h] [--download] [--wvd WVD] [--url URL]
Channel 4 downloader.
options:
-h, --help show this help message and exit
--download Download the episode
--wvd WVD The file path to the WVD file generated by pywidevine
--url URL The URL of the episode to download
C:\Users\Maverick\Desktop\all4_new>pause
Press any key to continue . . . -
I tried the update and it works for me no problem. Great work!
Just two things:
1. Believe it or not, for some shows, the browser manifest actually contains higher bitrate streams than the android device manifest. So, ideally, the script should have a toggle to select either the browser or android manifest rather than ripping the old code out completely. Or even better, it tries both and finds the one with the highest bitrate but that's maybe more work than required. Ultimately, it's not a big deal, a person could just keep the old script lying around but it you make further edits in the future, it could cause a versioning problem.
2. I found that some shows with very long names caused a file too long problem and crapped out of yt-dlp/aria2c. I think this is partly because you write temporary files to a directory with the full show title and episode name, etc. When I hard coded the output file name to "episode" or something short, it worked no problem. So, a toggle to override the automated naming would be nice. It's not a deal breaker, just an ease of use improvement more than anything else. I'm surprised you never ran into this as some shows have ridiculously long names like "this is the show name: and then this some more text that goes after the colon".
But overall, thanks for the update!
Similar Threads
-
Y2Mate.ch Downloader Youtube
By jimwnola in forum Video Streaming DownloadingReplies: 25Last Post: 1st Jun 2022, 10:58 -
ITVHUB downloader?
By bal2001bc in forum Video Streaming DownloadingReplies: 6Last Post: 24th Jun 2021, 07:32 -
Shudder downloader?
By throwawayjz1 in forum Video Streaming DownloadingReplies: 1Last Post: 25th Jan 2021, 15:31 -
Using TV downloader
By frankopstaele in forum Newbie / General discussionsReplies: 0Last Post: 2nd Feb 2019, 18:44 -
Downmixing 6 channel AAC to 2 channel?
By bizzybody in forum Video ConversionReplies: 33Last Post: 12th Nov 2017, 10:19