---
title: "Cleaning up Plex with Google Apps Scripts"
author: "Sourabh Choraria"
date: 2020-05-30T18:06:29+00:00
canonical_url: https://pulse.appsscript.info/p/2020/05/cleaning-up-plex-with-google-apps-scripts/
markdown_url: https://pulse.appsscript.info/p/2020/05/cleaning-up-plex-with-google-apps-scripts.md
categories:
  - "Solutions"
tags:
  - "@stefanbc"
  - "stefancosma.xyz"
description: "Using the UrlFetchApp library and the fetch method we call the Plex media server to retrieve all the contents of our library. We parse the XML response to JSON using a method that you can..."
---

# Cleaning up Plex with Google Apps Scripts

[![](https://images.unsplash.com/photo-1461151304267-38535e780c79?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=2000&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ)](https://stefancosma.xyz/2020/05/29/cleaning-up-plex-with-google-scripts/)

> Using the UrlFetchApp library and the fetch method we call the Plex media server to retrieve all the contents of our library. We parse the XML response to JSON using a method that you can find [here](https://gist.github.com/stefanbc/2b607c77961d42532043da1ee48d84d1#file-utilities-gs). You can add the parsing method to the same file, if you want.

This tutorial is going to cover what it takes to automatically cleanup a Plex media server, using Google Apps Scripts.

Source: *[Cleaning up Plex with Google Apps Scripts*](https://stefancosma.xyz/2020/05/29/cleaning-up-plex-with-google-scripts/)

---

*Published by [Sourabh Choraria](https://pulse.appsscript.info/p/author/scriptgs/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2020/05/cleaning-up-plex-with-google-apps-scripts/](https://pulse.appsscript.info/p/2020/05/cleaning-up-plex-with-google-apps-scripts/)*
