Missing `url` property

Trying to build a Trigger suggested by Thomas Franks where you can export an audio file to Whisper and then into Notion. I keep getting the following error and down know what to do to fix it or how. I have asked ChatGPT, but I am not a coder.

This is the error - Missing url property

This is the code
import stream from “stream”;
import { promisify } from “util”;
import fs from “fs”;
import got from “got”;

export default defineComponent({
async run({ steps, $ }) {

// Workflow only supports files <100mb, so break out if the file is larger.
if (steps.trigger.event.size > 100000000) {
  throw new Error("File is too large. Files must be mp3 or m4a filels under 100mb")
}

try {
    // Define the mimetype
    const mime = steps.trigger.event.path_lower.match(/\.\w+$/)[0]

    // Check if the mime type is supported (mp3 or m4a)
    if (mime !== '.mp3' && mime !== '.m4a') {
        throw new Error("Unsupported file type. Only mp3 and m4a files are supported.");
    }

    // Define the tmp file path
    const tmpPath = `/tmp/recording${mime}`

    // Download the audio recording from Dropbox to tmp file path
    const pipeline = promisify(stream.pipeline);
    await pipeline(
    got.stream(steps.trigger.event.link),
    fs.createWriteStream(tmpPath)
    );

    // Create a results object
    const results = {
    "tmpPath": tmpPath,
    "mimetype": mime
    }

    return results
} catch (error) {
    // Log the error and return an error message or handle the error as required
    console.error(error);
    throw error;
}

}
})

Any thoughts please and just incase you want to see the process this is the link - How to Transcribe Speech to Text with ChatGPT and Notion (thomasjfrank.com)

Problem:

When using the got.stream() function, an error occurs: “Missing url property”.

Cause:

The error occurs because the got.stream() function is missing a valid URL to download the file. In the provided code, the incorrect property was used as the URL.

Solution:

To fix the “Missing url property” error, follow these steps:

  1. Identify the correct property containing the download URL. In this case, it is the webContentLink property.
  2. Replace the incorrect property used in got.stream() with the correct one.

In the provided code, replace this line:

javascript

got.stream(steps.trigger.event.link),

with:

javascript

got.stream(steps.trigger.event.webContentLink),

After making these changes, the “Missing url property” error should be resolved.

I still get the error. I have replaced the line got.stream(steps.trigger.event.link), with got.stream(steps.trigger.event.link), and I get

RequestError

Missing url property

DETAILS

    at Request._destroy (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:481:21)
    at Request.destroy (internal/streams/destroy.js:39:8)
    at Request.Request.flush (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:240:22)
    at null.lastHandler (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:37:26)
    at null.iterateHandlers (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:49:28)
    at null.got (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:69:16)
    at Function.got.stream (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:169:37)
    at Object.run (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/component.mjs:29:13)
    at global.executeComponent (/var/task/launch_worker.js:139:53)
    at MessagePort.messageHandler (/var/task/launch_worker.js:598:28)file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:227:27)
    at null.got (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:31:25)
    at Function.got.stream (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:169:37)
    at Object.run (file:///tmp/__pdg__/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/component.mjs:29:13)
    at global.executeComponent (/var/task/launch_worker.js:139:53)
    at MessagePort.messageHandler (/var/task/launch_worker.js:598:28)

ExportsInputsLogsDetails

26/04/2023, 15:31:38

at Request._destroy (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:481:21) at Request.destroy (internal/streams/destroy.js:39:8) at Request.Request.flush (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:240:22) at null.lastHandler (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:37:26) at null.iterateHandlers (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:49:28) at null.got (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:69:16) at Function.got.stream (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:169:37) at Object.run (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/component.mjs:29:13) at global.executeComponent (/var/task/launch_worker.js:139:53) at MessagePort.messageHandler (/var/task/launch_worker.js:598:28)file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/core/index.js:227:27) at null.got (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:31:25) at Function.got.stream (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/node_modules/.pnpm/got@12.6.0/node_modules/got/dist/source/create.js:169:37) at Object.run (file:///tmp/pdg/dist/code/e2cad7443c48647d8b775490097010198eb03ef4e3c852a1f8e8bef15404c566/component.mjs:29:13) at global.executeComponent (/var/task/launch_worker.js:139:53) at MessagePort.messageHandler (/var/task/launch_worker.js:598:28) { input: undefined, code: ‘ERR_GOT_REQUEST_ERROR’, timings: undefined, name: ‘RequestError’, options: { request: undefined, agent: { http: undefined, https: undefined, http2: undefined }, h2session: undefined, decompress: true, timeout: { connect: undefined, lookup: undefined, read: undefined, request: undefined, response: undefined, secureConnect: undefined, send: undefined, socket: undefined }, prefixUrl: ‘’, body: undefined, form: undefined, json: undefined, cookieJar: undefined, ignoreInvalidCookies: false, searchParams: undefined, dnsLookup: undefined, dnsCache: undefined, context: {}, hooks: { init: [], beforeRequest: [], beforeError: [], beforeRedirect: [], beforeRetry: [], afterResponse: [] }, followRedirect: true, maxRedirects: 10, cache: undefined, throwHttpErrors: true, username: ‘’, password: ‘’, http2: false, allowGetBody: false, headers: { ‘user-agent’: ‘got (GitHub - sindresorhus/got: 🌐 Human-friendly and powerful HTTP request library for Node.js)’ }, methodRewriting: false, dnsLookupIpVersion: undefined, parseJson: [Function: parse], stringifyJson: [Function: stringify], retry: { limit: 2, methods: [ ‘GET’, ‘PUT’, ‘HEAD’, ‘DELETE’, ‘OPTIONS’, ‘TRACE’ ], statusCodes: [ 408, 413, 429, 500, 502, 503, 504, 521, 522, 524 ], errorCodes: [ ‘ETIMEDOUT’, ‘ECONNRESET’, ‘EADDRINUSE’, ‘ECONNREFUSED’, ‘EPIPE’, ‘ENOTFOUND’, ‘ENETUNREACH’, ‘EAI_AGAIN’ ], maxRetryAfter: undefined, calculateDelay: [Function: calculateDelay], backoffLimit: Infinity, noise: 100 }, localAddress: undefined, method: ‘GET’, createConnection: undefined, cacheOptions: { shared: undefined, cacheHeuristic: undefined, immutableMinTimeToLive: undefined, ignoreCargoCult: undefined }, https: { alpnProtocols: undefined, rejectUnauthorized: undefined, checkServerIdentity: undefined, certificateAuthority: undefined, key: undefined, certificate: undefined, passphrase: undefined, pfx: undefined, ciphers: undefined, honorCipherOrder: undefined, minVersion: undefined, maxVersion: undefined, signatureAlgorithms: undefined, tlsSessionLifetime: undefined, dhparam: undefined, ecdhCurve: undefined, certificateRevocationLists: undefined }, encoding: undefined, resolveBodyOnly: false, isStream: true, responseType: ‘text’, url: undefined, pagination: { transform: [Function: transform], paginate: [Function: paginate], filter: [Function: filter], shouldContinue: [Function: shouldContinue], countLimit: Infinity, backoff: 0, requestLimit: 10000, stackAllItems: false }, setHost: true, maxHeaderSize: undefined, signal: undefined, enableUnixSockets: true } }

26/04/2023, 15:31:38

ACTIVE_HANDLEThis step was still trying to run code when the step ended. Make sure you promisify callback functions and await all Promises. (Reason: FSReqCallback, Learn more: Running asynchronous code in Node.js)

Test

Test to deploy

Hi!

I have the same issue. Have tried the suggested solution, but still get the same error.

Hi @johnyoung1966, @sander.lindholm,

The error is because you have not selected an event in your trigger. Would you mind trying to upload an audio file to your Dropbox folder and select an event as in this step?

The code-heavy method requires sufficient coding knowledge, I would suggest you to follow the tutorial step by step as is, or trying the No-code method instead?

No, that doesn’t seem to be the case. I’ve already completed the previous steps (including adding a event with a corresponding audio file - with correct formating). I’ve also tried the previous suggestion, but the same error message appears.

Hi @sander.lindholm,

Could you share screenshots of your whole workflow? Could you confirm that you have created the Google Drive trigger with the correct configuration (the Include Link prop should be enabld)

I have seen people successfully make it work by folloingw the tutorial step by step. I would recommend you to watch/read the tutorial and follow them.

Also I would stongly recommend you to watch through Pipedream quickstart doc to understand how to use Pipedream

Hi @sander.lindholm,

I think I know the issue. The initial events are not containing the download url. You’ll need to upload a test audio file and select the event for that new file instead to get the url

The new event should have the link field available
image

Great! Thanks! Much appreciated. Worked perfectly!

I must be thick as I have rebuilt it from scratch and used new file, and still doesn’t work :frowning:

Hi, I don’t think you’re that thick! I’ve re-tried this issue two or three times now and am getting the same error as you. This is frustrating because two days ago it was running perfectly. I don’t know if there’s an issue with the trigger for whether it’s a “New” file or a file that’s been added to the watched folder—I can’t imagine that there’s any difference in this, but I’m really scratching my head.

Again, I had it running without any problems a couple of days ago…

uploaded a new file, and made sure to select that new file during step one of the dropbox workflow - worked perfectly–thank you!