met94-zz / MessengerChatMediaDownloader

A utility for downloading photos/videos/audios from facebook messenger chats.
MIT License
5 stars 4 forks source link

Downloading pictures with highest possible resolution #1

Closed jacekmusial closed 3 years ago

jacekmusial commented 4 years ago

Is it possible to change default 480x480 resolution of downloaded pictures? Or is it rather impossible because this project use unoffical api? Only hope to get best media quality is to either use https://developers.facebook.com/docs/messenger-platform or write selenium based scrapper?

met94-zz commented 4 years ago

Take a look at https://github.com/Schmavery/facebook-chat-api/blob/master/DOCS.md#listen Attachments table. According to the table, there are the following fields available for photo attachments: ID, filename, thumbnailUrl, previewUrl, previewWidth, previewHeight, largePreviewUrl, largePreviewWidth, largePreviewHeight. The one I use to download a photo is largePreviewUrl but I haven't really checked other fields, perhaps one of them provides better resolution.

met94-zz commented 4 years ago

Just came across this method https://github.com/Schmavery/facebook-chat-api/blob/master/DOCS.md#resolvePhotoUrl. This is probably the solution.

jacekmusial commented 4 years ago

Thank you, I will test both methods shortly and create a MR. Currently just have problems downloading any media from the chats and after two tries my messenger account gets blocked and have to reset the password, so it's not easy. EDIT: My messenger account got suspended, and I found out that I do have Facebook account (!) so I will have to confirm my identity, which is really cumbersome on Facebook portal. Sorry, but MR will have to wait : (

outpoints commented 3 years ago

Did you ever fix this issue? @jacekmusial Trying to archive all my photos with my fiancee that we've sent to each other over the past five years 😅

jacekmusial commented 3 years ago

@outpoints @met94 Thank you for your message outpoints, I have completely forgot about it. Have look at https://github.com/met94/MessengerChatMediaDownloader/pull/2. But please be aware that I have to test delays , because Facebook is eager to block people.

outpoints commented 3 years ago

Thanks! @jacekmusial Will test out delays and see what works best! Appreciate it!

outpoints commented 3 years ago

Be careful @jacekmusial my Facebook account was just disabled... My profile disappeared off of Messenger for everyone and now they are saying this after submitting an appeal. image

I hope they actually do unban me but it's Facebook so who knows 😖

jacekmusial commented 3 years ago

@outpoints @jacekmusial I have found better solution, which worked for me. I was able to download 11k medias from one group chat. Open Chrome, log to the Messenger, open chat, open latest media and execute this script in the console https://gist.github.com/jacekmusial/5021754c01cdc26aa6183619e31aef2a

I hope you will get your account soon outpoints!

outpoints commented 3 years ago

I got my account back! This doesn't change which media is currently selected. It only spams the download for the same image, will need to figure out the class name for the next button 😅 @jacekmusial

Do you know why it downloads two of the images?

EDIT: Figured it out :)

jacekmusial commented 3 years ago

I am happy for you @outpoints. It worked for me on several occasions, but I suspect they might change class name. Yes, I have seen a few duplicated images but never was able to resolve it. Do you have any idea what might be causing it?

outpoints commented 3 years ago

I am happy for you @outpoints. It worked for me on several occasions, but I suspect they might change class name. Yes, I have seen a few duplicated images but never was able to resolve it. Do you have any idea what might be causing it?

Yes! It was simply removing downloadButton[0].click(); on line 13 that fixed it! I was able to download 16k images via that script :)