parnexcodes/widevine-L3-WEB-DL-Script

Video Split over 4 ids?

Demboer15 opened this issue · 36 comments

Have an mpd that splits video id into four parts (audio is one id):

https://imgur.com/Mb2gipt

How do I get script to download all four ids: -0, -1,-2 and -3 and merge together correctly.
When I use XstreamDL it automatically downloads as one video file so obviously there must be a way for script to do this correctly.
Thanks in advance for any help.

Just choose any ID of the four, they are all the same file.

They are not the same in this case, the first one downloads a small section of the beginning, the 2nd and 3rd downloads a larger section of the middle and the 4th the end.

Post the link of the episode or the movie.

Any episode.

But also think it happens with anything else on website

Try using this modified version of the script, just run download.bat and choose the audio in aac.

widevine-L3-WEB-DL-Script-Peacock.aac.zip

When you say run download.bat, can you elaborate, thanks.

Just put keys.json in the same folder with webdl2.py and double click on download.bat, You might get offered to choose the audio and the video, choose the audio in aac, not sure if the keys will work with the audio in eac3 or not, and some of the shows has the audio only in aac, If you could decrypt the audio in eac3 open webdl2.py with Notepad++ and replace aac with eac3, you could make a copy of the script and name it webdl3.py and a copy of download.bat and name it download.2.bat and edit download.2.bat by replacing webdl2.py with webdl3.py and when you want to decrypt the audio in eac3 execute download.2.bat.

Tried shift+right click in white space of script folder, open command window, type download.bat+return. All it does is open webdl2.py in notepad and when I close that it states in command window: press any key to continue... and then it closes command window. Double clicking download.bat does same thing, keys.json (with duplicate mpd url link removed) in new Peacock script folder. That's why I was asking you to elaborate, thought I was doing something wrong.

The purpose of the batch file is not to use the command prompt, anyway ignore the batch file and rename webdl2.py to webdl.py and use it as you used to do before.

As said, even just double clicking batch file did same thing.

Renamed to webdl.py as requested, run script as normal, went through start download process etc and now it is repeatedly saying downloading map file, is this normal, or wrong.

Are you using a VPN?

Upload your keys.json here in a comment. Is your account a premium one?

Using smartdns (works fine with XstreamDL), with premium, no ads.

Try using a different mpd, I had the same problem before changing the mpd worked for me.

Tried both VPN and different mpd, no luck, any other suggestions.

I have no other suggestions now, you could try using this keys.json for the first episode of "Cheers", It worked for me, but it has ads.

keys.zip

I modified the script to use XstreamDL-CLI, download it from here.

https://codeload.github.com/Essam3152/widevine-L3-WEB-DL-Script/zip/refs/heads/Peacock

You could change the options of XstreamDL-CLI in this line.

https://github.com/Essam3152/widevine-L3-WEB-DL-Script/blob/Peacock/webdl.py#L62

Thanks, that definitely works.

One final question, where can I tell XstreamDL in the script where ffmpeg is located to remove "Warning: cannot find executable ffmpeg", during execution of script. Doesn't affect running of script, just annoying seeing it.

1, tried adding "--ffmpeg "C:\Users<username>\Desktop\ffmpeg-2021-09-20-git-59719a905c-full_build\bin\ffmpeg.exe"" in the XstreamDL options line but it caused a syntax error when running script.
2, added ffmpeg.exe to binaries folder but still get message.
3, tried adding "ffmpegexe = dirPath + '/binaries/ffmpeg.exe' in script but still get message.

You could add ffmpeg.exe to PATH or add it in the same folder with webdl.py or add ffmpeg.exe in binaries and in the script modify it to

subprocess.run([XstreamDLexe, json_mpd_url, '--select', '-name', 'encrypted', '-save-dir', dirPath, '--enable-auto-delete', '--limit-per-host', '100', "--mp4decrypt", "binaries", '--ffmpeg', 'binaries'])

I updated the script and added ffmpeg, download the new version.

https://codeload.github.com/Essam3152/widevine-L3-WEB-DL-Script/zip/refs/heads/Peacock

Was about to post an idea about the subtitles. Not sure if there are subtitles on their own, tried looking for ttml2 etc when enabled in stream and check console but nothing there but the video itself has embedded closed captions which after the mkv is created I use CCExtractor to extract them as srt and merge them myself into existing mkv. Would it be possible to add this as a process to the script.

Do you have any idea why subtitles look like this?
https://i.ibb.co/r7mZqWM/Imagen2.jpg
It´s CC no?

@Demboer15 The script needs the URLs of the subtitles, see here.

#45 (comment)

I might try to find a way for getting the URLs of the subtitles, usually Apple devices use a different format for the subtitles .

Was about to post an idea about the subtitles. Not sure if there are subtitles on their own, tried looking for ttml2 etc when enabled in stream and check console but nothing there but the video itself has embedded closed captions which after the mkv is created I use CCExtractor to extract them as srt and merge them myself into existing mkv. Would it be possible to add this as a process to the script.

It would be great.

@Demboer15 The script needs the URL of the subtitles, see here.

#45 (comment)

I might try to find a way for getting the URLs of the subtitles, usually Apple devices use a different format for the subtitles .

Either way would be great, either URL if possible or CCExtractor which I,ve been using on episodes.

@Demboer15 I could not find anything helpful in the m3u8 URL of a video on the iPhone.

https://g005-sf-us-cmaf-prd-ak.cdn.peacocktv.com/pub/global/986/849/pck_4193981/cmaf/1630090539624.6821/mpeg_2sec/master_cmaf.m3u8

and I do not think I would be able to modify the script to use CCExtractor.

No worries, what you've done with the script so far I am very grateful for, been able to add CCExtractor would of just made it one less step to deal with.
Personal preference, but 2 minor things I changed were updating mkvmerge to v61.0.0.0 and changing the default language for video to und instead of eng.

@Essam3152 would you mind looking at this if you can help #66

@Demboer15 @oribe522 I modified the script to use CCExtractor, run download.bat and the script will extract the subtitle and merge it in the video (or use webdl.py -o movie).

https://codeload.github.com/Essam3152/widevine-L3-WEB-DL-Script/zip/refs/heads/Peacock-subtitles

Use this keys.json for testing the script.

keys.zip

@Demboer15 @oribe522 I modified the script to use CCExtractor, run download.bat and the script will extract the subtitle and merge it in the video, the script has keys.json you could test the script with it.

https://mega.nz/file/9h13nSgR#Pi02VVxNbs9MaQ-d3YsZWP3Qnc8OcbaG8bwn5ufh5vg

Thanks! really thanks!

@Demboer15 @oribe522 I modified the script to use CCExtractor, run download.bat and the script will extract the subtitle and merge it in the video (or use webdl.py -o movie).

https://codeload.github.com/Essam3152/widevine-L3-WEB-DL-Script/zip/refs/heads/Peacock-subtitles

Use this keys.json for testing the script.

keys.zip

Wow, thanks, just to confirm working with Peacock mpd.

Talking of subtitles, Essam3152, anyway of grabbing latest HBOMAX subtitles with script, they are now using split .VTT files.

Thanks in advance.

@Essam3152 What can i do sir ? @Essam3152

`_ ____________ ____ __ _____ _ __
| | / / / __ )/ __ / / / /()_ / /_
| | /| / / / / __ / / / / / _ / / / / __ / /
| |/ |/ / /
/ /
/ / /
/ / /
/ / // / / / // / /

|/|///// //___// // ./_/
/_/

by parnex Edited By JudgeU
Required files : mkvmerge.exe, XstreamDL-CLI, mp4decrypt.exe, ffmpeg.exe, aria2c.exe, ccextractorwinfull.exe

Selected MPD : https://g003-vod-us-cmaf-prd-cl.cdn.peacocktv.com/pub/global/cY3/xNU/PCK_1634093103246.8225_01/cmaf/mpeg
_cenc_2sec/master_cmaf.mpd?c3.ri=5001555883745733320

0 total 3154 segments 6312.93s encrypted_video_H264_960x540_1833.85kbps
1 total 3154 segments 6312.93s encrypted_video_H264_1920x1080_7222.21kbps
2 total 3154 segments 6312.93s encrypted_video_H264_1280x720_4603.58kbps
3 total 3154 segments 6312.93s encrypted_video_H264_960x540_2963.41kbps
4 total 3154 segments 6312.93s encrypted_video_H264_768x432_857.49kbps
5 total 3154 segments 6312.93s encrypted_video_H264_512x288_354.81kbps
6 total 3132 segments 6312.99s encrypted_audio_EAC3_en_196.77kbps
7 total 3149 segments 6312.96s encrypted_audio_AAC_en_103.19kbps
8 total 3149 segments 6312.96s encrypted_audio_AAC_es_103.19kbps
9 total 3149 segments 6312.96s encrypted_audio_AAC_en-ad_103.11kbps
input stream number(s):
5
encrypted_video_H264_512x288_354.81kbps download start.
encrypted_video_H264_512x288_354.81kbps --------------------------------------- 100.00% • 266.8/266.8 MiB • ? • 0:00:00
encrypted_video_H264_512x288_354.81kbps --------------------------------------- 100.00% • 266.8/266.8 MiB • ? • 0:00:00
encrypted_video_H264_512x288_354.81kbps --------------------------------------- 100.00% • 267.0/267.0 MiB • ? • 0:00:00
C:/Ripping Tools/widevine-L3-WEB-DL-Script-Peacock-subtitles/widevine-L3-WEB-DL-Script-Peacock-subtitles/encrypted_video_H264_512x288_354.81kbps.mp4 was merged successfully
C:/Ripping Tools/widevine-L3-WEB-DL-Script-Peacock-subtitles/widevine-L3-WEB-DL-Script-Peacock-subtitles/encrypted_video_H264_512x288_354.81kbps was deleted

Decrypting .....
'C:\Ripping' is not recognized as an internal or external command,
operable program or batch file.
'C:\Ripping' is not recognized as an internal or external command,
operable program or batch file.
'C:\Ripping' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the file specified.
Merging .....
mkvmerge v57.0.0 ('Till The End') 64-bit
Error: The file 'decrypted.mp4' could not be opened for reading: open file error.

All Done .....

Do you want to delete the Encrypted Files : Press 1 for yes , 2 for no
Enter Response :`

@Demboer15 You could try this modified script, it uses yt-dlp, it will work only with the mpd in this type

https://cmaf.cf.us.hbomaxcdn.com/videos/GXt-ZRQXsQcPCwgEAAAqW/1/b1ec35/1_KW0E8Q_ad_1080hi.mpd

you could find that kind of mpd by searching in network for "content" press on every link then press on "response" and search for "fallbackManifest", not every video will have it.

The script is modified to download only the English subtitles, and it has keys.json for the movie "birds of prey" HBOMAX USA, use webdl.py -o movie -id -s or webdl.py -o movie -s.

widevine-L3-WEB-DL-Script-HBOMAX-subtitles.zip

11

Thanks Essam3152, tested and all working fine, pulling the subs now.

@post-master I do not know yet why are you getting this error message, try to put "widevine-L3-WEB-DL-Script-Peacock-subtitles" in a different partition like "D", and do not use the batch file.

@Essam3152 sir can I have your discord or telegram, please?

The file 'decrypted.mp4' could not be opened for reading: open file error @Essam3152 any solution?