[facebook] raise AuthRequired for profiles requiring cookies (#7962)
This commit is contained in:
@@ -315,6 +315,11 @@ class FacebookExtractor(Extractor):
|
|||||||
|
|
||||||
for _ in range(self.fallback_retries + 1):
|
for _ in range(self.fallback_retries + 1):
|
||||||
profile_photos_page = self.request(profile_photos_url).text
|
profile_photos_page = self.request(profile_photos_url).text
|
||||||
|
|
||||||
|
if ('"props":{"title":"This content isn\'t available right now"' in
|
||||||
|
profile_photos_page):
|
||||||
|
raise exception.AuthRequired("cookies")
|
||||||
|
|
||||||
set_id = self._extract_profile_set_id(profile_photos_page)
|
set_id = self._extract_profile_set_id(profile_photos_page)
|
||||||
avatar_page_url = text.extr(
|
avatar_page_url = text.extr(
|
||||||
profile_photos_page, ',"profilePhoto":{"url":"', '"')
|
profile_photos_page, ',"profilePhoto":{"url":"', '"')
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# published by the Free Software Foundation.
|
# published by the Free Software Foundation.
|
||||||
|
|
||||||
from gallery_dl.extractor import facebook
|
from gallery_dl.extractor import facebook
|
||||||
|
from gallery_dl import exception
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
|
||||||
@@ -65,6 +66,13 @@ __tests__ = (
|
|||||||
"#count" : 0,
|
"#count" : 0,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://www.facebook.com/Forgetmen0w/photos",
|
||||||
|
"#comment" : "'This content isn't available right now'",
|
||||||
|
"#class" : facebook.FacebookPhotosExtractor,
|
||||||
|
"#exception": exception.AuthRequired,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://www.facebook.com/facebook/avatar",
|
"#url" : "https://www.facebook.com/facebook/avatar",
|
||||||
"#class" : facebook.FacebookAvatarExtractor,
|
"#class" : facebook.FacebookAvatarExtractor,
|
||||||
|
|||||||
Reference in New Issue
Block a user