How to Auto-Download Podcasts to Google Drive with Google Sheets?

Auto-Download Podcasts to Google Drive with Google Sheets

If you are wondering how to Auto-Download Podcasts to Google Drive with Google Sheets, then you are at the right place. In this tutorial, we will discuss the steps which will allow you to download podcasts to Google Drive.

Using the Google Sheets as the Podcasts Manager allows you to download the preferred Podcasts on Google Drive and instantaneously sync them all across your gadgets.

This guide designates how Google Sheets can be brought into use for building your peculiar podcast manager. It can also help you to stipulate a record of your desired podcast illustrations within Google Sheets. And moreover, it will by design download fresh chapters into your Google Drive in effortlessly prearranged folders.

Luckily the process to auto-download podcasts to Google drive is quite easy, the program is absolutely open-source and therefore no prior experience of hardcore programming language is required.

How does the Drive Podcast Manager work?

To find out how the drive podcast manager works, we tried to show it using an example, below find the details given. It is a mandate to position the hyperlinks of your desired podcasts within column A of Google Sheet as a verified source.

How the Drive Podcast Manager Works?

The program will habitually achieve the utmost fresh incidents of every podcast to Google Drive. You might disclose MP3 evidence from Google Drive or determine them immediately within the Google Sheet that’s undistinguishable.

How the Drive Podcast Manager Works?

The application will generate a spanking new wallet, named Podcasts within Google Drive. This folder contains; it would also construct sub-folders for all podcasts existing within the folder classification comparable for the reason that the heading of the podcast.

How the Drive Podcast Manager Works?

How to Download Auto-Download Podcasts to Google Drive?

Below are the instructions on how it is possible to construct the personal podcast manager using Google Drive and Google Sheets.

  1. First, you need to hit on the Option to generate a copy of Google Sheet within your Google account.
  2. Then access the spreadsheet which you have copied, switch to Subscriptionssheet and then put in the RSS feed hyperlinks of favourite podcasts within column A.
  3. Now visit the menu of Extensions and click on Script Editor for launching the fundamental file of Google Apps Script.
  4. Then from the list of functions, you need to click on the Install Function and press on Run to enter into the app. The app needs to be authorized as early as possible as it needs permission for saving the file in Google Drive when you are not available.

That is all about it. The application will now operate every limited hour within the background and achieve the utmost latest episodes of the desired podcasts within Google Drive.

The Technical Information How this Works:

If you are inquisitive to gain knowledge using the approach the complete thing functions, right here are the technical essentials.

The application utilizes the API of Spreadsheet to absorb the podcasts record by means of Google Sheet. Then it also utilizes the service of XML of Apps Script to construe the RSS feed and then extract the fresh episodes of podcasts that are published since the last check.

Every podcast RSS feeds are compulsory to enclose an <item> tag using a <enclosure> tag within. The <enclosure> tag integrates the URL of the MP3 file and that’s what the application brings into usage to obtain the URL of the equivalent episode.

const parseRSS = (xmlUrl, lastUpdatedTime) => {
  const feed = UrlFetchApp.fetch(xmlUrl).getContentText();
  const doc = XmlService.parse(feed);
  const root = doc.getRootElement();
  const channel = root.getChild('channel');
  const episodes = channel
    .getChildren('item')
    .map((item) => ({
      date: new Date(item.getChildText('pubDate')),
      title: item.getChildText('title'),
      enclosure: item.getChild('enclosure')?.getAttribute('url')?.getValue(),
    }))
    .filter(({ date }) => date > lastUpdatedTime)
    .filter(({ enclosure }) => enclosure);
  return { title: channel.getChildText('title'), episodes };
};

The moment the application has a catalogue of fresh episodes, the UrlFetch service is immediately brought into usage for the purpose of obtaining podcasts and stores them within Google Drive into a folder precise to the available podcast.

The app also inscribes a fresh row to Google Sheet using a hyperlink of a Google Drive file and also a time-snapshot of when the episode was downloaded.

const getPodcastFolder = (folderName) => {
  const parentFolder = DriveApp.getFoldersByName('Podcasts').next();
  const folders = parentFolder.getFoldersByName(folderName);
  if (folders.hasNext()) return folders.next();
  return parentFolder.createFolder(folderName);
};

const downloadPodcast = (podcastTitle, episodeUrl, episodeTitle) => {
  try {
    const blob = UrlFetchApp.fetch(episodeUrl).getBlob();
    const folder = getPodcastFolder(podcastTitle);
    const file = folder.createFile(blob);
    SpreadsheetApp.getActiveSheet().appendRow([
      new Date(),
      `=HYPERLINK("${episodeUrl}";"${episodeTitle}")`,
      `https://drive.google.com/file/d/${file.getId()}/view`,
    ]);
  } catch (f) {
    console.error(f);
  }
};

Conclusion:

So, this is all about How to Auto-Download Podcasts to Google Drive with Google Sheets? Here I tried to list down the complete steps to download the Podcasts to Google drive using the Google Sheets.

Hope the article works for you, let us know in the comment section if there is anything that we missed out on.

Thank you..!

Leave a Comment