Legacy Dev Forum Posts

 View Only

Sign Up

Automate user prompt media_uri file download

  • 1.  Automate user prompt media_uri file download

    Posted 06-05-2025 19:12

    Dewald_Smit | 2022-12-14 23:58:57 UTC | #1

    Good day fellow CX Geniuses :slightsmile: I am looking for advise on how to download the mediauri source file. Pulling a list with prompt id and the mediauri for each resource is not the issue i am stuck with, the issue at hand is how to grab the audio file from the mediauri?

    One thought of a possible solution is to use a HTTP GET request on the media_uri, but it's an encrypted AWS link that cannot be downloaded. Can only download via the player download option. I could try and use selenium to download the file, but to do this for 1000+ prompts is going to be hectic(heavy)

    Any insight will be much appreciated.


    Dewald_Smit | 2023-01-03 16:20:54 UTC | #2

    Worked out a solution, that works, to a degree, in testing so far:

    import pyautogui from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By

    from selenium.webdriver.support.wait import WebDriverWait

    Setup Chrome Options

    options = webdriver.ChromeOptions(); prefs = {"download.defaultdirectory" : ".\Download"}; options.addexperimentaloption("detach", True) options.addexperimental_option('prefs', prefs) driver = webdriver.Chrome(options=options)

    driver.get('https://prod-euw1-audio-prompts.s3.eu-west-1....') elem = driver.findelement(By.XPATH, "/html/body/video") actionChain = ActionChains(driver) actionChain.contextclick(elem).perform()

    pyautogui.typewrite(['down','down','down','down','enter'])

    This then results in a .tmp file in the download folder that needs to be renamed to .wav and the file can be played.

    Will have to find and rename the downloaded files, but that's not a problem as I still need to change the download option to save the initial file with the prompt name and not the GUID. :slight_smile:

    Hope this helps anyone in future.

    PS: If anyone has a better solution im still open for ideas.


    system | 2023-01-15 11:19:41 UTC | #3

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 17657