Automate user prompt media_uri file download

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

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.

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.default_directory" : ".\Download"};
options.add_experimental_option("detach", True)
options.add_experimental_option('prefs', prefs)
driver = webdriver.Chrome(options=options)

driver.get('https://prod-euw1-audio-prompts.s3.eu-west-1....')
elem = driver.find_element(By.XPATH, "/html/body/video")
actionChain = ActionChains(driver)
actionChain.context_click(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.

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