Giter VIP home page Giter VIP logo

widevine-l3-web-dl-script's Introduction

widevine-L3-WEB-DL-Script

This is a script created to WEB-DL L3 Widevine Content.

Last Updated July 31, 2021.

Use the branch below if you aren't able to modify the code according to your needs

https://github.com/parnexcodes/widevine-L3-WEB-DL-Script/tree/method-2

Works well with .mpd files , for m3u8 please use n_m3u8 program (not included in this script).

How to use

Requirements

Get the keys

Go to the protected stream you want to download. Activate the plugin (restart may be required after installing the extension) and download the extracted keys (keys.json).

Decode the video

Download the widevine-L3-WEB-DL-Script from here (Code -> Download zip). Copy the downloaded keys.json file to the same folder.

Run the downloader with python webdl.py -o <name_without_extension> from the folder you downloaded and extracted the script from.

The script will look in the keys.json file, starting from the second element in the JSON array. If the script can't find any keys, either modify the script (line 27 and 31), or the keys.json. See https://gist.github.com/parnexcodes/74fef2e33a2171031000a97c371a1a65 for examples for some common use cases.

If there are multiple mpd_urls in the file and it isn't working, try changing them around. You can also change the mpd_url for a custom one if you have one.

Options

-id = Manually enter video and audio id from ytdl -s = Optional - For subtitle url (Subtitle part is bugged right now) -d = Optional Delete encoded AND JSON FILE upon completion -k = Optional Use keyfile with the same name as specified output

Report Issues

Open Issue on Github if you get any problem.

widevine-l3-web-dl-script's People

Contributors

parnexcodes avatar punit-choudhary avatar replicant-bookmark avatar sirloinofbeef avatar techno-arch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

widevine-l3-web-dl-script's Issues

Download stops at 2 minutes.

Hello. Trying to download live stream but script exits after 2 minutes. How to I solve this problem?

EDIT: The download stops after 2 minutes because the MPD is dynamic, adding new segments or periods as content becomes available, and dropping older segments and periods when the content is no longer available. Does your script support this type of MPD?

EDIT 2: So it seems that yt-dlp only fetches the mpd once, resulting in a 2 minutes media chunk made up of several segments. The downloader would have to make repeated mpd requests in order to get next current live segments. Searching for a solution.

Thank you for your time and work.

webdl.py: error: unrecognized arguments: -m

Hi,
Every time I run this script, I get "webdl.py: error: unrecognized arguments: -m {the MPD URL that I entered}".
There are no issues with the URL (I tested it using N_m3u8cli), and I tried other sites and still the same error.

Can this script apply for fubotv site

Thank you so much for your sharing script.
I try with fuboTv stream, it's can download and decrypt successful. But still can't decrypt.
I did wrong or this script can't download fuboTv video?
Thank again!

Decrypt .mp4 file downloaded using n_m3u8

I tested this script with .mpd files and it works great, but the videos I want are only available in .m3u8 so I used the n_m3u8 program like mentioned in the README. It downloaded an .mp4 file but it's still encrypted and won't play. Using the Widevine Guesser extension found keys on the website (of the m3u8 file). I was wondering if it's possible to decrypt the .mp4 file I have using this script with those keys? Thank you!

Multiple audio tracks

A certain site I use offers multiple audio tracks at the same quality, though these are music only, audio description, etc. This tool can sometimes pick the incorrect one. Any chance of an option for it to allow me to pick which track I want?

requested format error

I'm getting error "I'm getting error "ERROR: Requested format is not available" thanks.

KeyError: 'kid'

I am getting this error with the main method,

Traceback (most recent call last):
  File "C:\Users\sdfsdf\Desktop\widevine-L3-WEB-DL-Script-main\webdl.py", line 28, in <module>
    keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "
KeyError: 'kid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\sdfsdf\Desktop\widevine-L3-WEB-DL-Script-main\webdl.py", line 32, in <module>
    keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "
KeyError: 'kid'

need help!

add WVGuesser to script

Is it possible to combine these two scripts with some command to make them run after running webdl.py

add cookies

please help me add user-agent and cookies or header in your script

Subedit Multiple replace command in script

Hello
You are able to prompt how to use the Multiple replace command in the subedit in the script to convert HTML symbols into normal letters and it was saved in srt format to merge the files later. My point is to convert from .sami to .srt and convert HTML characters to appropriate letters during this conversion.

It works but got Traceback when Enter Response "1"

Do you want to delete the Encrypted Files : Press 1 for yes , 2 for no
Enter Response : 1
Traceback (most recent call last):
File "PATH\webdl.py", line 105, in
os.remove("en.xml")
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'en.xml'

en.xml? what is that?

best video and audio quality?

With this script I get the best video and audio quality from Amazon with keys.json?
Probably not :( The bit rate is going down.

I know that it is possible to pull out twice as large

image

keys.zip

Error: 403 forbidden

I am getting error: 403 forbidden while trying to download mpd file. What to do for downloading?

how to merge audio and video ts files to one mp4 file? it failed to me , " trun track id unknown, no tfhd was found"

question: audio and video download by N_m3u8DL-CLI_v2.9.7_with_ffmpeg_and_SimpleG , please help me , i have no idea

PS E:\ffmpeg-n4.4-79-gde1132a891-win64-gpl-4.4\bin\N_m3u8DL-CLI_v2.9.7_with_ffmpeg_and_SimpleG> .\ffmpeg.exe -i '.\stream.mpd_20210809205722(Audio).ts'  -i .\stream.mpd_20210809205722.ts -codec copy Output.mp4
ffmpeg version 2021-08-08-git-ac0408522a-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
  libavutil      57.  3.100 / 57.  3.100
  libavcodec     59.  4.101 / 59.  4.101
  libavformat    59.  4.101 / 59.  4.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  1.103 /  8.  1.103
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000029cc5bfe0c0] could not find corresponding trex (id 2)
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000029cc5bfe0c0] could not find corresponding track id 0
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000029cc5bfe0c0] trun track id unknown, no tfhd was found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000029cc5bfe0c0] error reading header
.\stream.mpd_20210809205722(Audio).ts: Invalid data found when processing input

audio and video download by N_m3u8DL-CLI_v2.9.7_with_ffmpeg_and_SimpleG , please help me , i have no idea

amz/peacock

after changing the lines of code to suit the website im trying to grab from i get some errors

ERROR: aria2c exited with code 22
WARNING: --downloader-args given without specifying name. The arguments will be given to all external downloaders
[generic] aeeb5080-afa8-4260-9223-fe8616d8b885_corrected: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] aeeb5080-afa8-4260-9223-fe8616d8b885_corrected: Downloading webpage
[generic] aeeb5080-afa8-4260-9223-fe8616d8b885_corrected: Extracting information
[info] aeeb5080-afa8-4260-9223-fe8616d8b885_corrected: Downloading 1 format(s): video=2400000-10
[download] Destination: encrypted.mp4

08/02 13:39:08 [ERROR] CUID#7 - Download aborted. URI=https://s3-iad-2.cf.dash.row.aiv-cdn.net/dm/2$It_EtQAh4NXqbiFA9DC6xo8Syc4~/1@593bac3294aa0ee458b5359231f60d7b/2d15/87b3/2647/4dbd-a801-d72f23afb743/2d15/87b3/2647/4dbd-a801-d72f23afb743/aeeb5080-afa8-4260-9223-fe8616d8b885_video_9.mp4
Exception: [AbstractCommand.cc:351] errorCode=22 URI=https://s3-iad-2.cf.dash.row.aiv-cdn.net/dm/2$It_EtQAh4NXqbiFA9DC6xo8Syc4~/1@593bac3294aa0ee458b5359231f60d7b/2d15/87b3/2647/4dbd-a801-d72f23afb743/2d15/87b3/2647/4dbd-a801-d72f23afb743/aeeb5080-afa8-4260-9223-fe8616d8b885_video_9.mp4
-> [HttpSkipResponseCommand.cc:240] errorCode=22 The response status is not successful. status=403

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.

ERROR: aria2c exited with code 22

this happens with both amz and peackock

mpd_url

I have keys.json but no mpd_url - HBO, D +
How download ?

Looking For A Developer

Hey, I am looking for a developer for some paid work, let me know how to contact you privately if you are interested.

Thanks

Video Split over 4 ids?

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.

ID

delete plis - sorrry

manifest.mpd with multiple periods only download last period

Working fine but with 1 issue:

Is there a way to make sure it grabs all periods from the manifest.mpd, it only seems to grab the last period.
There is allready the same question but no solution given.
Can somebody help me to configure webdl.py or keys.json or manifest.mpd?

Thanks in advance.

question: Batch downloads?

Browsing and playing multiple streams in the same tab on the bird network will generate all the keys and download links in the same .json file. Can that be processed as a batch request? If so, how?

manifest.mpd with multiple periods only download last period

Hello there,

I've tried the main branch out a few times and the tool seems to work when provided a decent manifest.mpd link and the keys necessary. Method-2 has been a no-go for me, so this issue is not focused on that.

However I've noticed when a manifest.mpd has multiple periods, it only seems to grab the last period and results in just a small video file with only some minutes before the ending (the last period, basically).

Is there a way to make sure it grabs all periods from the manifest.mpd and then, if possible, stitch them together? The stitching part is not so much trouble if that's not included but the fact it's not grabbing the other parts of the video is a bigger issue.

Thanks in advance for making this.

Exception: [AbstractCommand.cc:351] errorCode=22

Decryption fails using method-2 script

Hi,

I tested the script with a primevideo vid and the full process is OK without any error.

But the MKV file is unreadable using VLC, and mediainfo displays format and codec identifier as V_QUICKTIME.
I checked encrypted file and format is AVC. Decrypted video file is AVC but unreadable too, guess that decryption failed.

Why has this format change with mkvmerge ? I cannot find any setting to modify in the script that would affect this behavior.

quicktime
Any idea ?
Thanks,

print(f'[magenta]{title}[/magenta]') SyntaxError: invalid syntax

It works perfectly on windows, however when atempting to get the keys.json and pass to ubuntu (a VPS) i get this error
vps@vffffff3:~/widevine-L3-WEB-DL-Script$ python3 webdl.py -o "july.26.cam1" File "webdl.py", line 11 print(f'[magenta]{title}[/magenta]')

Linux

We need Linux edition.

Prime Music

How to download audio files from prime music ? can able to get the keys but not mpd url thanks in advance.

Traceback error again

but how do i implement the readme function with the new script? I believe my source has 3 key files. Currently have it as

with open("keys.json") as json_data:
config = json.load(json_data)
json_mpd_url = config[0]['mpd_url']
try:
keys = ""
for i in range(1, len(config)):
keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "
except:
keys = ""
for i in range(2, len(config)):
keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "

Traceback error using amazon with key.json

So i read the fix for lines 27 and 31 and i think the logic is fine so left it how it is.

when running the script, i get

`Traceback (most recent call last):
File "webdl.py", line 28, in
keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "
KeyError: 'kid'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "webdl.py", line 32, in
keys += f"--key {config[i]['kid']}:{config[i]['hex_key']} "
KeyError: 'kid'`

Is my logic wrong? Attaching json file as well
keys.zip

multiple languages

Is it possible to modify it to enter 2 languages ​​at the same time?

Probably Redundant.. Any Workarounds For Grabbing Keys on Linux?

Currently have to use a Microsoft VPS via RDP to grab keys, as I run Linux on my other servers..

Unless something changed, I was under the impression that widevine-l3-guesser only works on windows chrome/firefox/brave..

Are there any workarounds that anyone has found to grab these keys strictly on Linux? The only thing I have left to try is doing a shitty wine install via chrome_installer.exe, but I'm not holding my breath lol.

Maybe ssh in to the Windows VPS and launch headless chrome.. But, then I'm in the blind to truly verify the content that's loaded, other than sourcecode/xhr requests..

Ideas?

encoding error

Method 2 also getting this
webdl.py: error: the following arguments are required: -o/--output 'encoding' is not recognized as an internal or external command, operable program or batch file.

Capture

Pyfiglet Error

Have python installed. Run both pip install pyfiglet & pip install rich and says requirements already satisfied and the both show in pip list.

Run Script and get this error:

Traceback (most recent call last):
File "C:Users"username"\desktop\widevine-L3-WEB-DL-Script-method-2\webdl.py", li
ne 5, in
import pyfiglet
ModuleNotFoundError: No module named 'pyfiglet'

Anyone able to help with this error.

Thanks in advance

List qualities for a video?

I tried changing some settings to get lower quality video formats for ytdlp but all say

'WARNING: --downloader-args given without specifying name. The arguments will be given to all external downloaders
[generic] 9477e424-2212-43b4-80f2-71f315862223_corrected: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] 9477e424-2212-43b4-80f2-71f315862223_corrected: Downloading webpage
[generic] 9477e424-2212-43b4-80f2-71f315862223_corrected: Extracting information
ERROR: Requested format is not available'

Is there a way to view other resolution and select a generic resolution size?

Live

What command do I have to execute to record an live of about two hours duration that has DRM Widevine?

640kbps sound difference

The program works very well. Something happened that caught my attention. When the sounds are listed, there are those that say -1 and -0. What is the difference between -1 and -0?

sss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.