Bluesky

 view release on metacpan or  search on metacpan

lib/Bluesky.pm  view on Meta::CPAN

            my $blob = $self->uploadFile( $vid, $mime );
            $blob || return $blob->throw;
            return {
                '$type' => 'app.bsky.embed.video',
                video   => $blob,
                ( @captions            ? ( captions    => \@captions )   : () ), ( defined $alt ? ( alt => $alt ) : () ),
                ( defined $aspectRatio ? ( aspectRatio => $aspectRatio ) : () )
            };
            if (0) {

                # You may upload videos as plain blobs but this endpoint allows you to check on processing status
                # Testing because HTTP::Tiny does not support multipart
                # I need to get auth token for new service via 'com.atproto.server.getServiceAuth'
                my $boundary = join '', map { [ 0 .. 9, 'a' .. '4' ]->[ rand 36 ] } 1 .. 5 + rand(10);
                my $job      = $at->post(
                    'https://video.bsky.app/xrpc/app.bsky.video.uploadVideo?did=' . $at->did . '&name=upload.mp4',
                    {   headers => { 'content-type' => 'multipart/form-data; boundary=' . $boundary },
                        content =>
                            qq[--$boundary\x0d\x0aContent-Disposition: form-data; name="file_name"; filename="file_name_1.mp4"\x0d\x0aContent-Type: video/mp4\x0d\x0a$vid\x0d\x0a--$boundary--\x0d\x0a]
                    }
                );

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.400 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )