Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError #5

Open
legaspacho opened this issue Nov 25, 2020 · 4 comments
Open

FileNotFoundError #5

legaspacho opened this issue Nov 25, 2020 · 4 comments

Comments

@legaspacho
Copy link

legaspacho commented Nov 25, 2020

Hi,

First of all, thank you for the code it is exactly what I have been looking for for a couple of days! I tried to run the code for a few different backups in order to extract my photos from them. It worked well for 2/3 of my backups.

I am basically running the following code with the correct key and udid:

b=iOSbackup(udid="something",
	derivedkey="mykey")

b.getFolderDecryptedCopy(
 	'Media',
 	targetFolder='restored-photos',
 	includeDomains='CameraRollDomain',
 	excludeFiles='%.MOV'
)

For one of the backup I am getting the following error:

Exception ignored in: <function iOSbackup.__del__ at 0x000001D68131BB80>
Traceback (most recent call last):
  File "C:...\anaconda3\lib\site-packages\iOSbackup\__init__.py", line 103, in __del__
    os.remove(self.manifestDB)
TypeError: remove: path should be string, bytes or os.PathLike, not NoneType
Traceback (most recent call last):

File "D:\....\Recover iphone backup\iphone_photo_backup.py", line 45, in <module>
    b.getFolderDecryptedCopy(

 File "C:\...\anaconda3\lib\site-packages\iOSbackup\__init__.py", line 459, in getFolderDecryptedCopy
    (info,decrypted)=self.getFileDecryptedData(fileNameHash=f['fileID'],manifestData=f['file'])

 File "C:\...\anaconda3\lib\site-packages\iOSbackup\__init__.py", line 543, in getFileDecryptedData
    with open(os.path.join(self.backupRoot, self.udid, fileNameHash[:2], fileNameHash), 'rb') as infile:

FileNotFoundError: [Errno 2] No such file or directory: 'D:\\Apple\\Path3\\MobileSync\\Backup\\MY-UDID\\78\\7831d13dae1b030538542eec78e456049beebf23'

This file does not exist in the marked folder but I am unsure 1) why it is looking to open it and 2) if there is a way it could be ignored.

Thanks,

@avibrazil
Copy link
Owner

avibrazil commented Dec 8, 2020

iOSbackup is trying to export it because it appears in the catalog.
It is very strange it appears in the catalog but doesn't exist in the backup.

Do the following to try see the iOS file name for this faulty backup file:

from iOSbackup import iOSbackup

b=iOSbackup(udid="000…2E", derivedkey="f6…ff")

files=b.getBackupFilesList()

for f in files:
    if f['backupFile']=='7831d13dae1b030538542eec78e456049beebf23':
        print(f"{f['backupFile']}: {f['name']}")

Then add it to excludeFiles like this:

b.getFolderDecryptedCopy(
 	'Media',
 	targetFolder='restored-photos',
 	includeDomains='CameraRollDomain',
 	excludeFiles=['%.MOV', '%file-found-above.gif']
)

Let me know what you've found, maybe this is something I'll need to fix in the original code.

@avibrazil
Copy link
Owner

avibrazil commented Dec 8, 2020

In a few weeks I'll be releasing a new package that extract photos and videos from your backup in a curated way. It will use photo caption, face names, places, stories and albums you have tagged in your media to give you well tagged and nicely renamed files like:

2020.10.22-17.34.52 ★ Clara playing with water 【Avi Alkalay·︎iPhone 11 Pro】.jpg
2020.10.25-22.30.47 ▶️ Sun rise 【Avi Alkalay·︎iPhone 11 Pro timelapse】.mov
2020.10.27-11.41.02 • Beach in Guarujá 【Avi Alkalay·︎iPhone 11 Pro】.heic

@legaspacho
Copy link
Author

Hi avibrazil,

I edited the code to exclude the file found but it still does not work. I will wait for your next release to have it working.

Looking forward to the update !

@avibrazil
Copy link
Owner

This "next release" is actually a different project. But I'll let you know here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants