[bluesky] handle exceptions during file extraction
This commit is contained in:
@@ -150,9 +150,15 @@ class BlueskyExtractor(Extractor):
|
|||||||
|
|
||||||
if "images" in media:
|
if "images" in media:
|
||||||
for image in media["images"]:
|
for image in media["images"]:
|
||||||
files.append(self._extract_media(image, "image"))
|
try:
|
||||||
|
files.append(self._extract_media(image, "image"))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
if "video" in media and self.videos:
|
if "video" in media and self.videos:
|
||||||
files.append(self._extract_media(media, "video"))
|
try:
|
||||||
|
files.append(self._extract_media(media, "video"))
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
post["count"] = len(files)
|
post["count"] = len(files)
|
||||||
return files
|
return files
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ __tests__ = (
|
|||||||
},
|
},
|
||||||
"user": {
|
"user": {
|
||||||
"avatar" : "https://cdn.bsky.app/img/avatar/plain/did:plc:eclio37ymobqex2ncko63h4r/bafkreidvvqj5jymmpaeklwkpq6gi532el447mjy2yultuukypzqm5ohfju@jpeg",
|
"avatar" : "https://cdn.bsky.app/img/avatar/plain/did:plc:eclio37ymobqex2ncko63h4r/bafkreidvvqj5jymmpaeklwkpq6gi532el447mjy2yultuukypzqm5ohfju@jpeg",
|
||||||
"banner" : "https://cdn.bsky.app/img/banner/plain/did:plc:eclio37ymobqex2ncko63h4r/bafkreiaiorkgl6t2j5w3sf6nj37drvwuvriq3e3vqwf4yn3pchpwfbekta@jpeg",
|
"banner" : "https://cdn.bsky.app/img/banner/plain/did:plc:eclio37ymobqex2ncko63h4r/bafkreidlzzmt7sy2n6imz5mg7siygb3cy4e526nvbjucczeu5cutqro5ni@jpeg",
|
||||||
"createdAt" : "2023-06-05T18:50:31.498Z",
|
"createdAt" : "2023-06-05T18:50:31.498Z",
|
||||||
"description" : "In-depth, independent reporting to better understand the world, now on Bluesky. News tips? Share them here: http://nyti.ms/2FVHq9v",
|
"description" : "In-depth, independent reporting to better understand the world, now on Bluesky. News tips? Share them here: http://nyti.ms/2FVHq9v",
|
||||||
"did" : "did:plc:eclio37ymobqex2ncko63h4r",
|
"did" : "did:plc:eclio37ymobqex2ncko63h4r",
|
||||||
@@ -373,7 +373,7 @@ __tests__ = (
|
|||||||
"followsCount" : int,
|
"followsCount" : int,
|
||||||
"handle" : "nytimes.com",
|
"handle" : "nytimes.com",
|
||||||
"instance" : "nytimes.com",
|
"instance" : "nytimes.com",
|
||||||
"indexedAt" : "2024-01-20T05:04:46.757Z",
|
"indexedAt" : "iso:datetime",
|
||||||
"labels" : [],
|
"labels" : [],
|
||||||
"postsCount" : int,
|
"postsCount" : int,
|
||||||
},
|
},
|
||||||
@@ -443,6 +443,13 @@ __tests__ = (
|
|||||||
"#class" : bluesky.BlueskyPostExtractor,
|
"#class" : bluesky.BlueskyPostExtractor,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"#url" : "https://bsky.app/profile/jacksonlab.bsky.social/post/3m2ms33o6p52k",
|
||||||
|
"#comment" : "'external' embed - 'images': [], 'video': null",
|
||||||
|
"#class" : bluesky.BlueskyPostExtractor,
|
||||||
|
"#count" : 0,
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"#url" : "https://bsky.app/saved",
|
"#url" : "https://bsky.app/saved",
|
||||||
"#class" : bluesky.BlueskyBookmarkExtractor,
|
"#class" : bluesky.BlueskyBookmarkExtractor,
|
||||||
|
|||||||
Reference in New Issue
Block a user