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

Snapchat Artifacts not working #143

Open
buzzkillionair opened this issue Mar 2, 2023 · 4 comments
Open

Snapchat Artifacts not working #143

buzzkillionair opened this issue Mar 2, 2023 · 4 comments

Comments

@buzzkillionair
Copy link

I am currently trying to use the snapchat artifacts, however, they are not producing any output when they should be. I am unsure what is causing this. I am running it off Python version 3.11.2 and am on Windows 10. I have attached a screengrab of the processed files list.
image

@abrignoni
Copy link
Owner

Try ingesting the zips individually by using the Browse File button option.

@abrignoni
Copy link
Owner

If htey are part of one return (which I haven seen before) uncompress them all and put the contents in the same directory then use the browse folder option.

@seanmack56
Copy link

seanmack56 commented Mar 14, 2023

Try ingesting the zips individually by using the Browse File button option.

I have tried this and no difference

If htey are part of one return (which I haven seen before) uncompress them all and put the contents in the same directory then use the browse folder option.

I also tried this and no good. The logs were longer when I ran this but still nothing.

One thing I did notice was that the artifact snapChatHistory.py would produce the following error UnicodeDecodeError: 'charmap' codec can't decode byte 0x8d in position 20447: character maps to <undefined> To fix this I went into the artifact and when the file is opened, I added encoding="utf-8" which fixed some of the issues that I was having. Here is a snippoet of the change

OLD

if filename.startswith('chat_history.json'):
            data_list =[]
            with open(file_found, 'r') as fp:
                deserialized = json.load(fp)
            
            for x, y in deserialized.items():
                for mess in y:
                    typeline = x
                    #print(itemsdict)
                    if mess.get('From'):
                        directionality = mess['From']
                        directionality = 'From: ' + directionality
                    elif mess.get('To'):
                        directionality = mess['To']
                        directionality = 'To: ' + directionality
                        
                    mediatype = mess['Media Type']
                    created = mess['Created']
                    textm = mess['Text']
                    
                    data_list.append((created, directionality, textm, mediatype, typeline ))

NEW

if filename.startswith('chat_history.json'):
            data_list =[]
            with open(file_found, 'r', encoding="utf-8") as fp:
                deserialized = json.load(fp)
            
            for x, y in deserialized.items():
                for mess in y:
                    typeline = x
                    #print(itemsdict)
                    if mess.get('From'):
                        directionality = mess['From']
                        directionality = 'From: ' + directionality
                    elif mess.get('To'):
                        directionality = mess['To']
                        directionality = 'To: ' + directionality
                        
                    mediatype = mess['Media Type']
                    created = mess['Created']
                    textm = mess['Text']
                    
                    data_list.append((created, directionality, textm, mediatype, typeline ))
                    

@abrignoni
Copy link
Owner

The issue most likely then is that there are errors in the way python is decoding the file at open.
A good solution is to add backslashreplace so it doesnt choke up with values it cant interpret.

See example here:
https://www.learnbyexample.org/python-open-function/

If it works for your data set let me know and I will add to the code.

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

3 participants