A lot of Rails apps end up with the same feature: a user pastes a YouTube, TikTok or podcast link, and the app needs the transcript or the file. It works in development. Then it runs on a server and the media job is the one that breaks: sites block datacenter IPs, and plenty of videos have no captions to read.
I built Importly for this, so that's what this post calls. You send it a link and get back the transcript, a download link for the file, or the video's details, and it works from servers. The part worth getting right in Rails is the job side, so that's most of this post. It's plain Active Job and Net::HTTP , so it runs on Sidekiq, Solid Queue or GoodJob.
Long imports can take a few minutes, so don't hold a worker for them. One job starts the Importly job and stores its ID, and a second job checks the status and enqueues itself again 20 seconds later until it's done.…