yes, had tested. every request returned a different bearer token, also mpd url and license url in the response. so it's easy to make an automatically script(one by one). if want to do tv shows by seasons, just need make a for circle to get all contentid.
as I said I never tried to send a request to the video link because the response is html format, that means a web page code, never thought it could contains so many information.
thanks for tips again.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 151 to 180 of 237
Thread
-
-
Code:
import re import fake_useragent import requests from pywidevine.cdm import Cdm from pywidevine.device import Device from pywidevine.pssh import PSSH CBS_URL = "https://www.cbs.com/shows/video/68PUsXt2fO2jXaA6G4NNrUhyvAuMP545/" response = requests.get(CBS_URL, headers={ "User-Agent": fake_useragent.UserAgent().random }).content.decode() bearer = re.search(r'"Authorization":"(Bearer .+?)"', response).group(1) manifest = re.search(r'"streamingUrl":"(.+?)"', response) manifest = manifest.group(1).replace("\\/", "/") license_url = re.search(r'"widevine":{"url":"(.+?)"', response) license_url = license_url.group(1).replace("\\/", "/") response = requests.get(manifest).content.decode() pssh_value = str(min(re.findall(r'<cenc:pssh>(.+?)</cenc:pssh>', response), key=len)) WVD_FILE = "./device_wvd_file.wvd" pssh_value = PSSH(pssh_value) device = Device.load(WVD_FILE) cdm = Cdm.from_device(device) session_id = cdm.open() challenge = cdm.get_license_challenge(session_id, pssh_value) licence = requests.post(license_url, data=challenge, headers={ 'Authorization': bearer }) licence.raise_for_status() cdm.parse_license(session_id, licence.content) for key in cdm.get_keys(session_id): print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}") cdm.close(session_id)
Code:fa631c86dc6f4efb8f5211a1d95067b5:27385118a4753346860fd5b8984f6c0d
To get the episodes:
Code:import requests import json SHOW_URL = "https://www.cbs.com/shows/csi-vegas" EPS_API_BATCH = 100 CBS_EPS_API = "/xhr/episodes/page/{page}/size/{batch}/xs/0/season/0/" CBS_EP_URL = "https://www.cbs.com/shows/video/" def get_episodes_urls(show_url, batch=EPS_API_BATCH): episodes_urls = [] page = -1 total = None try: while True: page += 1 cbs_eps_api = show_url + CBS_EPS_API.format(page=page, batch=batch) response = json.loads(requests.get(cbs_eps_api).content.decode()) if total is None: total = response["result"]["total"] for episode in response["result"]["data"]: episodes_urls.append(CBS_EP_URL + episode["content_id"]) if len(episodes_urls) == total: break except: pass return episodes_urls eps = get_episodes_urls(SHOW_URL) print(len(eps)) print("\n".join(eps))
Code:33 https://www.cbs.com/shows/video/tixkIWrIhfILA3oy9WbFXJxvVaMK_yEb https://www.cbs.com/shows/video/TFM573y9QIby_8K_gbw9ivBVr1M7owcH https://www.cbs.com/shows/video/S0qTxP6AaKTa_EwhS6kKm5F3YBOgxKAd https://www.cbs.com/shows/video/PC0n8bq0Uh33eblPcLJOb5FtZni7jAU_ https://www.cbs.com/shows/video/sUdo9DLzrRvP_sO3RepakOT7VxeqMEf1 https://www.cbs.com/shows/video/5nnip9k8tgeEq9twd4BFkMfzYD1RWkY0 https://www.cbs.com/shows/video/hmRFhL__zhdRAmO7IKkkL9WK74MIxoOT https://www.cbs.com/shows/video/Ov3FK8yz5RKzCxzLqrcvx_T1ofH2ta_L https://www.cbs.com/shows/video/XorI8DdalB_BoKzNlosjXSUaYzDOOuFm https://www.cbs.com/shows/video/x_PYklLUAfqQJXeB6f0iz6XW_pMieEUl https://www.cbs.com/shows/video/mx38Gj7FiQnnEkaSCYJzsz1_npcwgFjj https://www.cbs.com/shows/video/4Y8TBYUQcXBhPEPMLxgKbTLdnSsMHY4n https://www.cbs.com/shows/video/42C57oPI68GbG_j1bqEygQUfo_YxqFS0 https://www.cbs.com/shows/video/cArEBGoWjqM1_dui7_vpJyuGxqC3_rH0 https://www.cbs.com/shows/video/Kmllht1gNDE9_oWZoTdu880Q_OJ4mrS2 https://www.cbs.com/shows/video/ZxPd1S94k8e_6wlNF1elrYSgsXb4kuK4 https://www.cbs.com/shows/video/OJBf3mr_ImOor6wAfXJFtk95PV9fWA06 https://www.cbs.com/shows/video/JwC5nklIcMIFjg0PD_MQPZBDlC8kO4UL https://www.cbs.com/shows/video/BGGQAOUAnXhaDGbVqk5Eqe8WAAKSH3X4 https://www.cbs.com/shows/video/fcMMXDYnf0i58ezxXPT39S_pgAmXOADX https://www.cbs.com/shows/video/02cSnYnKe9Vvx33w0PytzrSshODpmnmb https://www.cbs.com/shows/video/m2pD46M8qyltOAObdPe3UtSOvJzRsKg_ https://www.cbs.com/shows/video/_m0cd4K39Ig1BTXSE_Vx2urLY1PWpYFq https://www.cbs.com/shows/video/jwpMNzVFXvmfnf1lqaAs7ti0Ar86tJ_d https://www.cbs.com/shows/video/dfSzwT0JQWWEBlzfZhZBgNjW_lROzZbC https://www.cbs.com/shows/video/BI8UMAYrVZHOZc_9rHJfCntK0o3PIV3x https://www.cbs.com/shows/video/37OLw13B9CMUtK8bBScavPakujxj0_td https://www.cbs.com/shows/video/jdn_gmze5O34YTxNBAqZBku6agUmh_Mo https://www.cbs.com/shows/video/_mrvSg2MJlQpP6mokDlKu94uhuBBA9vU https://www.cbs.com/shows/video/R28XsPmNf85h3Mv6CoQ5qCmUPCPD2GgC https://www.cbs.com/shows/video/ur6qMHnaXTY7ePyqh0D6tYo6gLsLdlkM https://www.cbs.com/shows/video/ct82smMrQDbogrBqISHZEJKj3IUOI1yo https://www.cbs.com/shows/video/68PUsXt2fO2jXaA6G4NNrUhyvAuMP545
Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 27th Feb 2024 at 02:09.
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
And voilą. The final script with all combined. Obviously this won't work with Paramount+ or other paid options or whatever. Only free videos.
Code:import json import re import time import fake_useragent import requests from pywidevine.cdm import Cdm from pywidevine.device import Device from pywidevine.pssh import PSSH EPS_API_BATCH = 50 CBS_EPS_API = "/xhr/episodes/page/{page}/size/{batch}/xs/0/season/0/" CBS_EP_URL = "https://www.cbs.com/shows/video/" WVD_FILE = "./device_wvd_file.wvd" def get_nm3u8_command(manifest, keys): command = "N_m3u8DL-RE.exe " + manifest for key in keys: command += " --key " + key return command + " -M format=mkv" def get_episode_keys(cbs_url): response = requests.get(cbs_url, headers={ "User-Agent": fake_useragent.UserAgent().random }).content.decode() bearer = re.search(r'"Authorization":"(Bearer .+?)"', response).group(1) manifest = re.search(r'"streamingUrl":"(.+?)"', response) manifest = manifest.group(1).replace("\\/", "/") license_url = re.search(r'"widevine":{"url":"(.+?)"', response) license_url = license_url.group(1).replace("\\/", "/") response = requests.get(manifest).content.decode() pssh_value = str(min(re.findall(r'<cenc:pssh>(.+?)</cenc:pssh>', response), key=len)) pssh_value = PSSH(pssh_value) device = Device.load(WVD_FILE) cdm = Cdm.from_device(device) session_id = cdm.open() challenge = cdm.get_license_challenge(session_id, pssh_value) licence = requests.post(license_url, data=challenge, headers={ 'Authorization': bearer }) licence.raise_for_status() cdm.parse_license(session_id, licence.content) keys = [] for key in cdm.get_keys(session_id): if "CONTENT" in key.type: keys.append(f"{key.kid.hex}:{key.key.hex()}") cdm.close(session_id) return { "download": get_nm3u8_command(manifest, keys), "keys": keys, } def get_episodes_urls(show_url, batch=EPS_API_BATCH): episodes_urls = [] page = -1 total = None try: while True: page += 1 cbs_eps_api = show_url + CBS_EPS_API.format(page=page, batch=batch) response = json.loads(requests.get(cbs_eps_api).content.decode()) if total is None: total = response["result"]["total"] for episode in response["result"]["data"]: episodes_urls.append(CBS_EP_URL + episode["content_id"]) if len(episodes_urls) == total: break except: pass return episodes_urls def get_show_keys(show_url): show_keys = {} for episode in get_episodes_urls(show_url): try: show_keys[episode] = get_episode_keys(episode) print("Got keys for: " + episode) time.sleep(1) except: print("Failed to get keys for: " + episode) show_keys[episode] = None return show_keys print(json.dumps(get_show_keys("https://www.cbs.com/shows/young-sheldon"), indent=4))
Code:{ "https://www.cbs.com/shows/video/tixkIWrIhfILA3oy9WbFXJxvVaMK_yEb": null, "https://www.cbs.com/shows/video/TFM573y9QIby_8K_gbw9ivBVr1M7owcH": null, "https://www.cbs.com/shows/video/S0qTxP6AaKTa_EwhS6kKm5F3YBOgxKAd": null, "https://www.cbs.com/shows/video/PC0n8bq0Uh33eblPcLJOb5FtZni7jAU_": null, "https://www.cbs.com/shows/video/sUdo9DLzrRvP_sO3RepakOT7VxeqMEf1": null, "https://www.cbs.com/shows/video/5nnip9k8tgeEq9twd4BFkMfzYD1RWkY0": null, "https://www.cbs.com/shows/video/hmRFhL__zhdRAmO7IKkkL9WK74MIxoOT": null, "https://www.cbs.com/shows/video/Ov3FK8yz5RKzCxzLqrcvx_T1ofH2ta_L": null, "https://www.cbs.com/shows/video/XorI8DdalB_BoKzNlosjXSUaYzDOOuFm": null, "https://www.cbs.com/shows/video/x_PYklLUAfqQJXeB6f0iz6XW_pMieEUl": null, "https://www.cbs.com/shows/video/mx38Gj7FiQnnEkaSCYJzsz1_npcwgFjj": null, "https://www.cbs.com/shows/video/4Y8TBYUQcXBhPEPMLxgKbTLdnSsMHY4n": null, "https://www.cbs.com/shows/video/42C57oPI68GbG_j1bqEygQUfo_YxqFS0": null, "https://www.cbs.com/shows/video/cArEBGoWjqM1_dui7_vpJyuGxqC3_rH0": null, "https://www.cbs.com/shows/video/Kmllht1gNDE9_oWZoTdu880Q_OJ4mrS2": null, "https://www.cbs.com/shows/video/ZxPd1S94k8e_6wlNF1elrYSgsXb4kuK4": null, "https://www.cbs.com/shows/video/OJBf3mr_ImOor6wAfXJFtk95PV9fWA06": null, "https://www.cbs.com/shows/video/JwC5nklIcMIFjg0PD_MQPZBDlC8kO4UL": null, "https://www.cbs.com/shows/video/BGGQAOUAnXhaDGbVqk5Eqe8WAAKSH3X4": null, "https://www.cbs.com/shows/video/fcMMXDYnf0i58ezxXPT39S_pgAmXOADX": null, "https://www.cbs.com/shows/video/02cSnYnKe9Vvx33w0PytzrSshODpmnmb": null, "https://www.cbs.com/shows/video/m2pD46M8qyltOAObdPe3UtSOvJzRsKg_": null, "https://www.cbs.com/shows/video/_m0cd4K39Ig1BTXSE_Vx2urLY1PWpYFq": null, "https://www.cbs.com/shows/video/jwpMNzVFXvmfnf1lqaAs7ti0Ar86tJ_d": null, "https://www.cbs.com/shows/video/dfSzwT0JQWWEBlzfZhZBgNjW_lROzZbC": null, "https://www.cbs.com/shows/video/BI8UMAYrVZHOZc_9rHJfCntK0o3PIV3x": null, "https://www.cbs.com/shows/video/37OLw13B9CMUtK8bBScavPakujxj0_td": null, "https://www.cbs.com/shows/video/jdn_gmze5O34YTxNBAqZBku6agUmh_Mo": null, "https://www.cbs.com/shows/video/_mrvSg2MJlQpP6mokDlKu94uhuBBA9vU": null, "https://www.cbs.com/shows/video/R28XsPmNf85h3Mv6CoQ5qCmUPCPD2GgC": { "download": "N_m3u8DL-RE.exe https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/01/31/2305371715506/2582607_cenc_dash/stream.mpd --key 2f2bebd5b7654d35b9015ff9ebfbbfd4:531700bbed87168041a3697bfe5a9a98 -M format=mkv", "keys": [ "2f2bebd5b7654d35b9015ff9ebfbbfd4:531700bbed87168041a3697bfe5a9a98" ] }, "https://www.cbs.com/shows/video/ur6qMHnaXTY7ePyqh0D6tYo6gLsLdlkM": null, "https://www.cbs.com/shows/video/ct82smMrQDbogrBqISHZEJKj3IUOI1yo": null, "https://www.cbs.com/shows/video/68PUsXt2fO2jXaA6G4NNrUhyvAuMP545": { "download": "N_m3u8DL-RE.exe https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/01/31/2305369155652/2577614_cenc_dash/stream.mpd --key fa631c86dc6f4efb8f5211a1d95067b5:27385118a4753346860fd5b8984f6c0d -M format=mkv", "keys": [ "fa631c86dc6f4efb8f5211a1d95067b5:27385118a4753346860fd5b8984f6c0d" ] } }
Code:{ "https://www.cbs.com/shows/video/0nVQTPWH5ZZpMYFs4Rx2M8zJ59EKdYZy": { "download": "N_m3u8DL-RE.exe https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/02/2305756227912/2587880_cenc_dash/stream.mpd --key 799177987fa741b7b26d467c8e039e98:c95b962da9bfcff7cedb6939f2918257 -M format=mkv", "keys": [ "799177987fa741b7b26d467c8e039e98:c95b962da9bfcff7cedb6939f2918257" ] }, "https://www.cbs.com/shows/video/Z_4RnQXqeL7Fh_n03iunfo2bjkgl2BhZ": { "download": "N_m3u8DL-RE.exe https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/02/2305756227903/2579751_cenc_dash/stream.mpd --key 47aeeb3b9fea4cceb6575f367e45f34a:a80467fe9ebe7c47039048e6d8aec6da -M format=mkv", "keys": [ "47aeeb3b9fea4cceb6575f367e45f34a:a80467fe9ebe7c47039048e6d8aec6da" ] }, "https://www.cbs.com/shows/video/fL4xVgsV7F703qKp2EbKTRfzbX0MLkXh": { "download": "N_m3u8DL-RE.exe https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/02/2305756227905/2576935_cenc_dash/stream.mpd --key 1370d74115084b4bbd6c4ffe260c9ff4:0a09b5197935462f872b7ffb6098ac0c -M format=mkv", "keys": [ "1370d74115084b4bbd6c4ffe260c9ff4:0a09b5197935462f872b7ffb6098ac0c" ] } }
Edit: Was lazy to do that but the script can be modified to even return the full N_m3u8 command since you have the manifest and the keys.
Edit2: I added the N_m3u8 command as well.Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 3rd Mar 2024 at 04:38.
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
Just tried it get an error message
python cbs.py
Failed to get keys for: https://www.cbs.com/shows/video/Z_4RnQXqeL7Fh_n03iunfo2bjkgl2BhZ
Failed to get keys for: https://www.cbs.com/shows/video/fL4xVgsV7F703qKp2EbKTRfzbX0MLkXh
{
"https://www.cbs.com/shows/video/Z_4RnQXqeL7Fh_n03iunfo2bjkgl2BhZ": null,
"https://www.cbs.com/shows/video/fL4xVgsV7F703qKp2EbKTRfzbX0MLkXh": null
} -
You need local cdm in wvd format and US ip. I didn't bother giving the option to set a proxy since I just wanted the bare minimum solution.
Edit: With all due respect, I advise you to keep getting the keys using the classic way. Monitor network requests, get license, get pssh etc etc. I put the script more for programmers.Last edited by 2nHxWW6GkN1l916N3ayz8HQoi; 27th Feb 2024 at 03:26.
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
-
Spending 30 minutes max on that wasn't hard work for me. Hard work would mean spending hours, if not days, on that. And if that were the case I don't think I would've been so willing to share this. Thanks anyway. Kudos to @shellcmd for giving the basic idea.
Thanks!--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
Could someone please download these two episodes for me? Thank you so much in advance.
https://www.cbs.com/shows/video/iNoBx_eJxjeqFVZiTy56h_cXnDjILGpD/
https://www.cbs.com/shows/video/xrCLt8xtoBcHfdtSn8Nu1hlRat9GIuvQ/ -
Code:
N_m3u8DL-RE -M format=mkv --key 2544a4eeb7824c0b983042eee0ad79ed:0fbc74247e49d091ef95df65b79b2ade "https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310381123730/2582223_cenc_dash/stream.mpd" N_m3u8DL-RE -M format=mkv --key 823f1383062f488fa4d5d11d082fe5ee:d65420d370bd0ada0ef3ec8eb8a2e59a "https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310382147574/2589510_cenc_dash/stream.mpd"
-
If anyone could provide download links for these two episodes, I'd appreciate it. Thanks in advance.
https://www.cbs.com/shows/video/iNoBx_eJxjeqFVZiTy56h_cXnDjILGpD/
https://www.cbs.com/shows/video/xrCLt8xtoBcHfdtSn8Nu1hlRat9GIuvQ/ -
-
Code:
Filename: The Young and the Restless S51E101 - 2/27/2024 MPD URL: https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310381123730/2582223_cenc_dash/stream.mpd Key: 2544a4eeb7824c0b983042eee0ad79ed:0fbc74247e49d091ef95df65b79b2ade Command: N_m3u8DL-RE -M format=mkv --key 2544a4eeb7824c0b983042eee0ad79ed:0fbc74247e49d091ef95df65b79b2ade https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310381123730/2582223_cenc_dash/stream.mpd
Code:Filename: The Young and the Restless S51E103 - 2/29/2024 MPD URL: https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310382147574/2589510_cenc_dash/stream.mpd Key: 823f1383062f488fa4d5d11d082fe5ee:d65420d370bd0ada0ef3ec8eb8a2e59a Command: N_m3u8DL-RE -M format=mkv --key 823f1383062f488fa4d5d11d082fe5ee:d65420d370bd0ada0ef3ec8eb8a2e59a https://vod-gcs-cedexis.cbsaavideo.com/intl_vms/2024/02/20/2310382147574/2589510_cenc_dash/stream.mpd
-
-
Perusing his post history explains .... https://forum.videohelp.com/search.php?searchid=3065518 ... he is just a free-loader and nothing but a video-link will do!
One wonders where such people come from. After all computing has been taught in schools since the mid 80s.Noob Starter Pack. Just download everything DRM Not kidding!.
https://files.videohelp.com/u/301890/hellyes2.zip -
The link doesn't work. There's a redirection to that link after you copy the link from the magnifying glass.
This should probably do it
https://forum.videohelp.com/search.php?do=finduser&userid=304382&contenttype=vBForum_P...st&showposts=1 -
Noob Starter Pack. Just download everything DRM Not kidding!.
https://files.videohelp.com/u/301890/hellyes2.zip -
-
-
Thanks for the script ive got it all working now 2nHxWW6GkN1l916N3ayz8HQoi the only question I have regarding the first one for eps
manifest = re.search(r'"streamingUrl":"(.+?)"', response)
manifest = manifest.group(1).replace("\\/", "/")
How can i get it to print the mpd url at the end after it's given the key I see the section where it prints the keys wondered if it can also print the mpd from steamingUrl
print(f"[{key.type}] {key.kid.hex}:{key.key.hex()}") -
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
Thank you tried to change the url in this section which i think it reads from
print(json.dumps(get_show_keys("https://www.cbs.com/shows/csi-vegas/"), indent=4)) and it only returns {} but the other one for young sheldon works
Correction it works without the last / but only shows ep2 to download where ep3 is available as I used the older script for the keyLast edited by PSXman_uk; 3rd Mar 2024 at 10:59.
-
--[----->+<]>.++++++++++++.---.--------.
[*drm mass downloader: widefrog*]~~~[*how to make your own mass downloader: guide*] -
Please, can someone please give download links for these episodes?? I would appreciate it. TY!
https://www.cbs.com/shows/video/QIH2Y21q2pz5v_s52eos9uOrx_LTgq5C/
https://www.cbs.com/shows/video/RZdiv_7wgooi4OztmmVw_h3BBQh2eAjE/
https://www.cbs.com/shows/video/pVVrjhia5U8FrW0ptyer_qV0u8jv7AOn/
Similar Threads
-
Download subtitles from CBS.com video streams
By BobbyGee2003 in forum SubtitleReplies: 1Last Post: 28th Apr 2020, 06:02 -
Portable DLer for CBS?
By KermitJ in forum Video Streaming DownloadingReplies: 22Last Post: 1st Feb 2020, 12:18 -
CBS Grammy Download
By ghostrewel in forum Video Streaming DownloadingReplies: 8Last Post: 14th Feb 2019, 22:02 -
Could someone help me download a CBS News video?
By GDev in forum Video Streaming DownloadingReplies: 4Last Post: 21st Sep 2018, 01:50 -
RTMP and CBS
By RBCC in forum Video Streaming DownloadingReplies: 1Last Post: 22nd Mar 2018, 08:21