Python Forum
FileNotFoundError...System cannot find the path specified
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FileNotFoundError...System cannot find the path specified
#5
code

# -*- coding: utf-8 -*-
from subprocess import call
import subprocess
import re
import xmltodict
import json
import re
import requests
import base64
import time
import os
import argparse
import binascii
import configparser
import sys
from requests import Request, Session

currentFile = __file__
realPath = os.path.realpath(currentFile)
dirPath = os.path.dirname(realPath)
dirName = os.path.basename(dirPath)
wvDecrypterexe = dirPath + "/binaries/wvDecrypter.exe"
challengeBIN = dirPath + "/binaries/challenge.bin"
licenceBIN = dirPath + "/binaries/licence.bin"
mp4dump = dirPath + "/binaries/mp4dump.exe"

if os.path.isfile(challengeBIN) : os.remove (challengeBIN)
if os.path.isfile(licenceBIN) : os.remove (licenceBIN)

WV_SYSTEM_ID = 'ed ef 8b a9 79 d6 4a ce a3 c8 27 dc d5 1d 21 ed'
FInput = "encryptedvideo.mp4"
FOutput = "decryptedvideo.mp4"
KID = "a4c1cdo8-39eb-58el-b646-8bfdf427e60a"
pssh = None
mp4_data = subprocess.check_output ([mp4dump, '--format', 'json', '--verbosity', '3', FInput])
mp4_data = json.loads(mp4_data)


for atom in mp4_data:
    if atom['name'] == 'moov':
        for child in atom['children']:
            if child['name'] == 'pssh' and child['system_id'] == f'[(WV_SYSTEM_ID)]':
                pssh = re.sub(r'^\[08 01 ([a-f0-9 ]+)\]$', r'\1', child['data'])
                pssh = re.sub(r'\8+', '', pssh)
                pssh = pssh.strip('[]')
                pssh = base64.b64encode (binascii.unhexlify(pssh)).decode('utf-8')
                print(f'PSSH: (pssh)')
                break 
				
				
				
				
if not pssh:
    print('unable to extract PSSSH')
    sys.exit(1)

PSSH = pssh
CERTIFICATE = ""
cookies = ""
token = ""
licurl = "https://www.sunnxt.com/content/license/?content_id=70994="



wvdecrypt_video = subprocess.Popen([wvDecrypterexe, '--kid',KID, '--pssh', PSSH, '--certificate', CERTIFICATE, '--input', FInput, '--output', FOutput, '--debug'])
time.sleep(5)

with open(challengeBIN,"rb") as fd:
        challenge_decoded =fd.read()

data = challenge_decoded
		
headers = {

'accept': '*/*',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'en-GB,en-US;q=0.9,en;q=0.8',
'content-length': '4623',
'cookie': '_ga=GA1.2.975246051.1552289966; _fbp=fb.1.1552290075724.1403904187; _gid=GA1.2.396418812.1554157407; laravel_session=FjoUcOZyhVfX6dc39N85kGddMKV0DROVRS7wZLbU; _gat=1; mp_8417b02dcd9f6d45a5d3a0a7eadb1c4b_mixpanel=%7B%22distinct_id%22%3A%209176320%2C%22%24device_id%22%3A%20%221696bb128e0163-0af1f5159fe13b-3e3d5200-15f900-1696bb128e1f9%22%2C%22%24initial_referrer%22%3A%20%22https%3A%2F%2Fwww.google.com%2F%22%2C%22%24initial_referring_domain%22%3A%20%22www.google.com%22%2C%22__mps%22%3A%20%7B%7D%2C%22__mpso%22%3A%20%7B%7D%2C%22__mpus%22%3A%20%7B%7D%2C%22__mpa%22%3A%20%7B%7D%2C%22__mpu%22%3A%20%7B%7D%2C%22__mpr%22%3A%20%5B%5D%2C%22__mpap%22%3A%20%5B%5D%2C%22%24search_engine%22%3A%20%22google%22%2C%22data%20Connection%22%3A%20%22NULL%22%2C%22city%22%3A%20%22%22%2C%22country%22%3A%20%22India%22%2C%22gps%22%3A%20%22NULL%22%2C%22session%20id%22%3A%20%22NULL%22%2C%22email%20id%22%3A%20%22ambadysuresh9745%40gmail.com%22%2C%22mobile%20no%22%3A%20%22NULL%22%2C%22Device-ID%22%3A%20%22NULL%22%2C%22%24user_id%22%3A%209176320%2C%22user%20id%22%3A%209176320%7D; XSRF-TOKEN=eyJpdiI6IlRaY2J6dm5tTHJuY0pNV3NrV0hqYnc9PSIsInZhbHVlIjoiRENlMzdEQ1VpTWxnMXhGWHRhdHhcL0VZc3ZQM016QnNVR2tRZ1QwM3psQm02MnhRMFk1Q1hMWUs4ZXFDeWk2ZU9oSGI1clE2cnp3aERjSWNcL3hOUHNUdz09IiwibWFjIjoiNWY2ZjM2MDc3ZmMyNWU1ODUxMDY4YmNjZThkN2FhMGMzYjAwYWQ4ZjljYzY3MDhmNTNjMjg0MmE0MDU0MmY1MiJ9',
'origin':'https://www.sunnxt.com',
'referer': 'https://www.sunnxt.com/movie/detail/6604/Nela-Ticket/',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36',
}

		
		
		
print("\nSending POST request to license url...\n")
resp = requests.post(url=licurl, data=data, headers=headers)
license_decoded = resp.content
print(license_decoded)
licenseb64 = base64.b64encode(license_decoded)	

with open(licenceBIN, "wb") as ld:
	ld.write(license_b64)
	
stdoutdata, stderrdata = wvdecrypt_video.communicate()

if str(wvdecrypt_video.returncode) == "0":
	os.remove(challengeBIN)
	os.remove(licenceBIN)
likes this post
Reply


Messages In This Thread
RE: [python]FileNotFoundError...System cannot find the path specified - by alex9745 - Apr-02-2019, 04:46 AM
script error - by alex9745 - Apr-01-2019, 02:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't Find Path hatflyer 8 1,161 Oct-30-2023, 06:17 AM
Last Post: Gribouillis
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 1,637 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  Need Help: FileNotFoundError:[Errno 2] No such file or directory python202209 5 2,728 Sep-12-2022, 04:50 AM
Last Post: python202209
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 2,244 Sep-09-2021, 01:25 PM
Last Post: Yoriz
Exclamation "System cannot find path specified"(Geany) kiwi99 2 3,931 Mar-18-2021, 07:37 PM
Last Post: kiwi99
  Difference between os.system("clear") and os.system("cls") chmsrohit 7 16,752 Jan-11-2021, 06:30 PM
Last Post: ykumar34
  FileNotFoundError: [Errno 2] No such file or directory: 5l3y3r 6 8,203 Nov-02-2020, 12:48 PM
Last Post: 5l3y3r
  How could i change the python interpreter path of os.system() 12019202386 2 2,622 Sep-02-2020, 06:58 AM
Last Post: DeaD_EyE
  Shutil FileNotFoundError: Errno 2 Help lord_kaiser 8 10,618 Aug-10-2020, 08:45 AM
Last Post: lord_kaiser
  Getting FileNotFoundError: [Errno 2] ,if tries to acees same file from sub-directory pmpinaki 2 2,569 May-04-2020, 03:39 PM
Last Post: pmpinaki

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020