omerdn1 / otter.ai-api Goto Github PK
View Code? Open in Web Editor NEWUnofficial API for Otter.ai
License: MIT License
Unofficial API for Otter.ai
License: MIT License
Do you know what the Upload URL is?
Could I commission your help?
Hey, thanks for creating this package.
Unfortunately, I can't grab any conversations from otter.ai. Is it possible that they made changes to the side that breaks the code in this repo? I'm using the following code:
const OtterApi = require('otter.ai-api').default;
const otterApi = new OtterApi({
email: 'email', // Your otter.ai email
password: 'pw', // Your otter.ai password
});
async function main() {
await otterApi.init() // Performs login
await otterApi.getSpeeches(); // Gets all speeches
}
main();
I tried for one speech and all. And then I'm getting the following error after a successful login:
Successfuly logged in to Otter.ai
/Users/jacquesthibodeau/Desktop/Code/ai-alignment-audio-transcription/otter.ai-api/node_modules/axios/lib/core/createError.js:16
var error = new Error(message);
^
Error: Request failed with status code 404
at createError (/Users/jacquesthibodeau/Desktop/Code/ai-alignment-audio-transcription/otter.ai-api/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/jacquesthibodeau/Desktop/Code/ai-alignment-audio-transcription/otter.ai-api/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/jacquesthibodeau/Desktop/Code/ai-alignment-audio-transcription/otter.ai-api/node_modules/axios/lib/adapters/http.js:260:11)
at IncomingMessage.emit (node:events:539:35)
at endReadableNT (node:internal/streams/readable:1344:12)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Then there's a really long json response. But I see this at the end:
'user-agent': [ 'User-Agent', 'axios/0.21.1' ],
host: [ 'Host', 'otter.ai' ]
}
},
data: { status: 'failed', message: 'Speech not found', code: 13 }
},
isAxiosError: true,
toJSON: [Function: toJSON]
}
Any ideas if this is fixable?
Hi,
When I do getSpeeches I get a response object in output and somewhere in it, I can see the message 'Not logged in'.
Any idea why?
I've been trying to use the basic example from the readme, and getting an Unauthorized error :(
Alfred/alfred-otter master ●✚ node ottetest.mjs
(node:57037) ExperimentalWarning: The ESM module loader is experimental.
[Function: OtterApi]
Error: Request failed with status code 401
at createError (/Users/sitalov/Dropbox/SoftwareEngineering/Projects/Alfred/otter.ai-api/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/sitalov/Dropbox/SoftwareEngineering/Projects/Alfred/otter.ai-api/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/sitalov/Dropbox/SoftwareEngineering/Projects/Alfred/otter.ai-api/node_modules/axios/lib/adapters/http.js:237:11)
at IncomingMessage.emit (events.js:333:22)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
config: {
url: 'https://otter.ai/forward/api/v1/speeches',
method: 'get',
params: { userid: undefined },
headers: {
Accept: 'application/json, text/plain, */*',
'User-Agent': 'axios/0.19.0'
},
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
data: undefined
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
socket: [Function (anonymous)],
abort: [Function (anonymous)],
aborted: [Function (anonymous)],
error: [Function (anonymous)],
timeout: [Function (anonymous)],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: 'otter.ai',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 9,
connecting: false,
_hadError: false,
_parent: null,
_host: 'otter.ai',
_readableState: [ReadableState],
readable: true,
_maxListeners: undefined,
_writableState: [WritableState],
writable: false,
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular *1],
[Symbol(res)]: [TLSWrap],
[Symbol(asyncId)]: 19,
[Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]: 0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object]
},
_header: 'GET /forward/api/v1/speeches HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'User-Agent: axios/0.19.0\r\n' +
'Host: otter.ai\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
path: '/forward/api/v1/speeches',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 401,
statusMessage: 'Unauthorized',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
responseUrl: 'https://otter.ai/forward/api/v1/speeches',
redirects: [],
[Symbol(kCapture)]: false
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
_redirectable: Writable {
_writableState: [WritableState],
writable: true,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 0,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'https://otter.ai/forward/api/v1/speeches',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
'user-agent': [Array],
host: [Array]
}
},
response: {
status: 401,
statusText: 'Unauthorized',
headers: {
date: 'Fri, 25 Dec 2020 23:40:41 GMT',
'content-type': 'application/json',
'content-length': '58',
connection: 'close',
server: 'nginx/1.16.1',
vary: 'Cookie',
'x-frame-options': 'SAMEORIGIN'
},
config: {
url: 'https://otter.ai/forward/api/v1/speeches',
method: 'get',
params: [Object],
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
data: undefined
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype],
_eventsCount: 6,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: false,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: 0,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
_header: 'GET /forward/api/v1/speeches HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'User-Agent: axios/0.19.0\r\n' +
'Host: otter.ai\r\n' +
'Connection: close\r\n' +
'\r\n',
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'GET',
maxHeaderSize: undefined,
path: '/forward/api/v1/speeches',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
data: { status: 'Error', message: 'Not logged in', code: 1 }
},
isAxiosError: true,
toJSON: [Function (anonymous)]
}
Successfuly logged in to Otter.ai
looking at the code it seems login is happening async, so if I just try to create client and use it breaks.. let me play with that
Hi & thanks for the library
I am wondering if you can tell me how to convert the offsets into actual time e.g.
transcripts: [
{
start_offset: 52800,
end_offset: 493440,
Do you know what measurement system those values are in?
How would you convert them into seconds or minutes from the start of the recording?
Thanks for any help you can provide
It does not seem to be possible to install the package from npm anymore :(
I'm getting the following error: TypeError: OtterApi is not a constructor
.
const otterApi = new OtterApi({
^
TypeError: OtterApi is not a constructor
at file:///Users/jacquesthibodeau/Desktop/Code/ai-alignment-audio-transcription/otter.ai-api/otterai_extractor.js:3:18
at ModuleJob.run (node:internal/modules/esm/module_job:198:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:409:24)
at async loadESM (node:internal/process/esm_loader:85:5)
at async handleMainPromise (node:internal/modules/run_main:61:12)
If I look at index.js in the repo, it does look like a constructor? First part of the code is:
class OtterApi {
constructor(options = {}) {
this.options = options;
this.user = {};
this.csrfToken = '';
}
init = async () => {
await this.#login();
};
The code I'm trying to run (though I had to add "type": "module"
to get the import to work):
import OtterApi from 'otter.ai-api';
const otterApi = new OtterApi({
email: 'email', // Your otter.ai email
password: 'pw', // Your otter.ai password
});
await otterApi.init() // Performs login
I get the error when using new OtterApi()
. I'm not sure how to resolve this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.