フルサイズの画像ではなくサムネイルのURLのリストのみを作成し、タグ付きの場所を取得しないにもかかわらず、AppleScriptのようなスクリプトを使用します。私は、彼らが常にフルサイズのバージョンにならないように、大960個のピクセルで、最大960にある画像の大きなバージョンのリストを作成するには、以下のようなスクリプトを使用し
paragraphs of (do shell script "cat /tmp/ids_of_users")
repeat with user in result
set s to "open -gagoogle\\ chrome https://www.facebook.com/profile.php?id=" & user & "\\&sk=photos_albums"
tell application "Google Chrome"
close windows
repeat until exists window 1 -- the open command sometimes results in an `LSOpenURLsWithRole() failed` error
do shell script s
delay 5
end repeat
repeat while loading of tabs of window 1 contains true
delay 1
end repeat
tell active tab of window 1
set albums to execute javascript "o='';a=document.querySelectorAll('.albumThumbLink');for(i=0;e=a[i];i++){o+=e.href+'\\n'};o"
end tell
if albums is not missing value and albums is not "" then
repeat with p in paragraphs 1 thru -2 of albums
do shell script "open -jgagoogle\\ chrome " & quoted form of p
delay 1
end repeat
repeat while loading of tabs of window 1 contains true
delay 1
end repeat
tell application "Google Chrome" to tell active tab of window 1
repeat while loading is true
delay 1
end repeat
set src to execute javascript "document.body.innerHTML"
if src contains "no photos in this album" then exit repeat
if src contains "you may not have permission to view this page" then return -- your account got restricted for a week by Facebook
set prev to 0
repeat
set y to execute javascript "document.querySelector('.fbTimelineStarGridSeparator').scrollIntoView();window.scrollY"
delay 1
if y is prev then exit repeat
set prev to y
end repeat
set out to execute javascript "o='';a=document.querySelectorAll('.tagWrapper i');for(i=0;e=a[i];i++)o+=e.getAttribute('style').replace(/.*?\\(/,'').replace(/\\).*/,'')+'\\n';o"
if out is not "" then
do shell script "printf %s " & quoted form of out & "|sed s/^/" & user & "\\ />>/tmp/albums"
end if
end tell
end if
end tell
end repeat
。
paragraphs of (do shell script "cat /tmp/ids_of_images")
repeat with photoid in result
tell application "Google Chrome"
close windows
repeat until exists window 1
do shell script "open -gagoogle\\ chrome https://www.facebook.com/" & photoid
delay 5
end repeat
repeat while loading of tabs of window 1 contains true
delay 1
end repeat
tell active tab of window 1
set src to execute javascript "document.querySelector('.spotlight').src"
if src is not missing value then
do shell script "echo '" & src & "'>>/tmp/bigger"
end if
end tell
end tell
end repeat
いくつかの写真は、多くの場合、すべての写真のページに表示されていないが、アルバムを個別に閲覧されているときに表示されています。
https://www.facebook.com/profile.php?id=<user id>&sk=photos_albums
は、ユーザーのアルバムのためのページにリダイレクトされ、
https://www.facebook.com/profile.php?id=<user id>&sk=photos_all
は、ユーザーによって投稿されたすべての写真のためのページにリダイレクトされ、そして
https://www.facebook.com/<fbid of image or user>
は、画像やユーザのためのページにリダイレクトされます。私は私の友人ではないユーザーのプロファイルを表示することができないように、自分のアカウントが時々週間制限されます、およそ千または数千ページ以上をロードした後
。
イメージのファイル名の2番目のアンダースコア区切りフィールドの数字は、イメージのIDです。たとえば、は12208495_10102454385528521_4749095086285673716_n.jpg
です。
ユーザーIDは、a.
で始まり、fb.
で始まるアルバム識別子の最初の番号で始まるアルバム識別子の最後の番号です。
https://www.facebook.com/photo/download/?fbid=<fbid of photo>
は、画像のフルサイズバージョンにリダイレクトするために使用されるが、それは今年の初めに動作を停止しました。
https://graph.facebook.com/<user id>/picture?width=9999
はまだグラフAPIが使用できなくなったにもかかわらず働かないユーザーのフルサイズのプロフィール画像にリダイレクトされます。
「公的に利用可能」とは、「利用規約」によりデータをスクラップできることを意味するものではありません。 –