v5.0
版本发布时间: 2022-12-04 12:28:31
snarfed/granary最新发布版本:v6.1(2023-09-16 22:20:19)
Breaking changes
- Drop Python 3.6 support. Python 3.7 is now the minimum required version.
- Twitter, Instagram, Mastodon:
- Drop
get_activities
cache
kwarg's support for App Engine memcache interface. It's now only used as a plaindict
.get_activities
will now make many small modifications, so if you pass an object that implements those as API calls, you'll probably want to batch those separately.
- Drop
- Twitter, Mastodon, Flickr, GitHub:
-
create
/preview
: support the AS1favorite
verb as well aslike
. (bridgy#1345)
-
- Atom:
- Switch to converting AS1
id
(instead ofurl
) to Atomid
.
- Switch to converting AS1
- Reddit:
- Implement
get_actor
.
- Implement
- Mastodon:
-
create
/preview
: allow non-Mastodon replies, ie activities that includeinReplyTo
URLs even if none of them point to a toot. (bridgy#1321) - Raise
requests.HTTPError
withresponse.status_code
502 instead ofJSONDecodeError
on non-JSON responses. This is synthetic, but more helpful for error handling.
-
- microformats2:
-
object_to_json
and related functions: handle all escaped HTML entities, not just&
<
>
. - Unify
microformats2.prefix_image_urls
andprefix_video_urls
into a newas1.prefix_urls
function.
-
- RSS:
- Remove
itunes:category
. It has to be one of Apple's explicit categories, which we aren't prepared to validate, so don't try.
- Remove
- ActivityStreams 2:
- Translate both
url
andurls
from AS1 into multi-valued AS2url
field.
- Translate both
- Move a number of utility methods from the
Source
class to a newas1
module:object_type
,merge_by_id
,is_public
,add_rsvps_to_event
,get_rsvps_from_event
,activity_changed
,append_in_reply_to
,actor_name
,original_post_discovery
. -
as1.original_post_discovery
: remove deprecatedcache
kwarg.
Non-breaking changes
- ActivityStreams 2:
- Fix spec compliance bug:
icon
andimage
are singly valued, not multiply valued. - Add new
is_public
method andPUBLIC_AUDIENCE
constant. - Prefer
"objectType": "featured"
first in theimage
field when converting from AS1, last in theicon
field. This matches the ActivityPub (Mastodon) convention of usingicon
for profile pictures andimage
for header images. - Propagate
url
values into newPropertyValue
attachments onPerson
objects; these end up in Mastodon's "profile metadata" link fields. -
to_as1
: if an attachment'smediaType
isimage/...
, overrideobjectType
and set it toimage
.
- Fix spec compliance bug:
- Twitter
- Trim alt text in line between post preview and creation
- Correctly trim Twitter alt text
- Facebook
- Scraping: extract post id and owner id from
data-ft
attribute and_ft_
query param more often instead ofstory_fbid
, which is now an opaque token that changes regularly. (facebook-atom#27)
- Scraping: extract post id and owner id from
- Instagram
- Add new
Instagram.scraped_json_to_activities
method.
- Add new
- GitHub
-
create
andpreview
: convert profile URLs to @-mentions, eghttps://github.com/snarfed
to@snarfed
(bridgy#1090).-
get_activities
withactivity_id
now supportsfetch_replies
andfetch_likes
.
-
-
- Reddit
- Add
cache
support toget_activities
.
- Add
- REST API
- Add new
/scraped
endpoint that acceptsPOST
requests with silo HTML as input. Currently only supports Instagram. Requiressite=instagram
,output=...
(any supported output format), and HTML as either raw request body or MIME multipart encoded file in theinput
parameter.
- Add new
- microformats2
- Add new
extra
andbody_class
kwargs toactivities_to_html
. - When converting
u-featured
images to AS1, add new non-standard"objectType": "featured"
field to distinguish them fromu-photo
. - Convert
p-note
to AS1summary
. - Bug fixes for converting
image
attachments tophoto
.
- Add new
-
Source.original_post_discovery
: add newmax_redirect_fetches
keyword arg.