delan / facepaste

Facebook album downloader
ISC License
22 stars 14 forks source link

New Version 12/07/2015 2.91 #27

Open DavePlater opened 8 years ago

DavePlater commented 8 years ago

Facebook changed more of their code it seems. I do not think this will fix for everyone, but it fixed mine. (en-US locale)

EDIT: Updated 12/12/2015 photos should work for more people, and videos should somewhat work.

Since we are doing this in a patchwork kind of way, Firefox will complain about it NOT being signed. You should be ok to use it anyway. Download link, drag and drop on the main folder, it should override any old facepaste versions: https://github.com/DavePlater/facepaste/raw/master/facepaste-2.91-fx.xpi (Or use the 'Install Add-on From File' in the Add-ons Manager)

Let me know how it works out for you all.

I have also forked it off into my own repo if it matters: https://github.com/DavePlater/facepaste

Xaemyl commented 8 years ago

Thanks for taking this over! Your fork seems to be working so far with firefox 42 for both pages and profiles. Still doesnt download videos, however, but it gets the rest!

TrueTenacity commented 8 years ago

Thanks man,

New update works wonderfully, downloaded all of my gf's fb pictures :-)

Unikat2000 commented 8 years ago

It doesn't work for me :( "error: no photo found on photo page, are youaccepting third party cookies" even when using an english version of firefox....you mean the system locale has to be en-US?

DavePlater commented 8 years ago

My locale is en-US so the filenames and patterns from facebook would go along with that. I don't know if it is the issue, but facepaste looks for specific names of things to find files and if they don't match the pattern it fails. I really haven't looked at that section of the code at all yet

Xaemyl commented 8 years ago

Yeah facebook must've made a code change, as I am now having the third party cookies error as well where it didnt before. Locale is set to en-US.

interceptorchamp commented 8 years ago

The new versions doesn´t download the pics, the following error message accours: "(album 1 photo 1) successfully received photo page, creating photo file (album 1 photo 1) error: no photo found on photo page, are youaccepting third party cookies?"

Firefox was already set to accept 3rd party cookies till they get invalid. I set the options to acknowledge for each cookie, however it didn´t help even with manually accepting the cookies.

Do you have an idea what could help? Can I manually set the firefox (German version) to en-US?

Any help will be much appreciated

Have a nice weekend

DavePlater commented 8 years ago

You guys who are seeing the "third party cookies" messages, could you open the BROWSER console windows (ctrl+shift+j i think) and run facepaste? Let me know if it throws out any messages that say it came from facepaste (it should give a line # too)

Xaemyl commented 8 years ago

I get: "TypeError: img is null" from facepaste.

DavePlater commented 8 years ago

Did you get a line number?

Xaemyl commented 8 years ago

Was just about to edit my comment. lol here it is: 520: p.photourl = link ? link.href : img.src;

DavePlater commented 8 years ago

Yup the non-english facebook pages must have different names. That happens when it cannot find anything labeled "fbPhotoImage" or "fbPhotosPhotoActionsItem"

DavePlater commented 8 years ago

Yeah I see it now. FB hadn't given me the new way photos are viewed until just today sometime. Working on it.

Xaemyl commented 8 years ago

Ahh looking over more of the code, I see what you're saying about the lables. heh

DavePlater commented 8 years ago

ok. i think i got both pictures and videos working. videos is still a little weird. Will update

Xaemyl commented 8 years ago

Excellent! :D Seems to work well so far! Even downloads videos (although it seems to download more videos than are on the actual page ... pulling the extras from cache perhaps?).

interceptorchamp commented 8 years ago

It works for now pics, but it doesn´t work for videos.

It would be nice if the videos would be downloaded as well ... i know it worked about a year ago perfectly :/

Anyway many thanks for helping.

DavePlater commented 8 years ago

Yeah, i put that in my commit notes about extra videos, not sure where it gets the extra videos from. Facebook does the delay load until scroll thing which i think makes things funky.

If you're not getting videos, does it say it even finds them? it should say something like "found x videos" as well as "found y photos" now

interceptorchamp commented 8 years ago

Nope, always "found 0 videos", even in dedicated video folders.

Downloading the pics works fine, even in big albums with several 100 pics (no scoll issue).

Unikat2000 commented 8 years ago

pics are working also for me again..thx :)

DavePlater commented 8 years ago

I cannot find an album that has pics AND video to try and reproduce. I you open a console window (CTRL+SHIFT+K I think), paste in this line of code:

Array.prototype.slice.call(document.querySelectorAll("a")).filter( function(x) { return (x.rel=="theater")&&(x.href.indexOf("videos")!=-1);});

If you get "Array [ ]" then it didn't find any videos, check that.

Also try:

Array.prototype.slice.call(document.querySelectorAll("a")).filter( function(x) { return (x.href.indexOf("videos")!=-1);});

To see if the videos show up in the Array []

interceptorchamp commented 8 years ago

Bote commands show the result Array [ ]

I noticed that Firefox 43 de-installed facepaste as not-certified add-on. To run facepaste, the user needs to set "xpinstall.signatures.required" in about:config to "false", then it can be re-installed. However this setting shall not be possible anymore in the upcoming Firefox 44 :/

DavePlater commented 8 years ago

The next thing would be to inspect element on the video link in the album. Ctrl+shift+k to bring up the console, switch over to "Inspector" and click the button to the left (looks like a square with a mouse cursor in it) Then click on a video link to see the source code for it. Try and copy/paste the whole "a" link to me.

For instance mine looks like:

<a href="video_url" aria-label="Video" ajaxify="video_url" rel="theater">
    <span class="_5ig0 _47hq">
        <div class="uiScaledImageContainer _55sd" style="width:206px;height:206px;">
            <img class="scaledImageFitWidth img" src="img_src" style="top:-17px;" alt="" height="366" width="206"></div><div class="_3uzl _3uzq _47hr">
            <i class="_3uzm _3uzo"></i>
        </div>
        <div class="_5ig6 _50f3">0:32</div>
    </span>
</a>

img_url and video_url are just placeholders for the really long facebook urls

interceptorchamp commented 8 years ago

I hope it helps.

Thank you for your patience :)

DavePlater commented 8 years ago

Hmm it looks like I should drop the rel="theater" and just use href.indexOf("videos")!=-1 Both of ours also have type=3 in the href. I can probably work with that

Xaemyl commented 8 years ago

Looks like it's broken again. It throws the "file exists" error even if you're downloading into a new empty folder.

DavePlater commented 8 years ago

Yeah fb changed again, the name of the image was not being found on the webpage. Which means it is trying to write a file with a blank name (which would just be the directory) I am looking for a fix

Xaemyl commented 8 years ago

Thanks for all your work!

Unikat2000 commented 8 years ago

thx for trying to help..... any progress so far?

DavePlater commented 8 years ago

The official mozilla addons has 2.91 which work if facebook has not updated you yet. On my github there is 2.91.1 which is still working for me as of yesterday. I have heard people have an even MORE different facebook that doesnt work still. If 2.91.1 doesnt work for you, have to wait for facebook to propagate the changes

Xaemyl commented 8 years ago

2.91.1 seems to be hanging on the "preparing" stage, so I'll wait a bit as maybe their changes havent propagated to me yet.

interceptorchamp commented 8 years ago

I had a look on your Github, but I can find only version 2.91 (without ".1"). Can you please point me to the most current version?

Xaemyl commented 8 years ago

https://github.com/DavePlater/facepaste/blob/master/facepaste.xpi (I believe lol)

giticeman commented 8 years ago

the new vr works with pic, but only for about ~50item .. and not all consecutives (it skip some item with the label "url: not yet know") i've tried with different profiles, but all the time, it fetch correctly the various album, and pic or video into those, but stop download always after about 50 object. FF 43

Xaemyl commented 8 years ago

Hmm. 2.91.1 for me (firefox 42) seems to hang (stuck on the grey "preparing" blocks) when trying to download photos, but downloads videos just fine. For both profiles and pages.

Unikat2000 commented 8 years ago

I can confirm that "prepare block" issue.....

DavePlater commented 8 years ago

The way I have to try and get photos from facebook is to "load the photo page" then wait and wait and wait until it fires all the javascript to make that "theater" screen popup (photo surrounded by black border). If it never loads a theater element, the page will never "give up". Do not have a work around for that. Should mean that 2.91 will still work for you though.

Xaemyl commented 8 years ago

Ahh ok. Could mean I'm not letting it wait long enough. I'll let it wait and come back with my findings.

Xaemyl commented 8 years ago

Well, after letting it run for about 40 minutes, it never started to download (stuck on the preparing blocks), and 2.91 does the "file already exists" thing even though the folder is empty. Ahh well. I'm just gonna have to wait for fb to make another change. heh

Xaemyl commented 8 years ago

Also upgraded to 43.0.1 and the same issue is happening. Curse my luck! hehe

interceptorchamp commented 8 years ago

Today I received the message for an update to Firefox 44.

As you sure know, the tweak for running an unsigned add-on will not be available in Firefox 44.

Will we be able to run facepast after an update to Firefox 44, or should be still run Firefox 43.x.x for some time?

I run facepaste, but the error "file exists" still appears. I can select the Folders which shall be downloaded, but that doesn´t help

Could you please help out? Can we be of any support for you?

captnfuture commented 8 years ago

Same to me... Firefox 43.x and 44.0 Download to a new empty folder:

`Preparing to download 1 albums: (album 1) Photos by noname


(album 1) creating album folder (album 1) fetching album index (album 1) parsing album index (album 1) found 62 photos (album 1) found 2 videos (album 1 photo 8) successfully received photo page, creating photo file (album 1 photo 8) error creating photo file: file exists (album 1 photo 7) successfully received photo page, creating photo file (album 1 photo 7) error creating photo file: file exists (album 1 photo 2) successfully received photo page, creating photo file (album 1 photo 2) error creating photo file: file exists`

And so on... But even no videos are selected, it downloads all videos, several times. Can I help with some logs or something? Thanks a lot for any help

captnfuture commented 8 years ago

Ah, something I have to say... I can install only facepaste-2.91-fx.xpi from 2 month ago. The recent one (facepaste.xpi) brings the error that the file is damaged.

captnfuture commented 8 years ago

Ok, now I downloaded the zip file and installed the recent facepaste.xpi from zip. With that version I have the same problem like Xaemyl. It stucks on the grey "preparing" blocks after downloading few files.

DavePlater commented 8 years ago

Yeah, I do not have a fix for it. Yet. When I do, it will make it to the official addons in mozilla. The problem is facebook's delayed loading thing. You load a picture page, some javascript fires and THEN the picture is shown. I do not have a good solution for this yet.

LeaTex commented 8 years ago

V2.91.1 is not working with FF 44.0.2.

It hangs out loading de album list. :/

captnfuture commented 8 years ago

Hi Dave Perhaps I have a solution. Why not use the fb picture download functionality directly from album page instead of open the picturepage and search for the picture...

function ILoadedAPage(myBrowser,p)
{
    regexParam = /\d{15}/; // this regex is not optimal but it works...
    var fbid = regexParam.exec(p.pageurl); // searching for fbid parameter in picturepage url
    var downloadPath = "https://www.facebook.com/photo/download/?fbid="+fbid; // create picture download url
    console.log("downloadPath: "+downloadPath);
    window.open(downloadPath); // only for TESTING, proof of concept

Now, this method works seamlessly. The only problem is I dont now how to handle the download in background. Without the download window.

DavePlater commented 8 years ago

I ran into some issues trying to use that last time, such as could not get the name of the image correctly. I will investigate again when I get some time. I hope what you have works!

GChatziioannou commented 8 years ago

hello, i also have the same problem as captnfuture. is the developer still working on the issue, or could i get some help on how make it work? captnfuture seems like found a fix, but i dont know how to implement it myself

please help :)

captnfuture commented 8 years ago

Hi Dave I have another way to solve the problem and bypass the java scripts. Just go and download thru the mobile site: mbasic.facebook.com There is no java at all. Pick the username from url and switch to mobile site (https://mbasic.facebook.com/"username"/photos).

DavePlater commented 8 years ago

I do not see any download links using that url format. In fact I would say that is worse, as you do not even get the full size photos.