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
#1
I am new to programming and am trying to run some code. I am getting the following error:

adding screen shot -

https://imgur.com/CqPVaCE



some one plz help me

Thank you for your attention in this matter. Heart
Reply
#2
Please, don't post images of code and/or traceback.
Post your code in python tags, full traceback - in error tags.
See BBcode help for more info.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I am new to programming and am trying to run some code. I am getting the following error:

Traceback (most recent call last):
File "C:\Users\admin\Desktop\sunnxt.py", line 35, in <module>
mp4_data = subprocess.check_output ([mp4dump, '--format', 'json', '--verbosity', '3', FInput])
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\admin\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 992, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified


some one please help me

User has been warned for this post. Reason: No BBcode, Creating new threads unnecessarily
Reply
#4
You should post code(sunnxt.py) and not just Traceback.
Looking at it so are there two places that may need an absolute Path mp4dump and FInput
If have mp4dump in Windows Path,then may not need an absolute Path as i use in this test.
I can do a test,and also convert output to json data you can use.
import subprocess import json file_in = r'E:\div_code\mp4\Sample.mp4' mp4_data = subprocess.check_output([r'E:\div_code\mp4\mp4dump.exe', '--format', 'json', '--verbosity', '3', file_in]) mp4_data = mp4_data.decode() json_data = json.loads(mp4_data)
Test usage it's now a dictionary and when coming from json is normal to also have list mixed in.
>>> json_data[0] {'compatible_brand': 'isom', 'header_size': 8, 'major_brand': 'M4V ', 'minor_version': 1, 'name': 'ftyp', 'size': 28} >>> json_data[3] {'header_size': 24, 'name': 'BE7ACFCB97A9-42E8-9C71-9994-91E3AFAC', 'size': 1650} >>> json_data[0]['major_brand'] 'M4V ' >>> 
Reply
#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
#6
some one please help
Reply
#7
Give absolute(full path) to these as i shown in my code.
FInput = "encryptedvideo.mp4" FOutput = "decryptedvideo.mp4"
Reply
#8
(Apr-02-2019, 08:07 AM)snippsat Wrote: Give absolute(full path) to these as i shown in my code.
FInput = "encryptedvideo.mp4" FOutput = "decryptedvideo.mp4"

dont understand i already put full script
Reply
#9
Both are relative paths. A relative path depends on the current working directory.
If your cwd is in /home/user and your files are in /home/user/video, the relative path should
be 'video/encryptedvideo.mp4' or better a absolute path: '/home/user/video/encryptedvideo.mp4'
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply
#10
(Apr-02-2019, 08:07 AM)snippsat Wrote: Give absolute(full path) to these as i shown in my code.
FInput = "encryptedvideo.mp4" FOutput = "decryptedvideo.mp4"

encryptedvideo.mp4 - C:\Users\admin\Music\source.mp4


decryptedvideo.mp4 - C:\Users\admin\Music

full path
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to resolve FileNotFoundError llarkin6 6 1,654 Sep-29-2025, 05:45 PM
Last Post: noisefloor
  Can't Find Path hatflyer 8 3,668 Oct-30-2023, 06:17 AM
Last Post: Gribouillis
  FileNotFoundError: [WinError 2] The system cannot find the file specified NewBiee 2 3,902 Jul-31-2023, 11:42 AM
Last Post: deanhystad
  Need Help: FileNotFoundError:[Errno 2] No such file or directory python202209 5 7,707 Sep-12-2022, 04:50 AM
Last Post: python202209
  WebDriverException: Message: 'PATH TO CHROME DRIVER' executable needs to be in PATH Led_Zeppelin 1 4,059 Sep-09-2021, 01:25 PM
Last Post: Yoriz
Exclamation "System cannot find path specified"(Geany) kiwi99 2 6,059 Mar-18-2021, 07:37 PM
Last Post: kiwi99
  Difference between os.system("clear") and os.system("cls") chmsrohit 7 21,995 Jan-11-2021, 06:30 PM
Last Post: ykumar34
  FileNotFoundError: [Errno 2] No such file or directory: 5l3y3r 6 12,165 Nov-02-2020, 12:48 PM
Last Post: 5l3y3r
  How could i change the python interpreter path of os.system() 12019202386 2 4,165 Sep-02-2020, 06:58 AM
Last Post: DeaD_EyE
  Shutil FileNotFoundError: Errno 2 Help lord_kaiser 8 16,888 Aug-10-2020, 08:45 AM
Last Post: lord_kaiser

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.